markdown学习笔记

一、markdown标题

一级标题:

># 一级标题:

二级标题:

>## 二级标题:

三级标题:

>### 三级标题:
四级标题:
>#### 四级标题:
五级标题:
>##### 五级标题:
六级标题:
>###### 六级标题: 

二、markdown字体和段落

  1. 斜体:一个_或*包裹:斜体斜体

    _斜体_和*斜体*

  2. 粗体:两个_或*包裹:粗体粗体

    **粗体**和_粗体_

  3. 粗斜体:三个_或*包裹:粗斜体

    ***粗斜体***和___粗斜体___

  4. 删除线: 使用两个~~包裹,如~~删除线~~→ 删除线

    ~~删除线~~

  5. 分割线:使用三个以上的 “- “,”*” 和 “_”,如

    ---
    效果如下


在文本中加粗(bold)或倾斜(Italic)时建议使用" * "

三、markdown列表

  1. 有序列表
    在列表项前加数字和英文“.”,如“1.”

    1. 列表项1
    2. 列表项2
  2. 无序列表
    在列表项前加“*”,“-”,“+”,如“- 列表项1”

    • 列表项1
    • 列表项2
    • 列表项3
  3. 列表嵌套
    在子列表选项前缩进四个空格即可,如

    • 一级
      • 二级
        • 三级
  4. 任务列表

    语法:
    - [x] text(x可去,x代表已选择)

    - [x] Write the press release
    - [ ] Update the website
    - [ ] Contact the media

    • Write the press release
    • Update the website
    • Contact the media
  5. 定义列表

    语法:
    列表名
    :子列表内容
    注意:定义列表必须与上下文用空行区分

First Term
: This is the definition of the first term.

Second Term
: This is one definition of the second term.
: This is another definition of the second term.
First Term
This is the definition of the first term.
Second Term
This is one definition of the second term.
This is another definition of the second term.

四、markdown中插入代码

  1. 将单词或短语标注为代码块,使用一个“ ` ”包裹
    如调用date对象

    调用`date `对象

  2. 当代码中有引号时,使用两个"`"包裹转义
    如,function 'a'

    ``function ‘a’ ``

  3. 创建代码块,每行至少缩进4个空格或1个制表符(tab)或用三个“ ` ”包裹

    代码:
    ```
    <html>
    <head>
    </head>
    </html>
    ```

     效果:  
     <html>
         <head>
         </head>
     </html>
    
  4. 语法高亮

    一般markdown编辑器自带语法高亮,最好在反引号后说明语言类型

    {
    "firstName": "John",
     "lastName": "Smith",
    "age": 25
    }
    

五、markdown链接

  1. 超链接:

    语法: [超链接显示名](超链接地址 “超链接title”)
    title是可选的,当title有值时鼠标悬停时显示内容
    如:
    [GitHub](https://github.com/explore “探索GitHub”)
    效果:
    GitHub

  2. 网址和email:

    语法: < 链接url >

    CSDN官网:<https://www.csdn.net/>
    我的邮箱:<1715970551@qq.com>
    效果:
    CSDN官网:https://www.csdn.net/
    我的邮箱:1715970551@qq.com

  3. 带格式化的链接
    1.强调链接:在链接语法前后加“ * ”,如
        斜体链接:*[GitHub](https://github.com/explore "探索GitHub")*
        粗体链接:**[GitHub](https://github.com/explore "探索GitHub")**
        删除线链接:~~[GitHub](https://github.com/explore "探索GitHub")~~
        详情参考第二部分:markdown字体和段落.
    
    效果如下
    斜体链接:GitHub
    粗体链接:GitHub
    删除线链接:GitHub
  4. 引用类型链接

六、markdown图片

  1. 插入图片

    语法: ![图片alt](图片链接 “图片title”)
    如:
    ![图片](./images/illust_62799720_20191019_123028.jpg “beautiful”)

  2. 链接图片

    语法: [![图片alt](图片链接 “图片title”)](链接地址)

    [[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-3gpEVtue-1619620960061)(“www.4399.com”)]

七、markdown转义符

  1. 一般都用“\”进行转义

    如"\\"和“\[”,“\{”等

  2. 特殊字符自动转义

    markdown会将< 和 &自动转义

八、markdown与html标签 {#eight}

  1. 行级內联标签可以任意使用
  2. 在markdown中使用区块标签必须在前后加上空行

    在行级内联标签内可以使用markdown语法。在块级标签内不能。

九、markdown表格

  1. 使用三个或多个连字符(—)创建每列的标题,使用管道(|)分隔每列
    如:
    | Syntax      | Description |
    | ----------- | ----------- |
    | Header      | Title       |
    | Paragraph   | Text        |
    
    效果如下:
    SyntaxDescription
    HeaderTitle
    ParagraphText
  2. 在标题行中的连字符的左侧,右侧或两侧添加冒号(:),将列中的文本对齐到左侧,右侧或中心。
    如
     | Syntax      | Description | Test Text     |
     | :---        |    :----:   |          ---: |
     | Header      | Title       | Here's this   |
     | Paragraph   | Text        | And more      |
    
    效果如下:
    SyntaxDescriptionTest Text
    HeaderTitleHere’s this
    ParagraphTextAnd more
如果要在表格中使用“|”符号,可以使用表格的HTML字符代码(&#124;)

十、markdown标题

  1. 使用大括号给标题添加id

    My Great Heading {#custom-id}

  2. 使用标题id,链接时跳转到指定标签

    [text](#id)

    # 八、markdown与html标签 {#eight}
    [跳转到第八个标题](#eight)
    

    结果: 跳转到第八个标题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值