English | 日本語
url-anchor
url-anchor
converts URL to HTML <a>
tag.
Description
url-anchor
converts URL and page titles to HTML <a>
tag when you give a URL.
You can also convert a URL to a Markdown link by specifying an option.
You can also convert a URL to a reStructuredText link by specifying an option.
Usage
$ url-anchor https://google.com
<a href="https://google.com">Google</a>
$ url-anchor -m https://google.com
[Google](https://google.com)
$ url-anchor -r https://google.com
`Google <https://google.com>`_
$ url-anchor -help
# ...
Or, you can use Docker.
$ docker container run --rm ebc2in2crc/url-anchor https://google.com/
<a href="https://google.com/">Google</a>
You can also read the URL from the standard input.
$ echo https://google.com | url-anchor -
<a href="https://google.com">Google</a>
$ cat << EOF | url-anchor -
https://google.com
https://www.whitehouse.gov
EOF
<a href="https://google.com">Google</a>
<a href="https://www.whitehouse.gov">The White House</a>
Use a clipboard (Only macOS)
- Copy the URL to the clipboard.
- Execute the following command to copy the result to the clipboard.
$ url-anchor $(pbpaste) | pbcopy
# $ pbpaste
# <a href="https://www.yahoo.co.jp/">Yahoo! JAPAN</a>
Installation
Developer
$ go get -u github.com/ebc-2in2crc/url-anchor/...
User
Download from the following url.
Or, you can use Homebrew (Only macOS).
$ brew tap ebc-2in2crc/tap
$ brew install url-anchor
Or, you can use Docker.
$ docker image pull ebc2in2crc/url-anchor
Contribution
- Fork this repository
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Rebase your local changes against the master branch
- Run test suite with the
make test
command and confirm that it passes
- Run
make fmt
and make lint
- Create new Pull Request
Licence
MIT
Author
ebc-2in2crc