autolink
Version, currently 0.1.24 versions
- 0.1.3latestAug 5, 2017
- 0.1.2not indexedMay 11, 2020
- 0.1.1not indexedMay 11, 2020
- 0.1.0not indexedMay 11, 2020
github.com/crystal-community/autolink.cr
:link: Auto link for Crystal
17 stars
1 dependent
License: MIT
Nothing has been indexed for 0.1.2 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
autolink:
github: crystal-community/autolink.cr
version: ~> 0.1.2Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.2. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# :link: Autolink [](https://travis-ci.org/hugoabonizio/autolink.cr)
*Autolink.cr* is a Crystal shard that automatically turns URLs into links.
Example:
```crystal
auto_link("Welcome to my profile https://github.com/hugoabonizio")
# => Welcome to my profile <a href="https://github.com/hugoabonizio">https://github.com/hugoabonizio</a>
```
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
autolink:
github: hugoabonizio/autolink.cr
```
## Usage
```crystal
require "autolink"
include Autolink
auto_link("My blog: http://www.myblog.com/", html: {"class" => "menu", "target" => "_blank"})
# => My blog: <a href=\"http://www.myblog.com/\" class=\"menu\" target=\"_blank\">http://www.myblog.com/</a>
```
### Simple autolink
Without providing any HTML options *autolink.cr* will just wrap the URL with ```<a>``` tag.
```crystal
Autolink.auto_link("Welcome to my new blog at http://www.myblog.com/")
# => Welcome to my new blog at <a href="http://www.myblog.com/">http://www.myblog.com/</a>
```
### Custom tag attributes
The ```<a>``` tag can receive custom attributes.
```crystal
Autolink.auto_link("My blog: http://www.myblog.com/", html: {"class" => "menu", "target" => "_blank"})
# => My blog: <a href=\"http://www.myblog.com/\" class=\"menu\" target=\"_blank\">http://
```
## Contributing
1. Fork it ( https://github.com/hugoabonizio/autolink.cr/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [hugoabonizio](https://github.com/hugoabonizio) Hugo Abonizio
- [veelenga](https://github.com/veelenga) V. Elenhaupt
This project is a port to Crystal of [rails_autolink](https://github.com/tenderlove/rails_autolink) Ruby gem. Thanks to all its [contributors](https://github.com/tenderlove/rails_autolink/graphs/contributors).Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.2- Tagged
- May 11, 2020
- Commit
3caadc76acf9- Indexed
- not yet
Dependents
Repository
github.com/crystal-community/autolink.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 4