3 ms·
MD->HTML->PDF. Just use a browser to render your document. You can make the process a bit more automated by using something like Chrome Headless. I'm sure th
by xienze 9y ago
MD->HTML->PDF. Just use a browser to render your document. You can make the process a bit more automated by using something like Chrome Headless. I'm sure there's a project out there that does this all in one step from the commandline.
- donquichotte 9y agoThis approach is what I have sometimes been using. It works OK and I can style my documents with CSS. But there are little things that bug me, like headlines on the last line of page N and the paragraph starting on page N+1 and header/footer lines generated by the browser.
- laxis 9y agofor what it's worth you can define pagebreaks with css [0]. it's not the most user-friendly way, but works. the @page rule also comes in quite handy [0]: https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-...
- nathan_long 9y agoMy setup: 1) I have cmark installed 2) https://github.com/nathanl/.dotfiles/blob/master/bin/md_preview https://github.com/nathanl/.dotfiles/blob/master/bin/md_prev... is a script to render STDIN to HTML and slap the output into the middle of a template that has some basic CSS (https://github.com/nathanl/.dotfiles/blob/master/bin/md_preview_template.html https://github.com/nathanl/.dotfiles/blob/master/bin/md_prev...) 3) I write markdown in Vim and use keybindings to say "now output HTML from this buffer" - https://github.com/nathanl/.dotfiles/blob/ede8c98a7897ee07b724b4225c2ac3a765341c25/vim/vimrc#L299-L302 https://github.com/nathanl/.dotfiles/blob/ede8c98a7897ee07b7... I like this mainly because it lets me use Vim, which for me is the most efficient tool for wrangling text. I also like avoiding WISYWIG programs that I previously fought with - eg, trying to get Word to understand which bullet points I wanted nested under which other ones was frustrating, but with markdown (and embedded HTML when necessary) I can be 100% explicit. Sometimes I copy-paste the resulting HTML into Google Docs or elsewhere and do further tweaks, but most of the time it's enough for me as-is.