Support collapse
1:::collapse2Hello World!3:::
展开
Hello World!
Support admonitions
1:::tip[Customized Title]2hello world3:::4
5:::note6note7:::8
9:::caution10caution11:::12
13:::danger14danger15:::
Support mermaid
Use:
- start with ```mermaid
- end with ```
- set markdown frontmatter
mermaid: true
.
Mermaid Code:
1classDiagram2 note "From Duck till Zebra"3 Animal <|-- Duck4 note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"5 Animal <|-- Fish6 Animal <|-- Zebra7 Animal : +int age8 Animal : +String gender9 Animal: +isMammal()10 Animal: +mate()11 class Duck{12 +String beakColor13 +swim()14 +quack()15 }8 collapsed lines
16 class Fish{17 -int sizeInFeet18 -canEat()19 }20 class Zebra{21 +bool is_wild22 +run()23 }
Result:
classDiagram note "From Duck till Zebra" Animal <|-- Duck note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging" 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() }
Support mathjax
- set markdown frontmatter
mathjax: true
.
Block Mode
1---2mathjax: true3---4hello!5$$ \sum_{i=0}^N\int_{a}^{b}g(t,i)\text{d}t $$6hello!
hello! $$ \sum_{i=0}^N\int_{a}^{b}g(t,i)\text{d}t $$ hello!
Inline Mode
1---2mathjax: true3---4hello! $ \sum_{i=0}^N\int_{a}^{b}g(t,i)\text{d}t $ hello!
hello! $ \sum_{i=0}^N\int_{a}^{b}g(t,i)\text{d}t $ hello!
Integration with Expressive Code
For more usage, please refer to the official website expressive-code.
1function demo() {2 console.log('this line is marked as deleted')3 // This line and the next one are marked as inserted4 console.log('this is the second inserted line')5
6 return 'this line uses the neutral default marker type'7}
Code folding is supported by default
1var myArr = [1,2]2console.log(myArr)3
4var myObj = {a: 1, b: 2}5
6for(let key of myArr){7 console.log(key)8}9
10var it = myArr[Symbol.iterator]()11it.next() // {value: 1, done: false}12
13// VM704:12 Uncaught TypeError: myObj is not iterable14for(let key of myObj){15 console.log(key)1 collapsed line
16}