conornewton / vim-pandoc-markdown-preview

Vim plugin for previewing pandoc markdown
GNU General Public License v3.0
24 stars 8 forks source link

deeply nested markdown #7

Open gmdjango opened 5 years ago

gmdjango commented 5 years ago

Hi,

While it is not an issue of vim-pandoc-markdown-preview, since there is a possible solution, it would be great to solve it.

Problem: markdown which is deeply nested (say 5+ levels), is not parsed by pandoc to pdf

However, pandoc converts the same deply nested markdown to html just fine.

I was wondering, can you somehow make this work off an html file?

example of my mapping: nnoremap <Leader>pd :w!<CR>:w!/home/myuser/tmp/vim-markdown.md<CR>:!pandoc -s -f markdown -t html -o /home/myuser/tmp/vim-markdown.html /home/myuser/tmp/vim-markdown.md<CR>:!dillo /home/myuser/tmp/vim-markdown.html > /dev/null 2> /dev/null&<CR><CR>

as you can see, i am using a temporary file, and a browser called dillo which has a very small footprint. But, it's not a real time rendering..

Let me know what you think.

jasonccox commented 4 years ago

Pandoc's --pdf-engine option makes it possible to compile Markdown to PDF using HTML as the intermediate step. You could set g:md_args to something like --pdf-engine=wkhtmltopdf to have this plugin do that. If Pandoc can convert your nested Markdown to HTML fine, then I would guess that would work to convert it to PDF as well.