Skip to content

Commit 975cae3

Browse files
committed
Allow /ja/ to not build PDF.
See #142.
1 parent 5ac59ae commit 975cae3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

build_docs.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from argparse import ArgumentParser
2323
from contextlib import suppress
24+
from dataclasses import dataclass
2425
import filecmp
2526
from itertools import product
2627
import json
@@ -191,9 +192,16 @@ def __gt__(self, other):
191192
return self.as_tuple() > other.as_tuple()
192193

193194

194-
Language = namedtuple(
195-
"Language", ["tag", "iso639_tag", "name", "in_prod", "sphinxopts"]
196-
)
195+
196+
@dataclass(frozen=True)
197+
class Language:
198+
tag: str
199+
iso639_tag: str
200+
name: str
201+
in_prod: bool
202+
sphinxopts: tuple
203+
html_only: bool = False
204+
197205

198206
# EOL and security-fixes are not automatically built, no need to remove them
199207
# from the list, this way we can still rebuild them manually as needed.
@@ -249,7 +257,7 @@ def __gt__(self, other):
249257
Language("fr", "fr", "French", True, XELATEX_WITH_FONTSPEC),
250258
Language("id", "id", "Indonesian", False, XELATEX_DEFAULT),
251259
Language("it", "it", "Italian", False, XELATEX_DEFAULT),
252-
Language("ja", "ja", "Japanese", True, PLATEX_DEFAULT),
260+
Language("ja", "ja", "Japanese", True, PLATEX_DEFAULT, html_only=True), # See https://github.com/python/python-docs-ja/issues/35
253261
Language("ko", "ko", "Korean", True, XELATEX_FOR_KOREAN),
254262
Language("pl", "pl", "Polish", False, XELATEX_DEFAULT),
255263
Language("pt-br", "pt_BR", "Brazilian Portuguese", True, XELATEX_DEFAULT),
@@ -710,7 +718,7 @@ def build(self):
710718
if self.version.status in ("in development", "pre-release")
711719
else "stable"
712720
)
713-
+ ("-html" if self.quick else "")
721+
+ ("-html" if self.quick or self.language.html_only else "")
714722
)
715723
logging.info("Running make %s", maketarget)
716724
python = self.venv / "bin" / "python"

0 commit comments

Comments
 (0)