Skip to content

Commit

Permalink
Downloadable artifacts: make PDF and ePub opt-in by default (#10115)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
humitos authored Mar 7, 2023
1 parent 96fe669 commit 6cd1440
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
49 changes: 49 additions & 0 deletions readthedocs/projects/migrations/0098_pdf_epub_opt_in.py
Original file line number Diff line number Diff line change
@@ -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",
),
),
]
4 changes: 2 additions & 2 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
),
Expand Down

0 comments on commit 6cd1440

Please sign in to comment.