

Show HN: Livedown – realtime Markdown previews for Vim, Emacs and Sublime - shime
https://github.com/shime/livedown

======
hobofan
vim-instant-markdown [0] has been around for quite some time and if the gif on
livedowns github page is representative provides much faster preview.

Another great editor-independent alternative is livereload + a markdown
rendering plugin for your browser.

[0] [https://github.com/suan/vim-instant-
markdown](https://github.com/suan/vim-instant-markdown)

~~~
shime
thanks, I'm aware of it and I've mentioned it in the readme. I don't like how
much dependencies it has, so I've decided to make this.

~~~
hobofan
Oh, didn't see that.

I really understand what you mean with the dependencies, it is by far the
heaviest plugin I have installed.

------
Joe8Bit
On a slightly tangential note, after having used Mou for a while I've recently
moved to Macdown[0] for Markdown editing on the Mac after Mou seemed to be
abandoned, plus, it's open source!

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!

[0] [http://macdown.uranusjr.com/](http://macdown.uranusjr.com/)

~~~
rcsorensen
Mou isn't abandoned. The creator has recently started an IndieGoGo project to
fund 1.0.

[https://www.indiegogo.com/projects/mou-1-0-markdown-
editor-o...](https://www.indiegogo.com/projects/mou-1-0-markdown-editor-on-os-
x-for-you)

------
kartikkumar
Cool! I've been actually thinking I should get something like this for Sublime
because I'm often correcting silly mistakes in my Github repo readme's that I
only notice once the Markdown renders in browser.

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.

~~~
evanrelf
If you're on Mac, you should definitely check out Marked 2:
[http://marked2app.com](http://marked2app.com)

~~~
santa_boy
If you are looking for cross platform, checkout
[Haroopad]([http://pad.haroopress.com/](http://pad.haroopress.com/)). It is
based on node-webkit and is free. That opens up a lot of improvement
possibilities.

------
pixelmonkey
Some bugs with vim-livedown:

\- 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.

~~~
shime
Thank you for reporting this! Opened issues from your comment.

------
bbx
I thought it would be realtime like
[http://tmpvar.com/markdown.html](http://tmpvar.com/markdown.html) (although
you miss all your text editor features).

This plugin acts as a browser reloader, like the ones you find for HTML/CSS,
which is already helpful in itself.

~~~
bshimmin
For those wondering about "like the ones you find for HTML/CSS",
[http://livereload.com](http://livereload.com) is what you're looking for (or
at least one choice, anyway).

------
ilchenearly
This makes a similar concept with marked2
([http://marked2app.com](http://marked2app.com)), you write markdown on any
app you like and then preview it using another tool. But personally, I prefer
to do the previewing and writing on the sometime. So my ideal markdown eidtor
is something like Typora ([http://typora.io](http://typora.io))

------
FatalBaboon
In Emacs you could achieve the same thing without node dependency, the
markdown mode already supports previewing in browser so you could add two
hooks (on 'markdown-mode-hook and 'after-save-hook) and call 'markdown-preview
on the latter.

What does livedown add?

~~~
philsnow
If you're using emacs in a native window (not curses/terminal), various modes
render e.g. section headings, emphasis, etc right in the buffer you're
editing, no need for a preview window.

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/](http://www.neilvandyke.org/erin-twiki-emacs/) for what I'm talking
about.

------
nymanjon
Is it possible to get this plugin to work with pandoc-style markdown, or is
there another similar plugin to it out there?

~~~
shime
which editor are you using?

------
benbristow
GitHub's Atom has this as a package pre-installed. Pretty nice I must say.

