Skip to content

Commit 6cd1440

Browse files
authored
Downloadable artifacts: make PDF and ePub opt-in by default (#10115)
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.
1 parent 96fe669 commit 6cd1440

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Generated by Django 3.2.18 on 2023-03-06 20:08
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("projects", "0097_add_http_header"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="historicalproject",
15+
name="enable_epub_build",
16+
field=models.BooleanField(
17+
default=False,
18+
help_text="Create a EPUB version of your documentation with each build.",
19+
verbose_name="Enable EPUB build",
20+
),
21+
),
22+
migrations.AlterField(
23+
model_name="historicalproject",
24+
name="enable_pdf_build",
25+
field=models.BooleanField(
26+
default=False,
27+
help_text="Create a PDF version of your documentation with each build.",
28+
verbose_name="Enable PDF build",
29+
),
30+
),
31+
migrations.AlterField(
32+
model_name="project",
33+
name="enable_epub_build",
34+
field=models.BooleanField(
35+
default=False,
36+
help_text="Create a EPUB version of your documentation with each build.",
37+
verbose_name="Enable EPUB build",
38+
),
39+
),
40+
migrations.AlterField(
41+
model_name="project",
42+
name="enable_pdf_build",
43+
field=models.BooleanField(
44+
default=False,
45+
help_text="Create a PDF version of your documentation with each build.",
46+
verbose_name="Enable PDF build",
47+
),
48+
),
49+
]

readthedocs/projects/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ class Project(models.Model):
324324
# Sphinx specific build options.
325325
enable_epub_build = models.BooleanField(
326326
_('Enable EPUB build'),
327-
default=True,
327+
default=False,
328328
help_text=_(
329329
'Create a EPUB version of your documentation with each build.',
330330
),
331331
)
332332
enable_pdf_build = models.BooleanField(
333333
_('Enable PDF build'),
334-
default=True,
334+
default=False,
335335
help_text=_(
336336
'Create a PDF version of your documentation with each build.',
337337
),

0 commit comments

Comments
 (0)