Deadlink

Build Status Code Climate Dependency Status Gem Version

Check deadlink of markdown files in your git repository.

Example

$ ls

git_repo

$ deadlink git_repo

show deadlink info.

<deadlink> in <md file path> line: <line number>

case of this repository

$ git clone [email protected]:yutakakinjyo/deadlink.git
$ deadlink deadlink/

result is this

contributor-covenant.org in ./README.md line: 73
nothing_file3.md in ./test/files/dir1/nest_file1.md line: 2
dir1/nothing_nest_file2.md in ./test/files/top.md line: 3
nothing_dir in ./test/files/top.md line: 5
nothing.txt in ./test/files/top.md line: 8

not check patterns

this gem not check following patterns yet. applying these patterns to gem is future task.

  • http(s) link
  • multibyte characters

Installation

$ gem install deadlink

Usage

specify path of directory

$ deadlink <dir>

if you want to start scanning from current directory, you can specify . to <dir> path

$ deadlink .

if you not specify <dir> path, deadlink scan top directory of current git repository.

$ deadlink

specify a file

$ deadlink <file path>

Option

-p option output for editor. In this repository case

$ deadlink -p deadlink/

+46 ./README.md
+90 ./README.md
+2 ./test/files/dir1/nest_file1.md
+3 ./test/files/top.md
+5 ./test/files/top.md
+8 ./test/files/top.md

Forexample you can jump deadlink line easily, like following command.

$ vi $(deadlink -p deadlink/ | peco)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yutakakinjyo/deadlink. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.