Skip to content

Commit 286a7ee

Browse files
DOC remove top bar of juypterlite in try examples (#178)
1 parent b621f9c commit 286a7ee

File tree

7 files changed

+2286
-2159
lines changed

7 files changed

+2286
-2159
lines changed

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969

7070
# -- Options for HTML output -------------------------------------------------
7171
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
72-
# Third-party theme: pip install furo
73-
html_theme = "furo"
72+
html_theme = "pydata_sphinx_theme"
7473
html_static_path = ["images", "css"]
74+
html_css_files = ["fastcan.css"]
7575

7676

7777
# intersphinx configuration

doc/css/fastcan.css

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
1+
/* Buttons for JupyterLite-enabled interactive examples */
2+
13
.try_examples_button {
2-
color: white;
3-
background-color: #0054a6;
4-
border: none;
5-
padding: 5px 10px;
6-
border-radius: 10px;
7-
margin-bottom: 5px;
8-
box-shadow: 0 2px 5px rgba(108,108,108,0.2);
4+
color: white;
5+
background-color: var(--pst-color-info);
6+
border: none;
7+
padding: 5px 10px;
8+
border-radius: 0.25rem;
9+
margin-top: 3px; /* better alignment under admonitions */
10+
margin-bottom: 5px !important; /* fix uneven button sizes under admonitions */
11+
box-shadow: 0 2px 5px rgba(108, 108, 108, 0.2);
12+
font-weight: bold;
13+
font-size: small;
14+
}
15+
16+
/* Use more accessible colours for text in dark mode */
17+
[data-theme=dark] .try_examples_button {
18+
color: black;
919
}
1020

1121
.try_examples_button:hover {
12-
background-color: #0066cc;
13-
transform: scale(1.02);
14-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
15-
cursor: pointer;
22+
transform: scale(1.02);
23+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
24+
cursor: pointer;
1625
}
1726

1827
.try_examples_button_container {
19-
display: flex;
20-
justify-content: flex-end;
28+
display: flex;
29+
justify-content: flex-start;
30+
gap: 10px;
31+
margin-bottom: 20px;
32+
}
33+
34+
/* Better gaps for examples buttons under admonitions */
35+
36+
.try_examples_outer_iframe {
37+
margin-top: 0.4em;
2138
}

doc/index.rst

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+
2-
| .. figure:: images/tongji-logo.jpg | .. figure:: images/sheffield-logo.svg | .. figure:: images/shmc.png | .. figure:: images/DRG-logo.png |
3-
| :target: https://www.tongji.edu.cn/ | :target: https://www.sheffield.ac.uk/ | :target: https://shmc.tongji.edu.cn/ | :target: https://drg.ac.uk/ |
4-
| :figwidth: 70pt | :figwidth: 70pt | :figwidth: 70pt | :figwidth: 70pt |
5-
| :alt: Tongji | :alt: Sheffield | :alt: SHMC | :alt: DRG |
6-
| | | | |
7-
| | | | |
8-
+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+
1+
.. |tongji| image:: images/tongji-logo.jpg
2+
:target: https://www.tongji.edu.cn/
3+
:width: 70pt
4+
:alt: Tongji
5+
6+
.. |sheffield| image:: images/sheffield-logo.svg
7+
:target: https://www.sheffield.ac.uk/
8+
:width: 70pt
9+
:alt: Sheffield
10+
11+
.. |shmc| image:: images/shmc.png
12+
:target: https://shmc.tongji.edu.cn/
13+
:width: 70pt
14+
:alt: SHMC
15+
16+
.. |drg| image:: images/DRG-logo.png
17+
:target: https://drg.ac.uk/
18+
:width: 70pt
19+
:alt: DRG
20+
21+
.. centered:: |tongji| |sheffield| |shmc| |drg|
922

1023
.. include:: ../README.rst
1124

doc/jupyter_lite_config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"LiteBuildConfig": {
3+
"no_sourcemaps": true
4+
}
5+
}

0 commit comments

Comments
 (0)