Skip to content

Commit 275a0f2

Browse files
committed
docs: Fix readthedocs build by updating Latex params.
1 parent ee7b8f3 commit 275a0f2

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

docs/conf.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,29 @@
2121
# documentation root, use os.path.abspath to make it absolute, like shown here.
2222
#sys.path.insert(0, os.path.abspath('.'))
2323

24+
# Work out the port to generate the docs for
25+
from collections import OrderedDict
26+
micropy_port = os.getenv('MICROPY_PORT') or 'pyboard'
27+
tags.add('port_' + micropy_port)
28+
ports = OrderedDict((
29+
("unix", "unix"),
30+
("pyboard", "the pyboard"),
31+
("wipy", "the WiPy"),
32+
("esp8266", "esp8266"),
33+
))
34+
35+
# The members of the html_context dict are available inside topindex.html
36+
url_prefix = os.getenv('MICROPY_URL_PREFIX') or '/'
37+
html_context = {
38+
'port':micropy_port,
39+
'port_name':ports[micropy_port],
40+
'all_ports':[(n, url_prefix + p) for p, n in ports.items()],
41+
}
42+
43+
44+
# Specify a custom master document based on the port name
45+
master_doc = micropy_port + '_' + 'index'
46+
2447
# -- General configuration ------------------------------------------------
2548

2649
# If your documentation needs a minimal Sphinx version, state it here.
@@ -213,7 +236,7 @@
213236
# (source start file, target name, title,
214237
# author, documentclass [howto, manual, or own class]).
215238
latex_documents = [
216-
('index', 'MicroPython.tex', 'MicroPython Documentation',
239+
(master_doc, 'MicroPython.tex', 'MicroPython Documentation',
217240
'Damien P. George', 'manual'),
218241
]
219242

@@ -257,7 +280,7 @@
257280
# (source start file, target name, title, author,
258281
# dir menu entry, description, category)
259282
texinfo_documents = [
260-
('index', 'MicroPython', 'MicroPython Documentation',
283+
(master_doc, 'MicroPython', 'MicroPython Documentation',
261284
'Damien P. George', 'MicroPython', 'One line description of project.',
262285
'Miscellaneous'),
263286
]
@@ -278,33 +301,10 @@
278301
# Example configuration for intersphinx: refer to the Python standard library.
279302
intersphinx_mapping = {'http://docs.python.org/': None}
280303

281-
282-
# Work out the port to generate the docs for
283-
from collections import OrderedDict
284-
micropy_port = os.getenv('MICROPY_PORT') or 'pyboard'
285-
tags.add('port_' + micropy_port)
286-
ports = OrderedDict((
287-
("unix", "unix"),
288-
("pyboard", "the pyboard"),
289-
("wipy", "the WiPy"),
290-
("esp8266", "esp8266"),
291-
))
292-
293-
# The members of the html_context dict are available inside topindex.html
294-
url_prefix = os.getenv('MICROPY_URL_PREFIX') or '/'
295-
html_context = {
296-
'port':micropy_port,
297-
'port_name':ports[micropy_port],
298-
'all_ports':[(n, url_prefix + p) for p, n in ports.items()],
299-
}
300-
301304
# Append the other ports' specific folders/files to the exclude pattern
302305
exclude_patterns.extend([port + '*' for port in ports if port != micropy_port])
303306
# Exclude pyb module if the port is the WiPy
304307
if micropy_port == 'wipy':
305308
exclude_patterns.append('library/pyb*')
306309
else: # exclude machine
307310
exclude_patterns.append('library/machine*')
308-
309-
# Specify a custom master document based on the port name
310-
master_doc = micropy_port + '_' + 'index'

0 commit comments

Comments
 (0)