You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we support one and only one file per offline format. We have an in-progress work at #10438, but the work required there is not trivial and it may be off from our roadmap/prioritization for some time now. I think that feature is important for big projects like CPython documentation and we should work on that as soon as possible, tho.
In the meantime, we could make the build process a little simpler by allowing any filename for the PDF saved under $READTHEDOCS_OUTPUT/pdf/ since right now it requires to exactly be $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf --which is not documented anywhere 😄
I'd say that, as long as there is one and only one PDF file inside the output directory, we shouldn't care about the filename and rename it internally (probably at upload time) to be what we need it to be.
Currently, we _require_ the user to save the PDF or ePUB file with a pretty
specific filename: `{project.slug}-{version.slug}.{extension}`. This has caused
a lot of confusions to users.
Since we only support 1 file for PDF/ePUB for now, we can rename this file to
the valid filename automatically.
Closes#10873
* Build: rename PDF/ePUB filename to valid one automatically
Currently, we _require_ the user to save the PDF or ePUB file with a pretty
specific filename: `{project.slug}-{version.slug}.{extension}`. This has caused
a lot of confusions to users.
Since we only support 1 file for PDF/ePUB for now, we can rename this file to
the valid filename automatically.
Closes#10873
* Rename the offline format file properly
* Initial attempt to write a test case
* Revert "Initial attempt to write a test case"
This reverts commit 76ab170.
* Test case and filename fix
* Remove the conditional that's not needed
* Assert the path is inside OUTPUT dir before calling `shutil.move`
* Revert "Assert the path is inside OUTPUT dir before calling `shutil.move`"
This reverts commit e9a0f08.
* Assert the path is inside the DOCROOT before calling `shutil.move`
* Update readthedocs/projects/tasks/builds.py
Co-authored-by: Santos Gallegos <[email protected]>
---------
Co-authored-by: Santos Gallegos <[email protected]>
Projects using
build.commands
to build their documentation can make usage of the$READTHEDOCS_OUTPUT
directory to expose offline formats like PDF, ePUB, HTMLZip as documented in https://docs.readthedocs.io/en/latest/build-customization.htmlCurrently, we support one and only one file per offline format. We have an in-progress work at #10438, but the work required there is not trivial and it may be off from our roadmap/prioritization for some time now. I think that feature is important for big projects like CPython documentation and we should work on that as soon as possible, tho.
In the meantime, we could make the build process a little simpler by allowing any filename for the PDF saved under
$READTHEDOCS_OUTPUT/pdf/
since right now it requires to exactly be$READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf
--which is not documented anywhere 😄I'd say that, as long as there is one and only one PDF file inside the output directory, we shouldn't care about the filename and rename it internally (probably at upload time) to be what we need it to be.
Code references:
readthedocs.org/readthedocs/projects/tasks/builds.py
Lines 605 to 623 in 90f1791
readthedocs.org/readthedocs/projects/tasks/builds.py
Lines 904 to 935 in 90f1791
The text was updated successfully, but these errors were encountered: