Thursday, June 10, 2021

Re: Highlight and annotate plaintext

On Thu, Jun 10, 2021 at 12:39:34PM +0200, meine wrote:
> On Tue, Jun 08, 2021 at 01:54:39PM +0200, Julius Hamilton wrote:
> > Hey,
> >
> > Does anyone know a good command line tool for highlighting and annotating
> > plain text documents? Not syntax highlighting via pattern matching. Just
> > going through a document with a cursor, and highlighting it for the purpose
> > of note-taking. Plus adding comments would be good, but optional.

The explanation here is better:

https://stackoverflow.com/questions/4823468/comments-in-markdown

[citation]: If you want a comment that is strictly for yourself (readers of the converted document should not be able to see it, even with "view source") you could (ab)use the link labels (for use with reference style links) that are available in the core Markdown specification:

http://daringfireball.net/projects/markdown/syntax#link

That is:

[comment]: <> (This is a comment, it will not be included)
[comment]: <> (in the output file unless you use it in)
[comment]: <> (a reference style link.)

Or you could go further:

[//]: <> (This is also a comment.)

To improve platform compatibility (and to save one keystroke) it is also possible to use # (which is a legitimate hyperlink target) instead of <>:

[//]: # (This may be the most platform independent comment)

For maximum portability it is important to insert a blank line before and after this type of comments, because some Markdown parsers do not work correctly when definitions brush up against regular text.

In general, this approach should work with most Markdown parsers, since it's part of the core specification. (even if the behavior when multiple links are defined, or when a link is defined but never used, is not strictly specified).

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YMHtFWkCbjooML23%40trackstand.

No comments:

Post a Comment