From 56611b4fa8a4aca4f5567a5ec2619a3a9564ff88 Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Wed, 24 Jul 2024 21:23:16 +0800 Subject: [PATCH] add diagrams --- docs/index.md | 106 +++++++++++++++++++++++++++++++++++++++++++--- docs/mood/mood.md | 1 + mkdocs.yml | 6 ++- 3 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 docs/mood/mood.md diff --git a/docs/index.md b/docs/index.md index 386be4c..96a510c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,19 +1,17 @@ # 首页 -## 二 - -### Three - -#### 肆 - > 记录生活,积累技术。 +## Admonitions + !!! note "Phasellus posuere in sem ut cursus" Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. +## Annotations + Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit. { .annotate } @@ -29,9 +27,13 @@ Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit. 1. :man_raising_hand: I'm an annotation! 2. :woman_raising_hand: I'm an annotation as well! +## Buttons + [Subscribe to our newsletter](#){ .md-button .md-button--primary } [Send :fontawesome-solid-paper-plane:](#){ .md-button } +# Code blocks + ``` py title="bubble_sort.py" def bubble_sort(items): for i in range(len(items)): @@ -68,6 +70,8 @@ When InlineHilite is enabled, syntax highlighting can be applied to inline code The `#!python range()` function is used to generate a sequence of numbers. +## Content tabs + === "C" ``` c @@ -120,8 +124,96 @@ The `#!python range()` function is used to generate a sequence of numbers. 3. Nulla tempor lobortis orci ``` +## Data tables + | Method | Description | | :---------: | :----------------------------------: | | `GET` | :material-check: Fetch resource | | `PUT` | :material-check-all: Update resource | -| `DELETE` | :material-close: Delete resource | \ No newline at end of file +| `DELETE` | :material-close: Delete resource | + +## Flow chart + +``` mermaid +graph LR + A[Start] --> B{Error?}; + B -->|Yes| C[Hmm...]; + C --> D[Debug]; + D --> B; + B ---->|No| E[Yay!]; +``` + +## Sequence diagram + +``` mermaid +sequenceDiagram + autonumber + Alice->>John: Hello John, how are you? + loop Healthcheck + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +``` + +## State diagram + +``` mermaid +stateDiagram-v2 + state fork_state <> + [*] --> fork_state + fork_state --> State2 + fork_state --> State3 + + state join_state <> + State2 --> join_state + State3 --> join_state + join_state --> State4 + State4 --> [*] +``` + +## Class diagram + +``` mermaid +classDiagram + Person <|-- Student + Person <|-- Professor + Person : +String name + Person : +String phoneNumber + Person : +String emailAddress + Person: +purchaseParkingPass() + Address "1" <-- "0..1" Person:lives at + class Student{ + +int studentNumber + +int averageMark + +isEligibleToEnrol() + +getSeminarsTaken() + } + class Professor{ + +int salary + } + class Address{ + +String street + +String city + +String state + +int postalCode + +String country + -validate() + +outputAsLabel() + } +``` + +## Entity-relationship diagram + +``` mermaid +erDiagram + CUSTOMER ||--o{ ORDER : places + ORDER ||--|{ LINE-ITEM : contains + LINE-ITEM { + string name + int pricePerUnit + } + CUSTOMER }|..|{ DELIVERY-ADDRESS : uses +``` diff --git a/docs/mood/mood.md b/docs/mood/mood.md new file mode 100644 index 0000000..e308636 --- /dev/null +++ b/docs/mood/mood.md @@ -0,0 +1 @@ +# 随想随写 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ba29c48..2320470 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,7 +56,11 @@ markdown_extensions: - pymdownx.keys - pymdownx.mark - pymdownx.smartsymbols - - pymdownx.superfences + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format - pymdownx.snippets - pymdownx.tabbed: alternate_style: true