url-anchor

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 12 Imported by: 0

README

English | 日本語

url-anchor

Build Status MIT License GoDoc Go Report Card Version

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)
  1. Copy the URL to the clipboard.
  2. 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

  1. Fork this repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Rebase your local changes against the master branch
  5. Run test suite with the make test command and confirm that it passes
  6. Run make fmt and make lint
  7. Create new Pull Request

Licence

MIT

Author

ebc-2in2crc

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL