News for hackers. Stuff that matters.
Re:Show HN: Improved Markdown Links by leejoramo on Wednesday July 18, 2018 @09:17AM (#17558068)
> Lazy Link version of comment

  I have done this type of thing for years. It is similar
  to the 'Lazy Link' work by Brett Terpstra[*] and Tyler
  Butler[1]. 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][*] about the maintainability of link  
  order.

  While I do not use footnotes in Markdown, Lazy links can
  [extended to footnotes][2]

  I suggest to jgalvez reference the term "Lazy Links" in 
  your documents for search-ability of this feature.

  [*]: http://brettterpstra.com/2013/10/19/lazy-markdown-reference-links/

  [1]: https://www.tylerbutler.com/2014/05/markdown-lazy-links-in-python/

  [*]: https://news.ycombinator.com/item?id=17547765

  [2]: http://brettterpstra.com/2013/10/30/lazy-markdown-footnotes/
Re:Show HN: Improved Markdown Links by leejoramo on Wednesday July 18, 2018 @09:22AM (#17558113)
> 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/
Re:Show HN: Improved Markdown Links by jgalvez on Wednesday July 18, 2018 @12:14PM (#17559646)
Nice! Will do.
Re:Show HN: Improved Markdown Links by chalst on Tuesday July 17, 2018 @02:34AM (#17547765)
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.
Re:Show HN: Improved Markdown Links by jgalvez on Tuesday July 17, 2018 @03:00AM (#17547854)
Good point. For me that's an edge case, though. Cutting and pasting to reorder seems easier than editing refs too.
Re:Show HN: Improved Markdown Links by hmmm5 on Tuesday July 17, 2018 @01:25PM (#17551392)
> 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)