lite-xl-plugins icon indicating copy to clipboard operation
lite-xl-plugins copied to clipboard

added mdpreview, a markdown previewer

Open Not-a-web-Developer opened this issue 2 years ago • 3 comments

since the ghmarkdown plugin was using the GitHub API for converting markdown to html, there were privacy concerns (let alone the fact that it wouldn't work offline); so I wrote a markdown previewer that has the same user experience as ghmarkdown, but uses either luamd (a markdown rendering library in lua) or pandoc to render markdown, depending on which branch is used.

was requested by @jgmdev and myself, and it's finally complete enough for me to publish it.

edit: this is the link: https://github.com/not-a-web-developer/lite-xl-mdpreview

Not-a-web-Developer avatar Apr 13 '22 10:04 Not-a-web-Developer

Another idea: instead of having two branches why not try to use pandoc by default and if not found on PATH fallback to luamd, also you could add a config option called renderer (eg: config.plugins.mdpreview.renderer) or something similar which could have one of three string values:

  • "auto" - check if pandoc is available and use it otherwise fallback to luamd
  • "pandoc" - use pandoc by default and throw error message if not in PATH
  • "luamd" - use luamd by default

jgmdev avatar Apr 13 '22 18:04 jgmdev

Another idea: instead of having two branches why not try to use pandoc by default and if not found on PATH fallback to luamd, also you could add a config option called renderer (eg: config.plugins.mdpreview.renderer) or something similar which could have one of three string values:

  • "auto" - check if pandoc is available and use it otherwise fallback to luamd
  • "pandoc" - use pandoc by default and throw error message if not in PATH
  • "luamd" - use luamd by default

that's a good idea, i should probably change this to a draft PR to work on it.

Not-a-web-Developer avatar Apr 13 '22 18:04 Not-a-web-Developer

I like the idea of an offline markdown preview. Are you still working on this?

SwissalpS avatar Jun 26 '23 14:06 SwissalpS