Show HN: Livedown – realtime Markdown previews for Vim, Emacs and Sublime
github.com
github.com
Another great editor-independent alternative is livereload + a markdown rendering plugin for your browser.
I really understand what you mean with the dependencies, it is by far the heaviest plugin I have installed.
I mention it as the live previews in both those apps are the real winners for me, and having something like that in my regular text editor would be awesome. Not such a fan of the browser based previews, but I'll give it a go!
https://www.indiegogo.com/projects/mou-1-0-markdown-editor-o...
Only minor comment is that you say "realtime" but from the demo it seems like that the view is updated only when you hit save right?
Off to test it out now!
Edit: went through all the steps and live preview doesn't seem to be working. Does the plugin work under ST3? I also assume that there's a missing step in the readme, so I cloned the git repo to the Packages sub-directory as "Livedown". Hoping I've just made a silly mistake with the setup.
Edit #2: So I verified that running from the command line works and it loads my markdown file without any problems. The link with Sublime doesn't seem to be working though, so when I make changes, I can see them in the browser window by refreshing. Guessing something is screwed up in the way the plugin is setup on my laptop.
The downside of course is if you're in the middle of some big change, the preview is useless and a bit distracting.
- I couldn't get it to work with the after/mkd directory via pathogen. Not sure why. Moving the small bits of vimscript up in the load order worked for me.
- I think the behavior of making it auto-open upon buffer switch is un-vimlike and probably annoying. Better to just support the LivedownPreview() function. (Also, the other function has code repetition it seems.)
- The npm module (livedown) uses highlight.js for code highlighting with default options. For a standard README.md I just opened, it thought some Python code blocks were alternatively nginx or bash, because they were very short, thus did wrong syntax highlighting. You probably want to turn off language auto-detection. You can do this by doing
hljs.configure({languages: []})
before calling hljs.highlightBlock(). HTH. I'll also open a Github issue about this.This plugin acts as a browser reloader, like the ones you find for HTML/CSS, which is already helpful in itself.
What does livedown add?
It's not exactly the markdown / wiki output (because you still see e.g. the `+++` at the beginning of header lines) but you can at least see when you've messed up the markdown (because it doesn't render correctly). It's a bit like syntax highlighting now that I think of it.
See the screenshot on e.g. http://www.neilvandyke.org/erin-twiki-emacs/ for what I'm talking about.