orzih / mkdocs-with-pdf

Generate a single PDF file from MkDocs repository.
MIT License
332 stars 77 forks source link

Incompatible with awesome-pages #46

Closed fredrikaverpil closed 3 years ago

fredrikaverpil commented 3 years ago

Hi, and thanks for this nice plugin!

I was hoping to be able to auto-detect markdown documents (not specified in the nav) by using mkdocs-awesome-pages and have a PDF generated from such docs, e.g.:

site_name: my docs
theme:
  name: material
plugins:
  - search
  - with-pdf:
      enabled_if_env: ENABLE_PDF_EXPORT
  - awesome-pages
nav:
  - Home: index.md
  - Changelog: changelog.md
  - ...

But this just results in a completely empty PDF.

I have numerous folders with markdown documents inside, which I don't have to add to the nav, as they are added automatically by the - .... Do you have any ideas on if there's any way to fix this or maybe you are aware of another plugin which does something similar?

orzih commented 3 years ago

Hi fredrikaverpil.

mkdocs-awesome-pages generates original MkDocsNavigation object. Please try the following:

plugins:
  - search
  - awesome-pages
  - with-pdf:
      enabled_if_env: ENABLE_PDF_EXPORT

Is it the same result?

fredrikaverpil commented 3 years ago

Aha, your suggestion worked! 👍 🎉

Thanks!