Markdown 列表语法

news/2024/11/20 21:29:15/

有序列表

要创建有序列表,请在每个列表项前添加数字并紧跟一个英文句点。数字不必按数学顺序排列,但是列表应当以数字 1 起始。

Markdown语法HTML预览效果
1. First item
2. Second item
3. Third item
4. Fourth item
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
1. First item
1. Second item
1. Third item
1. Fourth item
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
1. First item
8. Second item
3. Third item
5. Fourth item
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
1. First item
2. Second item
3. Third item
    1. Indented item
    2. Indented item
4. Fourth item
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ol>
<li>Indented item</li>
<li>Indented item</li>
</ol>
</li>
<li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
    1. Indented item
    2. Indented item
  4. Fourth item
#有序列表最佳实践

CommonMark and a few other lightweight markup languages let you use a parenthesis ()) as a delimiter (e.g., 1) First item), but not all Markdown applications support this, so it isn’t a great option from a compatibility perspective. For compatibility, use periods only.

✅  Do this❌  Don't do this
1. First item
2. Second item
1) First item
2) Second item

#无序列表

要创建无序列表,请在每个列表项前面添加破折号 (-)、星号 (*) 或加号 (+) 。缩进一个或多个列表项可创建嵌套列表。

Markdown语法HTML预览效果
- First item
- Second item
- Third item
- Fourth item
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
  • First item
  • Second item
  • Third item
  • Fourth item
* First item
* Second item
* Third item
* Fourth item
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
  • First item
  • Second item
  • Third item
  • Fourth item
+ First item
+ Second item
+ Third item
+ Fourth item
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
  • First item
  • Second item
  • Third item
  • Fourth item
- First item
- Second item
- Third item
    - Indented item
    - Indented item
- Fourth item
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ul>
<li>Indented item</li>
<li>Indented item</li>
</ul>
</li>
<li>Fourth item</li>
</ul>
  • First item
  • Second item
  • Third item
    • Indented item
    • Indented item
  • Fourth item
#无序列表最佳实践

Markdown applications don’t agree on how to handle different delimiters in the same list. For compatibility, don't mix and match delimiters in the same list — pick one and stick with it.

✅  Do this❌  Don't do this
- First item
- Second item
- Third item
- Fourth item
+ First item
* Second item
- Third item
+ Fourth item

#在列表中嵌套其他元素

要在保留列表连续性的同时在列表中添加另一种元素,请将该元素缩进四个空格或一个制表符,如下例所示:

#段落
*   This is the first list item.
*   Here's the second list item.I need to add another paragraph below the second list item.*   And here's the third list item.

渲染效果如下:

  • This is the first list item.

  • Here's the second list item.

    I need to add another paragraph below the second list item.

  • And here's the third list item.

#引用块
*   This is the first list item.
*   Here's the second list item.> A blockquote would look great below the second list item.*   And here's the third list item.

渲染效果如下:

  • This is the first list item.

  • Here's the second list item.

    A blockquote would look great below the second list item.

  • And here's the third list item.

#代码块

代码块通常采用四个空格或一个制表符缩进。当它们被放在列表中时,请将它们缩进八个空格或两个制表符。

1.  Open the file.
2.  Find the following code block on line 21:<html><head><title>Test</title></head>3.  Update the title to match the name of your website.

渲染效果如下:

  1. Open the file.

  2. Find the following code block on line 21:

    <html><head><title>Test</title></head>
    
  3. Update the title to match the name of your website.

#图片
1.  Open the file containing the Linux mascot.
2.  Marvel at its beauty.![Tux, the Linux mascot](/assets/images/tux.png)3.  Close the file.

渲染效果如下:

  1. Open the file containing the Linux mascot.

  2. Marvel at its beauty.

  3. Close the file.

#列表

You can nest an unordered list in an ordered list, or vice versa.

1. First item
2. Second item
3. Third item- Indented item- Indented item
4. Fourth item

渲染效果如下:

  1. First item
  2. Second item
  3. Third item
    • Indented item
    • Indented item
  4. Fourth item

http://www.ppmy.cn/news/1439794.html

相关文章

鸿蒙OpenHarmony【LED外设控制】 (基于Hi3861开发板)

概述 OpenHarmony WLAN模组基于Hi3861平台提供了丰富的外设操作能力&#xff0c;包含I2C、I2S、ADC、UART、SPI、SDIO、GPIO、PWM、FLASH等。本文介绍如何通过调用OpenHarmony的NDK接口&#xff0c;实现对GPIO控制&#xff0c;达到LED闪烁的效果。其他的IOT外设控制&#xff0…

网络安全实训Day22

网络空间安全实训-渗透测试 CSRF 定义&#xff1a;跨站伪造请求攻击 攻击者透过诱骗受害者点击攻击者提前构造的恶意链接&#xff0c;从而以受害者的身份向网站服务器发起请求&#xff0c;达到攻击的目的 通过CSRF在网站后台创建管理员 1.搭建创建管理员账号的站点 1.将对方网…

【MongoDB】--MongoDB的组合索引

目录 一、前言二、Query查询条件转换shell输入命令1、常用shell输入命令2、explain()解析计划三、组合索引的说明一、前言 本文章主要介绍Mongodb的组合索引的使用。 二、Query查询条件转换shell输入命令 1、常用shell输入命令 Query: {"tenantsid": {"$num…

MAC系统升级问题记录

一、 场景 新购置一台MAC mini盒子作为开发使用&#xff0c;系统版本为macOS Sonoma 14.2, 由于是新机器&#xff0c;从新开始安装开发工具&#xff0c;从AppStore中获取XCode 15.3 版本&#xff0c;编译现有工程项目&#xff0c;报如下错误&#xff1a; SDK does not contai…

AI数字人给网络安全带来新的威胁

随着人工智能技术的快速发展&#xff0c;AI数字人已经成为我们日常生活和工作中的一部分。它们以其高度的智能化和仿真性&#xff0c;为我们提供了许多便利。与此同时&#xff0c;AI数字人也给网络安全带来了新的威胁。在这一背景下&#xff0c;使用SSL证书显得尤为重要&#x…

Zookeeper集群部署和单机部署

Zookeeper集群部署和单机部署 Zookeeper单机部署 cd /data/softwarewget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.12/zookeeper-3.4.12.tar.gztar -zxvf zookeeper-3.4.12.tar.gz mv zookeeper-3.4.12 /data/apps/zookeeper-3.4.12cd /data/apps/zookeeper…

时间序列预测:基于PyTorch框架的循环神经网络(RNN)实现销量预测

之前随手一写&#xff0c;没想到做预测的同学还挺多&#xff0c;但是之前那个效果并不好&#xff0c;于是在之前的基础上重新修改完善&#xff0c;到了现在这一步才感觉预测算是初步能应用。 上文地址&#xff1a;LSTM模型预测时间序列&#xff1a;根据历史销量数据预测商品未…

金三银四,备战数据结构与经典算法面试

随着春招季节的临近&#xff0c;面试备战成为许多求职者的痛点。如何在激烈的竞争中脱颖而出&#xff0c;成为众多求职者思考的问题。学习Python编程与算法内容&#xff0c;成为面试开发、测试开发等热门岗位的基础。 为了帮助大家更好地应对技术类面试挑战&#xff0c;霍格沃…