From 4468add83ae9559a849476c9e4a96abb658c0565 Mon Sep 17 00:00:00 2001 From: "xuwenyao@laptop" Date: Sun, 17 Apr 2022 16:55:57 +0800 Subject: [PATCH] add markdown_test.md --- markdown_test.md | 630 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 630 insertions(+) create mode 100644 markdown_test.md diff --git a/markdown_test.md b/markdown_test.md new file mode 100644 index 0000000..b96251a --- /dev/null +++ b/markdown_test.md @@ -0,0 +1,630 @@ +# Markdown语法测试 + +## 基本语法 + +### 区段元素 + +#### 普通文本 + +这是一个普通文本的示例。 + +#### 加粗文本 + +这是一个**加粗文本**的示例。 + +#### 斜体文本 + +这是一个*斜体文本*的示例。 + +#### 引用 + +这是一个`引用`的示例。 + +#### 链接示例 + +这是一个[链接](链接)的示例。 + +### 区块元素 + +#### 无序列表 + +- 这是无序列表示例 +- 这是无序列表示例 + - 无序列表可以有多级 + - 无序列表可以有多级 + - 无序列表可以有多级 + - 无序列表可以有多级 + - 无序列表可以有多级 +- 这是无序列表示例 + +#### 有序列表 + +1. 这是有序列表示例 +2. 这是有序列表示例 + 1. 有序列表可以有多级 + 1. 有序列表可以有多级 + 2. 有序列表可以有多级 + 1. 有序列表可以有多级 + 2. 有序列表可以有多级 +3. 这是有序列表示例 + +#### 区块引用 + +> 这是区块引用示例 + +#### 图片示例 + +![这是一个图片的示例](但是并没有实物图片) + +#### 代码块 + +```python +class Fibonacci: + def __init__(self, label): + self.label = label + + def fibonacci(self, x): + if x <= 2: + return 1 + else + return fibonacci(x - 1) + fibonacci(x - 2) +``` + +## 扩展语法 + +### 脚注 + +这是一个[^1]引用脚注的示例。 +[^1]: 这是脚注的内容 + +#### 待办列表 + +- [ ] 这个待办事项未完成 +- [x] 这个待办事项已完成 + +#### 表格 + +| 表头1 | 表头2 | 表头3 | +| ----- | ----- | ----- | +| 内容1 | 内容2 | 内容3 | + +[TOC] + +## 外部功能 + +### MathJax + +行内公式$\int _a^b \sin(x^2) \mathrm{d}x$ + +$$ +\int _a^b \sin(x^2) \mathrm{d}x +$$ + +### Mermaid + +```mermaid +graph TD + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] +``` + +```mermaid +sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +``` + +```mermaid +classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + Animal : +int age + Animal : +String gender + Animal: +isMammal() + Animal: +mate() + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } +``` + +```mermaid +stateDiagram + [*] --> Still + Still --> [*] + + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] +``` + +```mermaid +gantt + title A Gantt Diagram + dateFormat YYYY-MM-DD + section Section + A task :a1, 2014-01-01, 30d + Another task :after a1 , 20d + section Another + Task in sec :2014-01-12 , 12d + another task : 24d +``` + +```mermaid +pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 +``` + +### PlantUML + +```plantuml +@startuml +participant participant as Foo +actor actor as Foo1 +boundary boundary as Foo2 +control control as Foo3 +entity entity as Foo4 +database database as Foo5 +collections collections as Foo6 +queue queue as Foo7 +Foo -> Foo1 : To actor +Foo -> Foo2 : To boundary +Foo -> Foo3 : To control +Foo -> Foo4 : To entity +Foo -> Foo5 : To database +Foo -> Foo6 : To collections +Foo -> Foo7 : To queue +@enduml +``` + +```plantuml +@startuml +Alice -> Bob: 认证请求 + +alt 成功情况 + + Bob -> Alice: 认证接受 + +else 某种失败情况 + + Bob -> Alice: 认证失败 + group 我自己的标签 + Alice -> Log : 开始记录攻击日志 + loop 1000次 + Alice -> Bob: DNS 攻击 + end + Alice -> Log : 结束记录攻击日志 + end + +else 另一种失败 + + Bob -> Alice: 请重复 + +end +@enduml +``` + +```plantuml +@startuml +autoactivate on +alice -> bob : hello +bob -> bob : self call +bill -> bob #005500 : hello from thread 2 +bob -> george ** : create +return done in thread 2 +return rc +bob -> george !! : delete +return success + +@enduml +``` + +```plantuml +@startuml +left to right direction +skinparam packageStyle rectangle +actor customer +actor clerk +rectangle checkout { + customer -- (checkout) + (checkout) .> (payment) : include + (help) .> (checkout) : extends + (checkout) -- clerk +} +@enduml +``` + +```plantuml +@startuml + +class BaseClass + +namespace net.dummy #DDDDDD { + .BaseClass <|-- Person + Meeting o-- Person + + .BaseClass <|- Meeting +} + +namespace net.foo { + net.dummy.Person <|- Person + .BaseClass <|-- Person + + net.dummy.Meeting o-- Person +} + +BaseClass <|-- net.unused.Person + +@enduml +``` + +```plantuml +@startuml +title Servlet Container + +(*) --> "ClickServlet.handleRequest()" +--> "new Page" + +if "Page.onSecurityCheck" then + ->[true] "Page.onInit()" + + if "isForward?" then + ->[no] "Process controls" + + if "continue processing?" then + -->[yes] ===RENDERING=== + else + -->[no] ===REDIRECT_CHECK=== + endif + + else + -->[yes] ===RENDERING=== + endif + + if "is Post?" then + -->[yes] "Page.onPost()" + --> "Page.onRender()" as render + --> ===REDIRECT_CHECK=== + else + -->[no] "Page.onGet()" + --> render + endif + +else + -->[false] ===REDIRECT_CHECK=== +endif + +if "Do redirect?" then + ->[yes] "redirect request" + --> ==BEFORE_DESTROY=== +else + if "Do Forward?" then + -left->[yes] "Forward request" + --> ==BEFORE_DESTROY=== + else + -right->[no] "Render page template" + --> ==BEFORE_DESTROY=== + endif +endif + +--> "Page.onDestroy()" +-->(*) + +@enduml +``` + +```plantuml +@startuml + +start +:ClickServlet.handleRequest(); +:new page; +if (Page.onSecurityCheck) then (true) + :Page.onInit(); + if (isForward?) then (no) + :Process controls; + if (continue processing?) then (no) + stop + endif + + if (isPost?) then (yes) + :Page.onPost(); + else (no) + :Page.onGet(); + endif + :Page.onRender(); + endif +else (false) +endif + +if (do redirect?) then (yes) + :redirect process; +else + if (do forward?) then (yes) + :Forward request; + else (no) + :Render page template; + endif +endif + +stop + +@enduml +``` + +```plantuml +@startuml + +package "Some Group" { + HTTP - [First Component] + [Another Component] +} + +node "Other Groups" { + FTP - [Second Component] + [First Component] --> FTP +} + +cloud { + [Example 1] +} + + +database "MySql" { + folder "This is my folder" { + [Folder 3] + } + frame "Foo" { + [Frame 4] + } +} + + +[Another Component] --> [Example 1] +[Example 1] --> [Folder 3] +[Folder 3] --> [Frame 4] + +@enduml +``` + +```plantuml +@startuml +[*] -> State1 +State1 --> State2 : Succeeded +State1 --> [*] : Aborted +State2 --> State3 : Succeeded +State2 --> [*] : Aborted +state State3 { + state "Accumulate Enough Data" as long1 + long1 : Just a test + [*] --> long1 + long1 --> long1 : New Data + long1 --> ProcessData : Enough Data + State2 --> [H]: Resume +} +State3 --> State2 : Pause +State2 --> State3[H*]: DeepResume +State3 --> State3 : Failed +State3 --> [*] : Succeeded / Save Result +State3 --> [*] : Aborted +@enduml +``` + +```plantuml +@startuml +object London +object Washington +object Berlin +object NewYork + +map CapitalCity { + UK *-> London + USA *--> Washington + Germany *---> Berlin +} + +NewYork --> CapitalCity::USA +@enduml +``` + +```plantuml +@startuml +actor actor +agent agent +artifact artifact +boundary boundary +card card +cloud cloud +component component +control control +database database +entity entity +file file +folder folder +frame frame +interface interface +node node +package package +queue queue +stack stack +rectangle rectangle +storage storage +usecase usecase +@enduml +``` + +```plantuml +@startuml +title Bracketed line style with label +node foo +foo --> bar : ∅ +foo -[bold]-> bar1 : [bold] +foo -[dashed]-> bar2 : [dashed] +foo -[dotted]-> bar3 : [dotted] +foo -[hidden]-> bar4 : [hidden] +foo -[plain]-> bar5 : [plain] +@enduml +``` + +```plantuml +@startuml +concise "Client" as Client +concise "Server" as Server +concise "Response freshness" as Cache + +Server is idle +Client is idle + +@Client +0 is send +Client -> Server@+25 : GET ++25 is await ++75 is recv ++25 is idle ++25 is send +Client -> Server@+25 : GET\nIf-Modified-Since: 150 ++25 is await ++50 is recv ++25 is idle +@100 <-> @275 : no need to re-request from server + +@Server +25 is recv ++25 is work ++25 is send +Server -> Client@+25 : 200 OK\nExpires: 275 ++25 is idle ++75 is recv ++25 is send +Server -> Client@+25 : 304 Not Modified ++25 is idle + +@Cache +75 is fresh ++200 is stale +@enduml +``` + +```plantuml +@startuml +nwdiag { + network NETWORK_BASE { + width = full + dev_A [address = "dev_A" ] + dev_B [address = "dev_B" ] + } + network IntNET1 { + width = full + dev_B [address = "dev_B1" ] + dev_M [address = "dev_M1" ] + } + network IntNET2 { + width = full + dev_B [address = "dev_B2" ] + dev_M [address = "dev_M2" ] + } +} +@enduml +``` + +```plantuml +@startgantt + +Project starts the 2020-12-01 + +[Task1] lasts 10 days +sunday are closed + +note bottom + memo1 ... + memo2 ... + explanations1 ... + explanations2 ... +end note + +[Task2] lasts 20 days +[Task2] starts 10 days after [Task1]'s end +-- Separator title -- +[M1] happens on 5 days after [Task1]'s end + + + +-- end -- +@endgantt +``` +