Skip to content

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

Merged
merged 11 commits into from
Jun 18, 2015
Merged

Adding option to disable pdf/epub builds for sphinx based projects. #1344

merged 11 commits into from
Jun 18, 2015

Conversation

gregmuellegger
Copy link
Contributor

As propsed in #1154 we should have the ability to disable pdf and epub builds.

This pull request implements the requested feature.

…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.
@gregmuellegger
Copy link
Contributor Author

I currently have the problem locally that the migration for adding the fields sets sphinx_enable_pdf_build and sphinx_enable_epub_build to False by default, which is stated differently in the migration.

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.

@ericholscher
Copy link
Member

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?

@ericholscher
Copy link
Member

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.
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@gregmuellegger
Copy link
Contributor Author

I don't know if people will want different formats for different versions, or anything like that. Perhaps that's overengineering.

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.

@gregmuellegger
Copy link
Contributor Author

I renamed the fields to be more generic in their name and not include the sphinx_ prefix. Is it ready for merge then?

@ericholscher
Copy link
Member

Yep, looks good to me. I will make sure the flags get set to True on our prod migrations.

ericholscher added a commit that referenced this pull request Jun 18, 2015
Adding option to disable pdf/epub builds for sphinx based projects.
@ericholscher ericholscher merged commit a07cf1d into readthedocs:master Jun 18, 2015
@agjohnson
Copy link
Contributor

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.

@tisdall
Copy link

tisdall commented Jul 10, 2015

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

@stevepiercy
Copy link
Contributor

The link is in the RTD popup menu
RTD popup menu.

@orsenthil
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants