diff options
author | Damien George <damien.p.george@gmail.com> | 2018-09-27 17:27:57 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-10-01 13:53:53 +1000 |
commit | b3e013f60ec0feb5b64bcadb45b154d093731c97 (patch) | |
tree | cb0f4b4368d024b2cfa6044027e871304d3bdd82 /docs/conf.py | |
parent | 5cc9517fc5d2524aa53dbf40854ac33d27f238ca (diff) | |
download | micropython-b3e013f60ec0feb5b64bcadb45b154d093731c97.tar.gz micropython-b3e013f60ec0feb5b64bcadb45b154d093731c97.zip |
docs: Unify all the ports into one set of documentation.
With this commit there is now only one entry point into the whole
documentation, which describes the general MicroPython language, and then
from there there are links to information about specific platforms/ports.
This commit doesn't change content (almost, it does fix a few internal
links), it just reorganises things.
Diffstat (limited to 'docs/conf.py')
-rwxr-xr-x | docs/conf.py | 52 |
1 files changed, 5 insertions, 47 deletions
diff --git a/docs/conf.py b/docs/conf.py index bb8faea88e..e85a689030 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,42 +21,21 @@ import os # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('.')) -# Work out the port to generate the docs for -from collections import OrderedDict -micropy_port = os.getenv('MICROPY_PORT') or 'pyboard' -tags.add('port_' + micropy_port) -ports = OrderedDict(( - ('unix', 'unix'), - ('pyboard', 'the pyboard'), - ('wipy', 'the WiPy'), - ('esp8266', 'the ESP8266'), -)) - # The members of the html_context dict are available inside topindex.html micropy_version = os.getenv('MICROPY_VERSION') or 'latest' micropy_all_versions = (os.getenv('MICROPY_ALL_VERSIONS') or 'latest').split(',') -url_pattern = '%s/en/%%s/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',) +url_pattern = '%s/en/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',) html_context = { - 'port':micropy_port, - 'port_name':ports[micropy_port], - 'port_version':micropy_version, - 'all_ports':[ - (port_id, url_pattern % (micropy_version, port_id)) - for port_id, port_name in ports.items() - ], + 'cur_version':micropy_version, 'all_versions':[ - (ver, url_pattern % (ver, micropy_port)) - for ver in micropy_all_versions + (ver, url_pattern % ver) for ver in micropy_all_versions ], 'downloads':[ - ('PDF', url_pattern % (micropy_version, 'micropython-%s.pdf' % micropy_port)), + ('PDF', url_pattern % micropy_version + '/micropython-docs.pdf'), ], } -# Specify a custom master document based on the port name -master_doc = micropy_port + '_' + 'index' - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -86,7 +65,7 @@ source_suffix = '.rst' #source_encoding = 'utf-8-sig' # The master toctree document. -#master_doc = 'index' +master_doc = 'index' # General information about the project. project = 'MicroPython' @@ -323,24 +302,3 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'python': ('http://docs.python.org/3.5', None)} - -# Append the other ports' specific folders/files to the exclude pattern -exclude_patterns.extend([port + '*' for port in ports if port != micropy_port]) - -modules_port_specific = { - 'pyboard': ['pyb'], - 'wipy': ['wipy'], - 'esp8266': ['esp'], -} - -modindex_exclude = [] - -for p, l in modules_port_specific.items(): - if p != micropy_port: - modindex_exclude += l - -# Exclude extra modules per port -modindex_exclude += { - 'esp8266': ['cmath', 'select'], - 'wipy': ['cmath'], -}.get(micropy_port, []) |