Live data from Hacker News

Show HN: Ltag – A Go CLI tool to tag your text lines

github.com

1–5 of 5 posts

Show HN: Ltag – A Go CLI tool to tag your text lines

#1
This is a tool I wrote to address a need I had: to search over lines of text, but by "tag" or "category". I created ltag to add tags to plaintext lines, and rely on fzf to do the searching for me. ltag interacts with the outside world only through stdin and stdout, so that it interfaces easily with other CLI tools.

Show HN: Ltag – A Go CLI tool to tag your text lines
github.com

Re: Show HN: Ltag – A Go CLI tool to tag your text lines

#3

This is really cool - thanks for sharing! Is there a way to have multiple categories in a file that aren’t subcategories of the first tag?

Thanks! And yeah we can put an empty line to break off into a new category. So essentially it's one category per paragraph. Within a paragraph, there can be sub-categories one level deep. You can also put tags inline.

I'm still trying to figure out how to allow nesting categories an arbitrary number of levels deep. But I don't want to introduce extra symbols and stuff, it'll be too much complexity too early on. I can imagine that for most cases, headings, sub-headings and inline tags are enough.

I will allow more customisation soon, such as using multiple heading identifiers. I'll add features as the need arises. I haven't used it for very long myself.

Re: Show HN: Ltag – A Go CLI tool to tag your text lines

#4
post #3

This is really cool - thanks for sharing! Is there a way to have multiple categories in a file that aren’t subcategories of the first tag?

Thanks! And yeah we can put an empty line to break off into a new category. So essentially it's one category per paragraph. Within a paragraph, there can be sub-categories one level deep. You can also put tags inline. I'm still trying to figure out how to allow nesting categories an arbitrary number of levels deep. But I don't want to introduce extra symbols and stuff, it'll be too much complexity too early on. I can…

My naive initial assumption (just due to my own bias) was that nesting would work the same way as in Markdown – i.e., that the number of `#`’s indicates the heading level.

Maybe worth for you to consider? It’s a well known convention, it should be fairly self-explanatory, and it would work independent of the notion of paragraphs.

    # animals
    elephant
    ## felines
    cats
    # plants
    apple tree
    ## flowers
    lily

Re: Show HN: Ltag – A Go CLI tool to tag your text lines

#5
post #4
post #3

Earlier quoted context omitted.

Thanks! And yeah we can put an empty line to break off into a new category. So essentially it's one category per paragraph. Within a paragraph, there can be sub-categories one level deep. You can also put tags inline. I'm still trying to figure out how to allow nesting categories an arbitrary number of levels deep. But I don't want to introduce extra symbols and stuff, it'll be too much complexity too early on. I can…

My naive initial assumption (just due to my own bias) was that nesting would work the same way as in Markdown – i.e., that the number of `#`’s indicates the heading level. Maybe worth for you to consider? It’s a well known convention, it should be fairly self-explanatory, and it would work independent of the notion of paragraphs. # animals elephant ## felines cats # plants apple tree ## flowers lily

Ahh I don’t know how i missed that. I guess i didn’t see the forest for the trees. This looks like the right way to go