alexandre-perrin / mkdocs-pandoc-plugin

The plugin is based on mkdocs-mk2pdf-plugin and aims to use pandoc as a generic engine to convert to many document format that pandoc suports.
https://github.com/HaoLiuHust/mkdocs-mk2pdf-plugin
MIT License
6 stars 2 forks source link

Combine and Relative Paths #6

Open coreywan opened 2 years ago

coreywan commented 2 years ago

The below reference seems to be where you create the combined md file without taking into account relative path links in the sourced md files. Thus, when the end combined document gets created, the images or relative links will not load. (Specifically I was testing images in md files). I have a multi-level folder structure. I think if you had a fairly basic mkdocs documentation it would not be an issue, or you could strategically place your images to resolve the issue.

I wanted to open this issue to see if this has been thought through.

https://github.com/alexandre-perrin/mkdocs-pandoc-plugin/blob/e6ebfd7711b04d40df876076bfa181769cc9771d/mkdocs_pandoc/renderer.py#L85-L101

coreywan commented 2 years ago

Looking into this a little more, I was able to find a workaround to this by using the --resource-path argument in pandoc, and adding that to the pandoc_extra_args attribute in the pandoc plugin section of mkdocs.yml

dabukalam commented 1 year ago

Ran into the same issue, and this was very useful. Thanks @coreywan.

dabukalam commented 1 year ago

Suggested it's added to README here https://github.com/alexandre-perrin/mkdocs-pandoc-plugin/pull/7