|
105 | 105 | labscript_suite_programs.remove(project)
|
106 | 106 |
|
107 | 107 | # whether to use stable or latest version
|
108 |
| -labscript_suite_doc_version = 'stable' # 'stable' or 'latest' |
| 108 | +labscript_suite_doc_version = os.environ.get('READTHEDOCS_VERSION', 'latest') |
| 109 | +if labscript_suite_doc_version not in ['stable', 'latest']: |
| 110 | + labscript_suite_doc_version = 'stable' |
109 | 111 |
|
110 | 112 | # add intersphinx references for each component
|
111 | 113 | for ls_prog in labscript_suite_programs:
|
|
143 | 145 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
144 | 146 | # a list of builtin themes.
|
145 | 147 | #
|
146 |
| -# html_theme = 'alabaster' |
147 | 148 | html_theme = "sphinx_rtd_theme"
|
148 |
| -html_title = "labscript suite | experiment control and automation" |
| 149 | +html_title = "labscript suite | {project}".format( |
| 150 | + project=project if project != "labscript-suite" else "experiment control and automation" |
| 151 | +) |
149 | 152 | html_short_title = "labscript suite"
|
150 | 153 |
|
151 | 154 | # Add any paths that contain custom static files (such as style sheets) here,
|
@@ -175,3 +178,22 @@ def setup(app):
|
175 | 178 | app.add_config_value('m2r_disable_inline_math', False, 'env')
|
176 | 179 | app.add_directive('mdinclude', MdInclude)
|
177 | 180 | app.add_stylesheet('custom.css')
|
| 181 | + |
| 182 | + with open( |
| 183 | + os.path.join(os.path.dirname(os.path.realpath(__file__)), 'component_docs.rst'), |
| 184 | + 'w', |
| 185 | + ) as f: |
| 186 | + f.write("labscript suite components\n") |
| 187 | + f.write("==========================\n") |
| 188 | + f.write(" \n") |
| 189 | + f.write(".. toctree::\n") |
| 190 | + f.write(" :maxdepth: 2\n") |
| 191 | + f.write(" \n") |
| 192 | + if project != "the labscript suite": |
| 193 | + f.write( |
| 194 | + " labscript suite (metapackage)<{}>\n".format( |
| 195 | + intersphinx_mapping['labscript-suite'][0] |
| 196 | + ) |
| 197 | + ) |
| 198 | + for ls_prog in labscript_suite_programs: |
| 199 | + f.write(" {} <{}>\n".format(ls_prog, intersphinx_mapping[ls_prog][0])) |
0 commit comments