mkdocs-with-pdf icon indicating copy to clipboard operation
mkdocs-with-pdf copied to clipboard

pdf ends up in temporary path

Open janvv opened this issue 8 months ago • 1 comments
trafficstars

Hi, when running mkdocs serve (mkdocs build works as expected), the src is created within the project directory but the pdf is created in a temporary directory:

INFO - Output a PDF to "/var/folders/m4/5d02b2xs0l52lbxzbk0t3vym0000gp/T/mkdocs_hrqlmx8p/pdf/document.pdf".

I am using mkdocs 1.6.1 and mkdocs-with-pdf 0.9.3 as well as mkdocstrings-python 1.11.1.

This is the mkdocs.yml:

plugins:
- with-pdf:
    output_path: pdf/document.pdf

Any ideas why that would be?

Thank you!

janvv avatar Mar 06 '25 15:03 janvv

When using ˋmkdocs serveˋ the site is ALWAYS generated in a temporary directory and since the PDF output is placed in the site directory it will also be in the temporary directory.

To retrieve the PDF you have 2 options.

  • Go to 127.0.0.1:8000/pdf/document.pdf on your browser (change the IP+port if you have a different one. Normally mkdocs tell you what IP+port it is served on.)
  • Use ˋmkdocs buildˋ and look into the site directory placed at same level as docs directory. (usually ˋ./site/pdf/document.pdfˋ)

Thiti517 avatar Mar 13 '25 08:03 Thiti517