|
21 | 21 | copyright = "2022, ENCCS and individual contributors."
|
22 | 22 | author = "ENCCS and individual contributors."
|
23 | 23 | github_user = "ENCCS"
|
24 |
| -github_repo_name = "HPDA-Python" |
| 24 | +github_repo_name = "" # auto-detected from dirname if blank |
25 | 25 | github_version = "main"
|
26 | 26 | conf_py_path = "/content/" # with leading and trailing slash
|
27 | 27 |
|
|
44 | 44 | # jupyter_execute_notebooks = "off"
|
45 | 45 | # jupyter_execute_notebooks = "auto" # *only* execute if at least one output is missing.
|
46 | 46 | # jupyter_execute_notebooks = "force"
|
47 |
| -jupyter_execute_notebooks = "cache" |
| 47 | +nb_execution_mode = "cache" |
| 48 | + |
| 49 | +# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html |
| 50 | +myst_enable_extensions = [ |
| 51 | + "colon_fence", |
| 52 | +] |
| 53 | + |
| 54 | +# Settings for sphinx-copybutton |
| 55 | +copybutton_exclude = ".linenos, .gp" |
48 | 56 |
|
49 | 57 | # Add any paths that contain templates here, relative to this directory.
|
50 | 58 | # templates_path = ['_templates']
|
|
73 | 81 | # Add any paths that contain custom static files (such as style sheets) here,
|
74 | 82 | # relative to this directory. They are copied after the builtin static files,
|
75 | 83 | # so a file named "default.css" will overwrite the builtin "default.css".
|
76 |
| -html_static_path = ['_static'] |
| 84 | +html_static_path = ["_static"] |
77 | 85 | html_css_files = ["overrides.css"]
|
78 | 86 |
|
79 | 87 | # HTML context:
|
|
84 | 92 | "github_user": github_user,
|
85 | 93 | # Auto-detect directory name. This can break, but
|
86 | 94 | # useful as a default.
|
87 |
| - "github_repo": github_repo_name or basename(dirname(realpath(__file__))), |
| 95 | + "github_repo": github_repo_name or basename(dirname(dirname(realpath(__file__)))), |
88 | 96 | "github_version": github_version,
|
89 | 97 | "conf_py_path": conf_py_path,
|
90 | 98 | }
|
@@ -120,17 +128,27 @@ class TypealongDirective(_BaseCRDirective):
|
120 | 128 | extra_classes = ["toggle-shown", "dropdown"]
|
121 | 129 |
|
122 | 130 |
|
123 |
| -DIRECTIVES = [SignatureDirective, ParametersDirective, TypealongDirective] |
| 131 | +DIRECTIVES: list[type[_BaseCRDirective]] = [ |
| 132 | + SignatureDirective, |
| 133 | + ParametersDirective, |
| 134 | + TypealongDirective, |
| 135 | +] |
124 | 136 |
|
125 | 137 |
|
126 | 138 | def setup(app):
|
127 | 139 | for obj in DIRECTIVES:
|
128 |
| - app.add_directive(obj.get_cssname(), obj) |
| 140 | + app.add_directive(obj.cssname(), obj) |
| 141 | + |
129 | 142 |
|
130 | 143 | import os
|
131 |
| -if os.environ.get('GITHUB_REF', '') == 'refs/heads/main': |
| 144 | + |
| 145 | +if os.environ.get("GITHUB_REF", "") == "refs/heads/main": |
132 | 146 | html_js_files = [
|
133 |
| - ('https://plausible.io/js/script.js', {"data-domain": "enccs.github.io/hpda-python", "defer": "\ |
134 |
| -defer"}), |
| 147 | + ( |
| 148 | + "https://plausible.io/js/script.js", |
| 149 | + { |
| 150 | + "data-domain": "enccs.github.io/hpda-python", |
| 151 | + "defer": "defer", |
| 152 | + }, |
| 153 | + ), |
135 | 154 | ]
|
136 |
| - |
|
0 commit comments