Closed sachin-suresh-rapyuta closed 10 months ago
Where does this command outputs the PDF files? sphinx-build -b simplepdf docs .
Take into account that you have to output your PDF files under $READTHEDOCS_OUTPUT/pdf
. Read the docs about this at https://docs.readthedocs.io/en/latest/build-customization.html
Here is the updated commands:
commands:
- pip install -r docs/requirements.txt
- make clean
- sphinx-build -b simplepdf docs $READTHEDOCS_OUTPUT/simplepdf/
- mkdir -p $READTHEDOCS_OUTPUT/html/
- sphinx-build -b html docs $READTHEDOCS_OUTPUT/html/
The build passes, but there is no option to download the PDF in the flyer menu. I have also created a tag (1.2.4
) for this commit and activated the tag in readthedocs.
Is there any other setting that I need to do to see/test the PDF before merging the code?
You are outputting the result of that command under $READTHEDOCS_OUTPUT/simplepdf/
instead of $READTHEDOCS_OUTPUT/pdf/
sphinx-build -b simplepdf docs $READTHEDOCS_OUTPUT/simplepdf/
Also, note that there should be one and one PDF file under that directory and it should be named $READTHEDOCS_PROJECT.pdf
. So, I would suggest you to adapt your code to be:
sphinx-build -b simplepdf docs /tmp/simplepdf/
mkdir -p $READTHEDOCS/pdf/
mv /tmp/simplepdf/<your generated PDF filename>.pdf $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf
I hope that helps.
Based on the document version, my PDF file name is dynamically generated. So, to adapt this, I have modified my code below as:
commands:
- pip install -r docs/requirements.txt
- mkdir -p /tmp/simplepdf/ # Ensure the /tmp/simplepdf/ folder exists
- rm -f /tmp/simplepdf/*.pdf # Remove any existing PDF files in /tmp/simplepdf/
- mkdir -p $READTHEDOCS/pdf/ # Ensure the destination directory exists
- sphinx-build -b simplepdf docs /tmp/simplepdf/
- mkdir -p $READTHEDOCS/pdf/
- mkdir -p $READTHEDOCS_OUTPUT/html/
- sphinx-build -b html docs $READTHEDOCS_OUTPUT/html/
- mv /tmp/simplepdf/*.pdf $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf
This is the error I see in readthedocs build for the last mv
command:
mv: cannot move '/tmp/simplepdf/Rapyuta PA-AMR User Guide_en_3.1.pdf' to '/home/docs/checkouts/readthedocs.org/user_builds/io-amr-rr-pa-amr/checkouts/448/_readthedocs//pdf/io-amr-rr-pa-amr.pdf': No such file or directory
Here is another try where I gave the paths statically:
commands:
- pip install -r docs/requirements.txt
- mkdir -p /tmp/simplepdf/
- rm -f /tmp/simplepdf/*.pdf
- sphinx-build -b simplepdf docs /tmp/simplepdf/
- mkdir -p /home/docs/checkouts/readthedocs.org/user_builds/io-amr-rr-pa-amr/checkouts/448/_readthedocs/pdf/
- mkdir -p $READTHEDOCS_OUTPUT/html/
- sphinx-build -b html docs $READTHEDOCS_OUTPUT/html/
- mv /tmp/simplepdf/*.pdf /home/docs/checkouts/readthedocs.org/user_builds/io-amr-rr-pa-amr/checkouts/448/_readthedocs/pdf/io-amr-rr-pa-amr.pdf
Here, the build passes, and also I see Downloads>PDF option in the build output
But, PDF is inaccessible in the Downloads directory.
https://io-amr-rr-pa-amr.readthedocs-hosted.com/_/downloads/en/448/pdf/
Hi @sachin-suresh-rapyuta! We have an open conversation in our support system. Please, let's continue talking there. I'm closing this issue since it's related to Read the Docs for Business.
@humitos - Can you please point me to the link of the open conversation that is happening about this?
@sachin-suresh-rapyuta you should have an email in your inbox from support@readthedocs.com where we have been talking about this already.
@sachin-suresh-rapyuta you should have an email in your inbox from support@readthedocs.com where we have been talking about this already.
No, I haven't received any email regarding this conversation.
Please contact us using https://readthedocs.com/support/ if you need help support related to Read the Docs for Business.
I still didn't get an answer to the previous query. Please help me with the email by forwarding it to me. It feels like the ticket was closed without any help or resolution. I just have the emails from support@readthedocs.com for the queries I have raised, but not for this issue @humitos
@sachin-suresh-rapyuta Please, contact us using readthedocs.com/support if you still need help with this issue on Read the Docs for Business. Thanks!
Details
Expected Result
After enabling the "Enable PDF build" checkbox in my Advanced Settings, PDFs are not being generated in the ReadTheDocs flyer menu.
Here is my
.readthedocs.yml
file which includes commands to build PDF from simple-pdf extension. Although the build succeeds executing all the commands, I cant see the PDF in flyer menu.Actual Result
Just like HTML, even PDFs (including custom) should be build on every PR build.