Skip to content

mebble/ltag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ltag

CI Tests CI Release Downloads on latest release

A CLI tool to tag your lines based on their headings

Basic Usage

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.

Features

  • 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

Development

Scaffolded with go mod init github.com/mebble/ltag

Testing

make test

Benchmarking

make bench