File tree Expand file tree Collapse file tree 6 files changed +61
-0
lines changed
src/pydata_sphinx_theme/assets/styles Expand file tree Collapse file tree 6 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 4747 "myst_parser" ,
4848 "ablog" ,
4949 "jupyter_sphinx" ,
50+ "sphinxcontrib.mermaid" ,
5051 "sphinxcontrib.youtube" ,
5152 "nbsphinx" ,
5253 "numpydoc" ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ See the sections in the primary sidebar and below to explore.
1919 pydata
2020 execution
2121 graphviz
22+ mermaid
2223
2324
2425.. Note: the caption below is intentionally long in order to test out what long captions look like.
Original file line number Diff line number Diff line change 1+ ========
2+ Mermaid
3+ ========
4+
5+ If you use `sphinxcontrib-mermaid <https://github.com/mgaitan/sphinxcontrib-mermaid >`_
6+ to generate flowcharts or diagrams, and you output the diagrams in "raw" format,
7+ they will automatically adapt to this theme's light or dark mode.
8+
9+ To use this feature, you'll need to install `sphinxcontrib-mermaid `_ and add it to your
10+ list of extensions in ``conf.py ``:
11+
12+ .. code-block :: python
13+
14+ # conf.py
15+ extensions = [
16+ ... ,
17+ " sphinxcontrib.mermaid" ,
18+ ]
19+
20+ This will enable the ``.. mermaid:: `` directive. For example:
21+
22+ .. begin-example-mermaid
23+ .. mermaid ::
24+
25+ gitGraph:
26+ commit
27+ branch newbranch
28+ checkout newbranch
29+ commit id:"1111"
30+ commit tag:"test"
31+ checkout main
32+ commit type: HIGHLIGHT
33+ commit
34+ merge newbranch
35+ commit
36+ branch b2
37+ commit
38+ .. end-example-mermaid
39+
40+ is generated by the following code:
41+
42+ .. include :: ./mermaid.rst
43+ :start-after: begin-example-mermaid
44+ :end-before: .. end-example-mermaid
45+ :code: rst
46+ :class: highlight
47+
48+ See the `Mermaid documentation <https://mermaid.js.org/syntax/examples >`__ for additional examples.
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ doc = [
7373 " sphinx-design" ,
7474 " sphinx-togglebutton" ,
7575 " jupyterlite-sphinx" ,
76+ " sphinxcontrib-mermaid" ,
7677 " sphinxcontrib-youtube>=1.4.1" ,
7778 " sphinx-favicon>=1.0.1" ,
7879 " ipykernel" ,
Original file line number Diff line number Diff line change 1+ /* *
2+ * sphinxcontrib-mermaid
3+ * ref: https://github.com/mgaitan/sphinxcontrib-mermaid
4+ */
5+
6+ /* Style the diagram such that it has a dark mode */
7+ html [data-theme = " dark" ] pre .mermaid > svg {
8+ filter : brightness (0.8 ) invert (0.82 ) contrast (1.2 );
9+ }
Original file line number Diff line number Diff line change 7878@import " ./extensions/execution" ;
7979@import " ./extensions/gallery_grid" ;
8080@import " ./extensions/graphviz" ;
81+ @import " ./extensions/mermaid" ;
8182@import " ./extensions/pydata" ;
8283@import " ./extensions/sphinx_design" ;
8384@import " ./extensions/togglebutton" ;
You can’t perform that action at this time.
0 commit comments