markdown-preview.nvim
markdown-preview.nvim copied to clipboard
Implement a :MarkdownExport option
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).
It is not much easy to implement this feature. Maybe will implement it in the future but not sure. Also PR always welcome.
not much easy to implement this feature
Ah. I wasn't sure about that.
There are not just static document, as katex, mermaid and chart.js are dynamically add by script.
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.
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.
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
What are you guys currently doing to export as pdf ?
I currently use firefox ctrl+p to print it as a pdf file
What theme it is using while rendering preview ??
@Utkarsh-khambra there anything to save it in html ??
@ukantjadia you can use firefox save page as
option to save it as html files.
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?
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