Skip to content

Commit 7d621a3

Browse files
committed
Sync with sphinx-lesson-template
1 parent 9998c47 commit 7d621a3

File tree

3 files changed

+37
-20
lines changed

3 files changed

+37
-20
lines changed

LICENSE.code

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022, HPDA-Python and individual contributors.
3+
Copyright (c) 2024, ENCCS and individual contributors.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

content/_static/overrides.css

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
background: #DDDDDD;
2727
}
2828
.rst-content .instructor-note > .admonition-title {
29-
background: #BBBBBB;
29+
background: #595959;
3030
}
3131
.rst-content .instructor-note > .admonition-title::before {
3232
content: "";
@@ -37,31 +37,31 @@
3737
background: #EEEEBB;
3838
}
3939
.rst-content .callout > .admonition-title {
40-
background: #BBCC33;
40+
background: #595959;
4141
}
4242

4343
/* questions */
4444
.rst-content .questions {
4545
background: rgba(253, 219, 199, 0.3);
4646
}
4747
.rst-content .questions > .admonition-title {
48-
background: rgba(204, 51, 17, 0.5);
48+
background: #993360;
4949
}
5050

5151
/* discussion */
5252
.rst-content .discussion {
53-
background: rgba(231, 212, 232 0.3);
53+
background: rgba(231, 212, 232, 0.3);
5454
}
5555
.rst-content .discussion > .admonition-title {
56-
background: rgba(194, 165, 207, 0.5);
56+
background: #714884;
5757
}
5858

5959
/* signature */
6060
.rst-content .signature {
6161
background: rgba(217, 240, 211, 0.3);
6262
}
6363
.rst-content .signature > .admonition-title {
64-
background: rgba(172, 211, 158, 0.5);
64+
background: #21634b;
6565
}
6666
.rst-content .signature > .admonition-title::before {
6767
content: "\01F527";
@@ -72,7 +72,7 @@
7272
background: rgba(217, 240, 211, 0.0);
7373
}
7474
.rst-content .parameters > .admonition-title {
75-
background: rgba(172, 211, 158, 0.5);
75+
background: #21634b;
7676
}
7777
.rst-content .parameters > .admonition-title::before {
7878
content: "\01F4BB";
@@ -83,7 +83,7 @@
8383
background: rgba(221, 221, 221, 0.3);
8484
}
8585
.rst-content .typealong > .admonition-title {
86-
background: rgba(187, 187, 187, 1.0);
86+
background: rgba(89, 89, 89, 1.0);
8787
}
8888
.rst-content .typealong > .admonition-title::before {
8989
content: "\02328";

content/conf.py

+28-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
copyright = "2022, ENCCS and individual contributors."
2222
author = "ENCCS and individual contributors."
2323
github_user = "ENCCS"
24-
github_repo_name = "HPDA-Python"
24+
github_repo_name = "" # auto-detected from dirname if blank
2525
github_version = "main"
2626
conf_py_path = "/content/" # with leading and trailing slash
2727

@@ -44,7 +44,15 @@
4444
# jupyter_execute_notebooks = "off"
4545
# jupyter_execute_notebooks = "auto" # *only* execute if at least one output is missing.
4646
# 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"
4856

4957
# Add any paths that contain templates here, relative to this directory.
5058
# templates_path = ['_templates']
@@ -73,7 +81,7 @@
7381
# Add any paths that contain custom static files (such as style sheets) here,
7482
# relative to this directory. They are copied after the builtin static files,
7583
# so a file named "default.css" will overwrite the builtin "default.css".
76-
html_static_path = ['_static']
84+
html_static_path = ["_static"]
7785
html_css_files = ["overrides.css"]
7886

7987
# HTML context:
@@ -84,7 +92,7 @@
8492
"github_user": github_user,
8593
# Auto-detect directory name. This can break, but
8694
# 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__)))),
8896
"github_version": github_version,
8997
"conf_py_path": conf_py_path,
9098
}
@@ -120,17 +128,27 @@ class TypealongDirective(_BaseCRDirective):
120128
extra_classes = ["toggle-shown", "dropdown"]
121129

122130

123-
DIRECTIVES = [SignatureDirective, ParametersDirective, TypealongDirective]
131+
DIRECTIVES: list[type[_BaseCRDirective]] = [
132+
SignatureDirective,
133+
ParametersDirective,
134+
TypealongDirective,
135+
]
124136

125137

126138
def setup(app):
127139
for obj in DIRECTIVES:
128-
app.add_directive(obj.get_cssname(), obj)
140+
app.add_directive(obj.cssname(), obj)
141+
129142

130143
import os
131-
if os.environ.get('GITHUB_REF', '') == 'refs/heads/main':
144+
145+
if os.environ.get("GITHUB_REF", "") == "refs/heads/main":
132146
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+
),
135154
]
136-

0 commit comments

Comments
 (0)