GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Mermaid-based Example State Diagrams (#3090) · MSutt/python-telegram-bot@76bfe8c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • AUTHORS.rst
  • docs
    • requirements-docs.txt
    • source
      • _static
        • style_mermaid_diagrams.css
      • conf.py
      • examples.conversationbot.rst
      • examples.conversationbot2.rst
      • examples.nestedconversationbot.rst
  • examples
    • conversationbot.mmd
    • conversationbot.png
    • conversationbot2.mmd
    • conversationbot2.png
    • nestedconversationbot.mmd
    • nestedconversationbot.png
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎AUTHORS.rst‎

Copy file name to clipboardExpand all lines: AUTHORS.rst
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following wonderful people contributed directly or indirectly to this projec
2929
- `Balduro <https://github.com/Balduro>`_
3030
- `Bibo-Joshi <https://github.com/Bibo-Joshi>`_
3131
- `bimmlerd <https://github.com/bimmlerd>`_
32+
- `cyc8 <https://github.com/cyc8>`_
3233
- `d-qoi <https://github.com/d-qoi>`_
3334
- `daimajia <https://github.com/daimajia>`_
3435
- `Daniel Reed <https://github.com/nmlorg>`_
Collapse file

‎docs/requirements-docs.txt‎

Copy file name to clipboard
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sphinx==5.0.1
22
sphinx-pypi-upload
33
furo==2022.6.4.1
4-
sphinx-paramlinks==0.5.4
4+
sphinx-paramlinks==0.5.4
5+
sphinxcontrib-mermaid==0.7.1
Collapse file

‎docs/source/_static/style_mermaid_diagrams.css‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.mermaid svg {
2+
height: auto;
3+
}
Collapse file

‎docs/source/conf.py‎

Copy file name to clipboardExpand all lines: docs/source/conf.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"sphinx.ext.intersphinx",
4646
"sphinx.ext.linkcode",
4747
"sphinx_paramlinks",
48+
"sphinxcontrib.mermaid",
4849
]
4950

5051
# Use intersphinx to reference the python builtin library docs
@@ -211,7 +212,10 @@
211212
# relative to this directory. They are copied after the builtin static files,
212213
# so a file named "default.css" will overwrite the builtin "default.css".
213214
html_static_path = ["_static"]
214-
html_css_files = ["style_external_link.css"]
215+
html_css_files = [
216+
"style_external_link.css",
217+
"style_mermaid_diagrams.css",
218+
]
215219
html_permalinks_icon = "¶" # Furo's default permalink icon is `#`` which doesn't look great imo.
216220

217221
# Output file base name for HTML help builder.
Collapse file

‎docs/source/examples.conversationbot.rst‎

Copy file name to clipboardExpand all lines: docs/source/examples.conversationbot.rst
+1-2Lines changed: 1 addition & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
State Diagram
1111
-------------
1212

13-
.. image:: ../../examples/conversationbot.png
14-
13+
.. mermaid:: ../../examples/conversationbot.mmd
Collapse file

‎docs/source/examples.conversationbot2.rst‎

Copy file name to clipboardExpand all lines: docs/source/examples.conversationbot2.rst
+1-2Lines changed: 1 addition & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
State Diagram
1111
-------------
1212

13-
.. image:: ../../examples/conversationbot2.png
14-
13+
.. mermaid:: ../../examples/conversationbot2.mmd
Collapse file

‎docs/source/examples.nestedconversationbot.rst‎

Copy file name to clipboardExpand all lines: docs/source/examples.nestedconversationbot.rst
+1-2Lines changed: 1 addition & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
State Diagram
1111
-------------
1212

13-
.. image:: ../../examples/nestedconversationbot.png
14-
13+
.. mermaid:: ../../examples/nestedconversationbot.mmd
Collapse file

‎examples/conversationbot.mmd‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
flowchart TB
2+
%% Documentation: https://mermaid-js.github.io/mermaid/#/flowchart
3+
A(("/start")):::entryPoint -->|Hi! My name is Professor Bot...| B((GENDER)):::state
4+
B --> |"- Boy <br /> - Girl <br /> - Other"|C("(choice)"):::userInput
5+
C --> |I see! Please send me a photo...| D((PHOTO)):::state
6+
D --> E("/skip"):::userInput
7+
D --> F("(photo)"):::userInput
8+
E --> |I bet you look great!| G[\ /]:::userInput
9+
F --> |Gorgeous!| G[\ /]
10+
G --> |"Now, send me your location .."| H((LOCATION)):::state
11+
H --> I("/skip"):::userInput
12+
H --> J("(location)"):::userInput
13+
I --> |You seem a bit paranoid!| K[\" "/]:::userInput
14+
J --> |Maybe I can visit...| K
15+
K --> |"Tell me about yourself..."| L(("BIO")):::state
16+
L --> M("(text)"):::userInput
17+
M --> |"Thanks and bye!"| End(("END")):::termination
18+
classDef userInput fill:#2a5279, color:#ffffff, stroke:#ffffff
19+
classDef state fill:#222222, color:#ffffff, stroke:#ffffff
20+
classDef entryPoint fill:#009c11, stroke:#42FF57, color:#ffffff
21+
classDef termination fill:#bb0007, stroke:#E60109, color:#ffffff
Collapse file

‎examples/conversationbot.png‎

Copy file name to clipboard
-82.4 KB
Binary file not shown.
Collapse file

‎examples/conversationbot2.mmd‎

Copy file name to clipboard
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
flowchart TB
2+
%% Documentation: https://mermaid-js.github.io/mermaid/#/flowchart
3+
A(("/start")):::entryPoint -->|Hi! My name is Doctor Botter...| B((CHOOSING)):::state
4+
B --> C("Something else..."):::userInput
5+
C --> |What category?| D((TYPING_CHOICE)):::state
6+
D --> E("(text)"):::userInput
7+
E --> |"[save choice] <br /> I'd love to hear about that!"| F((TYPING_REPLY)):::state
8+
F --> G("(text)"):::userInput
9+
G --> |"[save choice: text] <br /> Neat! <br /> (List of facts) <br /> More?"| B
10+
B --> H("- Age <br /> - Favourite colour <br /> - Number of siblings"):::userInput
11+
H --> |"[save choice] <br /> I'd love to hear about that!"| F
12+
B --> I("Done"):::userInput
13+
I --> |"I learned these facts about you: <br /> ..."| End(("END")):::termination
14+
classDef userInput fill:#2a5279, color:#ffffff, stroke:#ffffff
15+
classDef state fill:#222222, color:#ffffff, stroke:#ffffff
16+
classDef entryPoint fill:#009c11, stroke:#42FF57, color:#ffffff
17+
classDef termination fill:#bb0007, stroke:#E60109, color:#ffffff

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.