From 5bd912355e25fee6c3d3863069eed2f95900ba7b Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 6 Mar 2023 21:10:34 +0100 Subject: [PATCH] Downloadable artifacts: make PDF and ePub opt-in by default Newly created projects will have PDF and ePub disabled by default. This matches the default value of `formats` in the YAML file v2. Building PDF and ePub is not a trivial task and many projects start failing because of this or, if succeeding, they are just building pretty low quality PDF and ePub files --which is a waste of resources. This commit disables this by default for new projects, keeping the old projects working as they are currently. --- .../migrations/0098_pdf_epub_opt_in.py | 49 +++++++++++++++++++ readthedocs/projects/models.py | 4 +- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 readthedocs/projects/migrations/0098_pdf_epub_opt_in.py diff --git a/readthedocs/projects/migrations/0098_pdf_epub_opt_in.py b/readthedocs/projects/migrations/0098_pdf_epub_opt_in.py new file mode 100644 index 00000000000..d4951e2d1c4 --- /dev/null +++ b/readthedocs/projects/migrations/0098_pdf_epub_opt_in.py @@ -0,0 +1,49 @@ +# Generated by Django 3.2.18 on 2023-03-06 20:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("projects", "0097_add_http_header"), + ] + + operations = [ + migrations.AlterField( + model_name="historicalproject", + name="enable_epub_build", + field=models.BooleanField( + default=False, + help_text="Create a EPUB version of your documentation with each build.", + verbose_name="Enable EPUB build", + ), + ), + migrations.AlterField( + model_name="historicalproject", + name="enable_pdf_build", + field=models.BooleanField( + default=False, + help_text="Create a PDF version of your documentation with each build.", + verbose_name="Enable PDF build", + ), + ), + migrations.AlterField( + model_name="project", + name="enable_epub_build", + field=models.BooleanField( + default=False, + help_text="Create a EPUB version of your documentation with each build.", + verbose_name="Enable EPUB build", + ), + ), + migrations.AlterField( + model_name="project", + name="enable_pdf_build", + field=models.BooleanField( + default=False, + help_text="Create a PDF version of your documentation with each build.", + verbose_name="Enable PDF build", + ), + ), + ] diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 40c52099648..bf502c1fce5 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -324,14 +324,14 @@ class Project(models.Model): # Sphinx specific build options. enable_epub_build = models.BooleanField( _('Enable EPUB build'), - default=True, + default=False, help_text=_( 'Create a EPUB version of your documentation with each build.', ), ) enable_pdf_build = models.BooleanField( _('Enable PDF build'), - default=True, + default=False, help_text=_( 'Create a PDF version of your documentation with each build.', ),