vim-instant-markdown icon indicating copy to clipboard operation
vim-instant-markdown copied to clipboard

Convert Markdown to PDF Locally with this flavour

Open hallzy opened this issue 8 years ago • 6 comments

Perhaps someone with more experience can help me with this. Is there an easy way to use this github-like flavour of markdown to convert a markdown file to a pdf locally?

For example, is there a way to tell pandoc to use the flavour used here by referring it to the css file or something?

hallzy avatar May 21 '16 00:05 hallzy

Dunno if you'd consider this "easy", but how about when you have the markdown preview open in your browser, use your browser's "print to PDF" functionality?

On Fri, May 20, 2016 at 8:04 PM, Steven Hall [email protected] wrote:

Perhaps someone with more experience can help me with this. Is there an easy way to use this github-like flavour of markdown to convert a markdown file to a pdf locally?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/suan/vim-instant-markdown/issues/94

suan avatar May 21 '16 02:05 suan

I would consider it easy normally, but I was planning on doing it for scripting purposes so having a bash command I could use would be best. Plus printing to PDF shows the URL at the top (at least by default), which I would rather not have on the PDF.

I'll think about it a bit to see if I can think of something, but if you or anyone else has any other suggestions that would be appreciated.

For the sake of completeness, if I find a solution for my needs I will come back here to post.

I like the way that the markdown looks when it gets converted here, which is why I wanted this style specifically.

hallzy avatar May 21 '16 11:05 hallzy

@hallzy never found an alternative?

nraw avatar Oct 02 '20 11:10 nraw

@nraw No, never did. But honestly, I forgot about this issue until just now so I haven't really been looking around lately

hallzy avatar Oct 02 '20 17:10 hallzy

You could use smdv in place of instant-markdown-d. smdv uses pandoc AFAIK.

ashwinvis avatar Jan 17 '21 10:01 ashwinvis

But... if you need to simply generate a PDF, use pandoc directly! The vim plugin sends content in the buffer as stdin, an pandoc accepts such stdin as input! Add an option here:

https://github.com/instant-markdown/vim-instant-markdown/blob/fc2ca4b31e4c48990a1c5aadef5f9e7d19c62052/after/ftplugin/markdown/instant-markdown.vim#L120-L124

ashwinvis avatar Jan 17 '21 10:01 ashwinvis