iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.73k stars 278 forks source link

Implement a :MarkdownExport option #22

Open ghost opened 5 years ago

ghost commented 5 years ago

It would be really nice if there was a :MarkdownSave command that would save the HTML file, css/js in the current directory. Ie File > Save Page As... from the web browser.

It would be good if such a command made sure the paths were relative so that the HTML page could be opened and they would be sourced correctly.

It would be good to be able to read the files from a file:/// location.

Might also be worth having an option there to not optimize output (ie remove line feeds from source).

iamcco commented 5 years ago

It is not much easy to implement this feature. Maybe will implement it in the future but not sure. Also PR always welcome.

ghost commented 5 years ago

not much easy to implement this feature

Ah. I wasn't sure about that.

iamcco commented 5 years ago

There are not just static document, as katex, mermaid and chart.js are dynamically add by script.

jarredbarber commented 5 years ago

Is there a way to do a PDF rendering? I'm currently looking for a nice workflow to write up notes and then disseminate them to others that are less enlightened in the way of vim.

ghost commented 4 years ago

Just a suggestion, but I feel it might be useful to allow the rendered HTML to be piped/passed to a separate script or application. I think if we could pass the HTML to, say, wkhtmltopdf (or a bash script wrapping it), then it might work... Would give some flexibility at least.

mxdevmanuel commented 4 years ago

I have tried to use it with wkhtmltopdf directly with the local url, because of the scripts that are being served, and I always get a pdf with the legend "An unexpected error has ocurred" and nothing else

motorto commented 3 years ago

What are you guys currently doing to export as pdf ?

Utkarsh-khambra commented 3 years ago

I currently use firefox ctrl+p to print it as a pdf file

ukantjadia commented 2 years ago

What theme it is using while rendering preview ??

ukantjadia commented 2 years ago

@Utkarsh-khambra there anything to save it in html ??

Utkarsh-khambra commented 2 years ago

@ukantjadia you can use firefox save page as option to save it as html files.

dostoievsky commented 1 year ago

For doing that, what would be need? In a :MarkdownExport command, we would like need to create a pipeline of functions that would split the markdown... As an example: I got some text, then some math, then some dot so I would need find math, dots sections, render it separately with some script, then crop it as images or something like in the text? Can we maybe transform that enhancement into a list of needed operations, scripts that we could develop separately?

djheidihoe commented 1 year ago

You could pipe plain markdown files through pandoc, but it will look different than what you see in the browser and will not work with mermaid and all the other features.

Seems like a low value workaround