ldoc icon indicating copy to clipboard operation
ldoc copied to clipboard

Improve markdown template

Open nicholaschiasson opened this issue 4 years ago • 3 comments

Heavily based on ldoc_ltp.lua.

Requires template_escape = "!" setting in config.ld.

nicholaschiasson avatar Mar 08 '21 01:03 nicholaschiasson

Requires template_escape = "!" setting in config.ld.

Isn't that a breaking change? Can't we stick to the original ( > iirc)

Tieske avatar Mar 09 '21 15:03 Tieske

@Tieske Yes I think I didn't do enough investigation for this change. I will make it a draft and come back to it.

However, my decision to change the template escape to something else was because > is the block quote character in markdown spec. I don't know the best way to address this.

nicholaschiasson avatar Mar 09 '21 15:03 nicholaschiasson

Tieske, I found your .md template to be very helpful in drafting my own markdown template. Yes, the built-in one is too simplistic.

But regarding your question on the escape character, I suspect that > was chosen specifically because it is a block quote character in markdown: you wouldn't normally want a block-quote hard-coded into a template. And if you did, you could easily start your template line with $('>') to achieve the same effect.

However, I did find that yours needs some polishing. For example, whitespace is not trimmed from the ends of item names, and I found that my markdown renderer (Typora) requires - within hrefs, rather than _.

berwynhoyt avatar Jun 26 '23 11:06 berwynhoyt