Open ghost opened 8 years ago
Provided pandoc can handle images with height/width, this looks like a good idea, yes. Can you turn this into a pull request (I presume you've got the modified code anyway) and provide a test case so I can try it out?
I'm a bit busy right now (which is why I haven't even gotten around to properly testing and merging the fix for https://github.com/jgrassler/mkdocs-pandoc/issues/9 ) but I'll try to get around to it soonish and cut a new release with the patches from both #9 and #10.
This would be a wonderful addition and very useful to my small site http://cudmore.github.io/treadmill
Problem: MkDocs only shows resized pictures if they are written in html tags. The pandoc conversion from markdown to pdf will simply cut out all html inliners since the extension raw_html would be ignored. The conversion from markdown to html and finally to pdf will drop any alignment information in tables which would be available in conversion from markdown to pdf.
Idea: The conversion triggered by mkdocs2pandoc > docs.pd could already check for html tags and change them to markdown inliners. /mkdocs_pandoc/filters/ contains filters like the images.py. A suggestion for a new filter would be html_images.py.
Suggested solution: In /mkdocs_pandoc/pandoc_converter.py add
and below def init(self, **kwargs):
Above lines_tmp = f_headlevel.run(lines_tmp) add
html_images.py: