|
21 | 21 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
22 | 22 | sys.path.insert(0, os.path.abspath('.')) |
23 | 23 |
|
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', 'the ESP8266'), |
33 | | -)) |
34 | | - |
35 | | -# The members of the html_context dict are available inside topindex.html |
36 | | -micropy_version = os.getenv('MICROPY_VERSION') or 'latest' |
37 | | -micropy_all_versions = (os.getenv('MICROPY_ALL_VERSIONS') or 'latest').split(',') |
38 | | -url_pattern = '%s/en/%%s/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',) |
39 | | -html_context = { |
40 | | - 'port':micropy_port, |
41 | | - 'port_name':ports[micropy_port], |
42 | | - 'port_version':micropy_version, |
43 | | - 'all_ports':[ |
44 | | - (port_id, url_pattern % (micropy_version, port_id)) |
45 | | - for port_id, port_name in ports.items() |
46 | | - ], |
47 | | - 'all_versions':[ |
48 | | - (ver, url_pattern % (ver, micropy_port)) |
49 | | - for ver in micropy_all_versions |
50 | | - ], |
51 | | - 'downloads':[ |
52 | | - ('PDF', url_pattern % (micropy_version, 'micropython-%s.pdf' % micropy_port)), |
53 | | - ], |
54 | | -} |
55 | | - |
56 | 24 |
|
57 | 25 | # Specify a custom master document based on the port name |
58 | | -master_doc = micropy_port + '_' + 'index' |
| 26 | +master_doc = 'index' |
59 | 27 |
|
60 | 28 | # -- General configuration ------------------------------------------------ |
61 | 29 |
|
62 | 30 | # If your documentation needs a minimal Sphinx version, state it here. |
63 | | -#needs_sphinx = '1.0' |
| 31 | +needs_sphinx = '1.3' |
64 | 32 |
|
65 | 33 | # Add any Sphinx extension module names here, as strings. They can be |
66 | 34 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
|
70 | 38 | 'sphinx.ext.doctest', |
71 | 39 | 'sphinx.ext.intersphinx', |
72 | 40 | 'sphinx.ext.todo', |
73 | | - 'sphinx.ext.coverage', |
74 | | - 'sphinx_selective_exclude.modindex_exclude', |
75 | | - 'sphinx_selective_exclude.eager_only', |
76 | | - 'sphinx_selective_exclude.search_auto_exclude', |
| 41 | + 'sphinx.ext.coverage' |
77 | 42 | ] |
78 | 43 |
|
79 | 44 | # Add any paths that contain templates here, relative to this directory. |
80 | 45 | templates_path = ['templates'] |
81 | 46 |
|
82 | 47 | # The suffix of source filenames. |
83 | | -source_suffix = '.rst' |
| 48 | +source_suffix = ['.rst', '.md', '.c', '.h'] |
| 49 | + |
| 50 | +source_parsers = {'.c': "c2rst.CStrip", '.h': "c2rst.CStrip"} |
84 | 51 |
|
85 | 52 | # The encoding of source files. |
86 | 53 | #source_encoding = 'utf-8-sig' |
|
89 | 56 | #master_doc = 'index' |
90 | 57 |
|
91 | 58 | # General information about the project. |
92 | | -project = 'MicroPython' |
93 | | -copyright = '2014-2016, Damien P. George and contributors' |
| 59 | +project = 'Adafruit\'s MicroPython' |
| 60 | +copyright = '2014-2016, Damien P. George, Scott Shawcroft, Tony DiCola and other contributors' |
94 | 61 |
|
95 | 62 | # The version info for the project you're documenting, acts as replacement for |
96 | 63 | # |version| and |release|, also used in various other places throughout the |
|
113 | 80 |
|
114 | 81 | # List of patterns, relative to source directory, that match files and |
115 | 82 | # directories to ignore when looking for source files. |
116 | | -exclude_patterns = ['build'] |
| 83 | +exclude_patterns = ["*/build-*", "atmel-samd/asf", "atmel-samd/**.c", "atmel-samd/**.h", "bare-arm", "cc3200", "cc3200/FreeRTOS", "cc3200/hal", "drivers", "esp8266", "examples", "extmod", "lib", "minimal", "mpy-cross", "pic16bit", "py", "qemu-arm", "stmhal", "stmhal/hal", "stmhal/cmsis", "stmhal/usbdev", "stmhal/usbhost", "teensy", "tests", "tools", "unix", "windows", "zephyr"] |
117 | 84 |
|
118 | 85 | # The reST default role (used for this markup: `text`) to use for all |
119 | 86 | # documents. |
|
183 | 150 | # Add any paths that contain custom static files (such as style sheets) here, |
184 | 151 | # relative to this directory. They are copied after the builtin static files, |
185 | 152 | # so a file named "default.css" will overwrite the builtin "default.css". |
186 | | -html_static_path = ['static'] |
| 153 | +html_static_path = ['docs/static'] |
187 | 154 |
|
188 | 155 | # Add any extra paths that contain custom files (such as robots.txt or |
189 | 156 | # .htaccess) here, relative to this directory. These files are copied |
|
203 | 170 |
|
204 | 171 | # Additional templates that should be rendered to pages, maps page names to |
205 | 172 | # template names. |
206 | | -html_additional_pages = {"index": "topindex.html"} |
| 173 | +#html_additional_pages = {"index": "topindex.html"} |
207 | 174 |
|
208 | 175 | # If false, no module index is generated. |
209 | 176 | #html_domain_indices = True |
|
316 | 283 |
|
317 | 284 | # Example configuration for intersphinx: refer to the Python standard library. |
318 | 285 | intersphinx_mapping = {'http://docs.python.org/': None} |
319 | | - |
320 | | -# Append the other ports' specific folders/files to the exclude pattern |
321 | | -exclude_patterns.extend([port + '*' for port in ports if port != micropy_port]) |
322 | | - |
323 | | -modules_port_specific = { |
324 | | - 'pyboard': ['pyb'], |
325 | | - 'wipy': ['wipy'], |
326 | | - 'esp8266': ['esp'], |
327 | | -} |
328 | | - |
329 | | -modindex_exclude = [] |
330 | | - |
331 | | -for p, l in modules_port_specific.items(): |
332 | | - if p != micropy_port: |
333 | | - modindex_exclude += l |
334 | | - |
335 | | -# Exclude extra modules per port |
336 | | -modindex_exclude += { |
337 | | - 'esp8266': ['cmath', 'select'], |
338 | | - 'wipy': ['cmath'], |
339 | | -}.get(micropy_port, []) |
0 commit comments