add diagrams

This commit is contained in:
Cat Tom 2024-07-24 21:23:16 +08:00
parent 227f781aac
commit 56611b4fa8
3 changed files with 105 additions and 8 deletions

View File

@ -1,19 +1,17 @@
# 首页 # 首页
## 二
### Three
#### 肆
> 记录生活,积累技术。 > 记录生活,积累技术。
## Admonitions
!!! note "Phasellus posuere in sem ut cursus" !!! note "Phasellus posuere in sem ut cursus"
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa. massa, nec semper lorem quam in massa.
## Annotations
Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit. Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit.
{ .annotate } { .annotate }
@ -29,9 +27,13 @@ Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit.
1. :man_raising_hand: I'm an annotation! 1. :man_raising_hand: I'm an annotation!
2. :woman_raising_hand: I'm an annotation as well! 2. :woman_raising_hand: I'm an annotation as well!
## Buttons
[Subscribe to our newsletter](#){ .md-button .md-button--primary } [Subscribe to our newsletter](#){ .md-button .md-button--primary }
[Send :fontawesome-solid-paper-plane:](#){ .md-button } [Send :fontawesome-solid-paper-plane:](#){ .md-button }
# Code blocks
``` py title="bubble_sort.py" ``` py title="bubble_sort.py"
def bubble_sort(items): def bubble_sort(items):
for i in range(len(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. The `#!python range()` function is used to generate a sequence of numbers.
## Content tabs
=== "C" === "C"
``` c ``` c
@ -120,8 +124,96 @@ The `#!python range()` function is used to generate a sequence of numbers.
3. Nulla tempor lobortis orci 3. Nulla tempor lobortis orci
``` ```
## Data tables
| Method | Description | | Method | Description |
| :---------: | :----------------------------------: | | :---------: | :----------------------------------: |
| `GET` | :material-check: Fetch resource | | `GET` | :material-check: Fetch resource |
| `PUT` | :material-check-all: Update resource | | `PUT` | :material-check-all: Update resource |
| `DELETE` | :material-close: Delete resource | | `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>>
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state <<join>>
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
```

1
docs/mood/mood.md Normal file
View File

@ -0,0 +1 @@
# 随想随写

View File

@ -56,7 +56,11 @@ markdown_extensions:
- pymdownx.keys - pymdownx.keys
- pymdownx.mark - pymdownx.mark
- pymdownx.smartsymbols - pymdownx.smartsymbols
- pymdownx.superfences - pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.snippets - pymdownx.snippets
- pymdownx.tabbed: - pymdownx.tabbed:
alternate_style: true alternate_style: true