|
11 | 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
12 | 12 | import os |
13 | 13 | import sys |
14 | | -import shutil |
15 | 14 | from sphinx_polyversion import load |
16 | 15 | from sphinx_polyversion.git import GitRef |
17 | 16 |
|
|
134 | 133 |
|
135 | 134 | autosummmary_generate = True |
136 | 135 |
|
137 | | -# sphinx-multiversion: select tags, branches and remotes |
138 | | -smv_tag_whitelist = r"^(v1.1.6)$" |
139 | | -# smv_branch_whitelist = r"^(|doc-autosummary|master|dev)$" |
140 | | -smv_branch_whitelist = r"^(master)$" |
141 | | -smv_remote_whitelist = None |
142 | | - |
143 | | - |
144 | | -# move files around if necessary |
145 | | -def copy_files_handler(app, config): |
146 | | - print("TODO") |
147 | | - return |
148 | | - current_version = config["smv_current_version"] |
149 | | - current_metadata = config["smv_metadata"][current_version] |
150 | | - basedir = current_metadata["basedir"] |
151 | | - sourcedir = current_metadata["sourcedir"] |
152 | | - |
153 | | - print("Current version:", current_version) |
154 | | - print("Basedir:", basedir) |
155 | | - print("Metadata:", current_metadata) |
156 | | - |
157 | | - examples_src = os.path.join(basedir, "examples") |
158 | | - examples_dst = os.path.join(sourcedir, "_examples") |
159 | | - if os.path.exists(examples_src): |
160 | | - shutil.copytree(examples_src, examples_dst, dirs_exist_ok=True) |
161 | | - examples_in_progress = os.path.join(examples_dst, "in_progress") |
162 | | - if os.path.exists(examples_in_progress): |
163 | | - shutil.rmtree(examples_in_progress) |
164 | | - contributing_src = os.path.join(basedir, "CONTRIBUTING.md") |
165 | | - contributing_dst = os.path.join(sourcedir, "contributing.md") |
166 | | - if os.path.exists(contributing_src): |
167 | | - shutil.copy2(contributing_src, contributing_dst) |
168 | | - installation_src = os.path.join(basedir, "INSTALL.rst") |
169 | | - installation_dst = os.path.join(sourcedir, "installation.rst") |
170 | | - if os.path.exists(installation_src): |
171 | | - shutil.copy2(installation_src, installation_dst) |
172 | | - |
173 | 136 |
|
174 | 137 | def cleanup_handler(app, exception): |
175 | 138 | print("Done, what now?") |
176 | 139 |
|
177 | 140 |
|
178 | 141 | def setup(app): |
179 | | - app.connect("config-inited", copy_files_handler) |
180 | 142 | app.connect("build-finished", cleanup_handler) |
181 | 143 |
|
182 | 144 |
|
|
0 commit comments