Show HN: Improved Markdown Links(github.com)
github.com
Show HN: Improved Markdown Links
https://github.com/galvez/nuxpress#improved-markdown-links
6 comments
> Lazy Link version of comment
> Saved Numbered Link version of comment
I have done this type of thing for years. It is similar
to the 'Lazy Link' work by Brett Terpstra[1] and Tyler
Butler[2]. I have tweaked my own python version of this
script over the years. My script recognizes Numbered and
Lazy links, maintains the order of Number Links while
adding in the Lazy links.
Importantly, I DO NOT LEAVE MY TEXT IN LAZY FORMAT, but
run my script to convert everything to numbered and SAVE
it. In fact, I have VS Code set to automatically run
every time I save a markdown document. This addresses
[chalst's point][3] about the maintainability of link
order.
While I do not use footnotes in Markdown, Lazy links can
[extended to footnotes][4]
I suggest to jgalvez reference the term "Lazy Links" in
your documents for search-ability of this feature.
[1]: http://brettterpstra.com/2013/10/19/lazy-markdown-reference-links/
[2]: https://www.tylerbutler.com/2014/05/markdown-lazy-links-in-python/
[3]: https://news.ycombinator.com/item?id=17547765
[4]: http://brettterpstra.com/2013/10/30/lazy-markdown-footnotes/Nice! Will do.
If you rewrite a paragraph so that the order that links appear is broken, then you need to figure out how to do that reordering on the links. I don't find this more maintainable.
Good point. For me that's an edge case, though. Cutting and pasting to reorder seems easier than editing refs too.
> For me that's an edge case, though
You rarely edit a paragraph with links?
I think a better way is to specify the number a link refers to but reorder it if it's out of order. So maybe you have 1,2,3 then after an edit it's 1,2,5,4,3 then after publishing it becomes 1,2,3,4,5 while still prserving the order of links (so only changing numbers)
You rarely edit a paragraph with links?
I think a better way is to specify the number a link refers to but reorder it if it's out of order. So maybe you have 1,2,3 then after an edit it's 1,2,5,4,3 then after publishing it becomes 1,2,3,4,5 while still prserving the order of links (so only changing numbers)