掘金markdown语法测试

1,012 阅读2分钟

PS:Pc上都是用VScode markdownpreviewenhace插件写markdown的,复制过来掘金后,发现掘金对于markdown语法支持的不错噢


1.标题

#” 后加个空格。除此之外,还有 5 级标题,依次有不同的字体大小,即
# 一级标题
## 二级标题

2.文字

粗体

**粗体**

斜体

*斜体*

删除号

~~删除号~~

文字内部区分

文字内部`区分`

上标下标 30^th^ H~2~O

30^th^
H~2~O

脚注 Content [^1]

[^1]: Hi! This is a footnote

缩略

*[缩略]:这是一个缩略

*[缩略]:这是一个缩略

==标记==

==标记==

2.表格

Day Meal Price
Monday pasta $6
Tuesday chicken $8
| Day     | Meal     | Price   
:--------|---------:|:-------:
| Monday  | pasta    | $6      
| Tuesday | chicken  | $8

3.Checkbox

  • @mentions, #refs, links, formatting, and tags supported
  • list syntax required (any unordered or ordered list supported)
  • this is a complete item
  • this is an incomplete item
- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported 
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item

4.层次

  • 一层
    • 二层
      • 三层
* 一层
    * 二层
        * 三层

5.链接

这是一个链接

[这是一个链接](http://)

6.代码块

#include "stdio.h" 

void main()
{
    int i = 0;
    if()
}
c++ {.line-numbers}
#include "stdio.h" 

void main()
{
    int i = 0;
    if()
}

7.数学公式(MathJax插件)

x = {-b \pm \sqrt{b^2-4ac} \over 2a}
? x = {-b \pm \sqrt{b^2-4ac} \over 2a} ?

8.图片

推荐使用html语言来插入图片,因为markdown语法无法调整图片大小

图片名称
>推荐使用html语言来插入图片,因为markdown语法无法调整图片大小

<img src="https://p1-jj.byteimg.com/tos-cn-i-t2oaga2asx/gold-user-assets/2019/1/4/16817cdab79e6c92~tplv-t2oaga2asx-image.image" width = "100" height = "100" alt="图片名称" align=center />

9.图表

9.1.流程图

st=>start: Start
op=>operation: Your Operation
cond=>condition: Yes or No?
e=>end
st->op->cond
cond(yes)->e
cond(no)->op

9.2.时序图

graph LR
    A --> B
    B --> C
    A --> C

9.3.vega

{
"$schema": "https://vega.github.io/schema/vega/v3.0.json",
  "width": 400,
  "height": 200,
  "padding": 5,

  "data": [
    {
      "name": "table",
      "values": [
        {"category": "A", "amount": 28},
        {"category": "B", "amount": 55},
        {"category": "C", "amount": 43},
        {"category": "D", "amount": 91},
        {"category": "E", "amount": 81},
        {"category": "F", "amount": 53},
        {"category": "G", "amount": 19},
        {"category": "H", "amount": 87}
      ]
    }
  ],

  "signals": [
    {
      "name": "tooltip",
      "value": {},
      "on": [
        {"events": "rect:mouseover", "update": "datum"},
        {"events": "rect:mouseout",  "update": "{}"}
      ]
    }
  ],

  "scales": [
    {
      "name": "xscale",
      "type": "band",
      "domain": {"data": "table", "field": "category"},
      "range": "width",
      "padding": 0.05,
      "round": true
    },
    {
      "name": "yscale",
      "domain": {"data": "table", "field": "amount"},
      "nice": true,
      "range": "height"
    }
  ],

  "axes": [
    { "orient": "bottom", "scale": "xscale" },
    { "orient": "left", "scale": "yscale" }
  ],

  "marks": [
    {
      "type": "rect",
      "from": {"data":"table"},
      "encode": {
        "enter": {
          "x": {"scale": "xscale", "field": "category"},
          "width": {"scale": "xscale", "band": 1},
          "y": {"scale": "yscale", "field": "amount"},
          "y2": {"scale": "yscale", "value": 0}
        },
        "update": {
          "fill": {"value": "steelblue"}
        },
        "hover": {
          "fill": {"value": "red"}
        }
      }
    },
    {
      "type": "text",
      "encode": {
        "enter": {
          "align": {"value": "center"},
          "baseline": {"value": "bottom"},
          "fill": {"value": "#333"}
        },
        "update": {
          "x": {"scale": "xscale", "signal": "tooltip.category", "band": 0.5},
          "y": {"scale": "yscale", "signal": "tooltip.amount", "offset": -2},
          "text": {"signal": "tooltip.amount"},
          "fillOpacity": [
            {"test": "datum === tooltip", "value": 0},
            {"value": 1}
          ]
        }
      }
    }
  ]
}

10.ppt

预览要新建一个单独的md

<!-- slide -->
# hi there

<!-- slide -->
i'v got you

.