|
79 | 79 | 'matplotlib': ('https://matplotlib.org/', None), |
80 | 80 | 'h5py': ('http://docs.h5py.org/en/stable/', None), |
81 | 81 | 'pydaqmx': ('https://pythonhosted.org/PyDAQmx/', None), |
82 | | - # from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py |
83 | | - # under MIT License |
84 | 82 | 'qt': ( |
85 | 83 | '', |
86 | 84 | 'pyqt5-modified-objects.inv', |
87 | | - ) |
| 85 | + ) # from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py |
| 86 | + # under MIT License |
88 | 87 | # TODO |
89 | 88 | # desktop-app |
90 | 89 | # spinapi/pynivision/etc |
|
105 | 104 | labscript_suite_programs.remove(project) |
106 | 105 |
|
107 | 106 | # whether to use stable or latest version |
108 | | -labscript_suite_doc_version = 'stable' # 'stable' or 'latest' |
| 107 | +labscript_suite_doc_version = os.environ.get('READTHEDOCS_VERSION', 'latest') |
| 108 | +if labscript_suite_doc_version not in ['stable', 'latest']: |
| 109 | + labscript_suite_doc_version = 'stable' |
109 | 110 |
|
110 | 111 | # add intersphinx references for each component |
111 | 112 | for ls_prog in labscript_suite_programs: |
|
137 | 138 | todo_include_todos = False |
138 | 139 | else: |
139 | 140 | todo_include_todos = True |
| 141 | + |
140 | 142 | # -- Options for HTML output ------------------------------------------------- |
141 | 143 |
|
142 | 144 | # The theme to use for HTML and HTML Help pages. See the documentation for |
@@ -177,3 +179,22 @@ def setup(app): |
177 | 179 | app.add_config_value('m2r_disable_inline_math', False, 'env') |
178 | 180 | app.add_directive('mdinclude', MdInclude) |
179 | 181 | app.add_stylesheet('custom.css') |
| 182 | + |
| 183 | + with open( |
| 184 | + os.path.join(os.path.dirname(os.path.realpath(__file__)), 'component_docs.rst'), |
| 185 | + 'w', |
| 186 | + ) as f: |
| 187 | + f.write("labscript suite components\n") |
| 188 | + f.write("==========================\n") |
| 189 | + f.write(" \n") |
| 190 | + f.write(".. toctree::\n") |
| 191 | + f.write(" :maxdepth: 2\n") |
| 192 | + f.write(" \n") |
| 193 | + if project != "the labscript suite": |
| 194 | + f.write( |
| 195 | + " labscript suite (metapackage)<{}>\n".format( |
| 196 | + intersphinx_mapping['labscript-suite'][0] |
| 197 | + ) |
| 198 | + ) |
| 199 | + for ls_prog in labscript_suite_programs: |
| 200 | + f.write(" {} <{}>\n".format(ls_prog, intersphinx_mapping[ls_prog][0])) |
0 commit comments