-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Adding option to disable pdf/epub builds for sphinx based projects. #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…em during build to determine whether epub or pdf shall be built.
… a particular builder. Also removing Project.doc_builder method because it's no longer used.
I currently have the problem locally that the migration for adding the fields sets It might be a problem with my setup using sqlite locally, but we should test this further before deploying since that would change the behaviour of all existing projects. |
…roject.sphinx_enable_pdf_build.
…pdate_repos management commands. It is now determined by the project settings whether a PDF build is triggered or not.
…en't supported anymore.
…/dash format builds.
… now come from the Project.sphinx_enable_*_build flags.
Hmm, yea those should definitely default to True. Perhaps we could set the model to default=True for now, generate the migration, then change it? |
This looks great. 👍 -- Glad to see some more test coverage here. My only thought is that it might be good to expand this into it's own "build formats" concept that lives outside of the project. I don't know if people will want different formats for different versions, or anything like that. Perhaps that's overengineering. I do know that if we start adding more formats, having them be checklists on the Project Admin will feel weird. This is a great first step, and is an easy way to get us closer to where we need to be, so big +1. |
@@ -114,6 +113,16 @@ class Project(models.Model): | |||
help_text=_("Google Analytics Tracking ID (ex. UA-22345342-1). " | |||
"This may slow down your page loads.")) | |||
|
|||
# Sphinx specific build options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably leave the "sphinx" naming off these. They should be global settings for the project, and respected where they need to be, but having "sphinx" in the name feels weird.
For example, if we ever added PDF support to other builder backends, we would use this to respect that setting, not add a 'mkdocs_enable_epub_build' option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to keep this PR as is, and address the naming stuff in a v2 where we move it into a completely separate model, or into a YAML file, as well, if it's a lot of work to rename all this stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's really straightforward to rename the field again. It should be a simple search&replace. I will do so on Thursday.
Yes I think that's a little complex for now especially for the interface in the admin. That will be a nobrainer once a readthedocs.yml file is in place. That file will always come from the version that the build is triggered from, which therefore allows to enable/disable pdf/epub builds per version. |
I renamed the fields to be more generic in their name and not include the |
Yep, looks good to me. I will make sure the flags get set to True on our prod migrations. |
Adding option to disable pdf/epub builds for sphinx based projects.
We should probably have a fix for this migration, or a data migration that addresses this instead of hacking it in prod. I'll try for a solution today before I deploy. |
It seems like after shutting off PDF generation there still exists a link to the previously generated PDF and the previously generated PDF is still available. Here's an example with PDF creation unchecked: http://colanderalchemy.readthedocs.org |
Thank you! |
As propsed in #1154 we should have the ability to disable pdf and epub builds.
This pull request implements the requested feature.