A CLI tool to tag your lines based on their headings
Imagine you have a file info.txt
:
# animals
elephant
## felines
cats
tigers
## canines
dogs
wolves
Pipe its contents to ltag:
cat info.txt | ltag
The output:
elephant #animals
cats #animals #felines
tigers #animals #felines
dogs #animals #canines
wolves #animals #canines
For more examples, check out the test data at ./test/testdata/
. For more usage information, run ltag --help
.
- Tag the lines to the values of headings, sub-headings and inline tags
- Tags are slugified
- Customise the string pattern used to identify headings and to format the tags
- Trim off the tags from lines that have already been ltagged
Scaffolded with go mod init github.com/mebble/ltag
make test
make bench