首页 > 其他分享 >Markdown 语法测试、备忘

Markdown 语法测试、备忘

时间:2022-11-29 20:02:17浏览次数:76  
标签:Markdown text apt 备忘 语法 item https test Output

Markdown Crash Test

Benchmarking the support of Markdown with a comprehensive checklist

You're working on a project featuring Markdown?

Drop the source of this page wherever you want to test or showcase the support of Markdown, and check that every single feature is properly rendered.

Table of Contents

Basic formatting

Bold text

Syntax:

You can mark some text as bold with **two asterisks**
or __two underscores__.

Output:

You can mark some text as bold with two asterisks
or two underscores.

Italic

Use a *single asterisk* or a _single underscore_ for italic.

Output:

Use a single asterisk or a single underscore for italic.

Bold and italic

Three stars gives `***bold and italic***`

Three stars gives bold and italic

Strikethrough

Using ~~two tildes~~ will strikethrough: two tildes

Blockquotes

Syntax:

> blockquote

Output:

blockquote

Nested blockquotes

Syntax:

> First level
>
>> Second level

Output:

First level

Second level

Markdown in blockquotes

> **Markdown** can be used *inside quotes*
>
> 1.   This is the first list item.
> 1.   This is the second list item.
>
> ~~strikethrough~~
>
> Here's some example code:
>
>     return shell_exec("echo $input | $markdown_script");

Output:

Markdown can be used inside quotes

  1. This is the first list item.
  2. This is the second list item.

strikethrough

Here's some example code:

return shell_exec("echo $input | $markdown_script");

Lists

Unordered list

Cant be marked with -, + or *

- First item
- Second item
- Third item
+ First item
+ Second item
+ Third item
* First item
* Second item
* Third item

Output:

  • First item
  • Second item
  • Third item
  • First item
  • Second item
  • Third item
  • First item
  • Second item
  • Third item

Ordered lists

Incrementation is automatic, you can simply use 1. everywhere

1. First item
1. Second item
1. Third item

Output:

  1. First item
  2. Second item
  3. Third item

Nested list

- First item
- Second item
- Third item
  1. Indented item
  1. Indented item
- Fourth item

Output:

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

Linebreaks

When you hit enter just once between two lines, both lines are joined into a single paragraph.

But, if you leave a blank line between them, they will split into two paragraphs.

Demonstration:

This text is a paragraph.
This won't be another paragraph, it will join the line above it.

This will be another paragraph, as it has a blank line above it.

Output:

This text is a paragraph. This won't be another paragraph, it will join the line above it.

This will be another paragraph, as it has a blank line above it.

Force line breaks

To force a line break, end a line with two or more whitespaces, and then type return.

This is the first line.··
Second line

Output:

This is the first line.
Second line

Horizontal lines

Can be inserted with four *, - or _

----

****

____

Output:




[Semantic description](https://roneo.org/markdown)  
<[email protected]>  
<https://roneo.org/markdown> works too. Must be used for explicit links.

Output:

Semantic description
[email protected]
https://roneo.org/markdown works too. Must be used for explicit links.

[I'm a link][Reference text]

[This link] will do the same as well. It works as the identifier itself.


[reference text]: https://jamstack.club
[this link]: https://roneo.org/markdown

Output:

I'm a link

This link will do the same as well. It works as the identifier itself.

Note: The reference text is not case sensitive

[Random text][random-identifier].
Hover the mouse over it to see the title.

Several syntaxes are accepted:
[One](https://eff.org "First site")
[Two](https://example.com 'Second site')
[Three](https://example.com (Third site))

[random-identifier]: https://roneo.org/markdown "This example has a title"

Output:

Random text. Hover the mouse over it to see the title.

Several syntaxes are accepted:
One
Two
Three

To emphasize links, add asterisks before and after the brackets and parentheses.

I love supporting the **[EFF](https://eff.org)**.  
This is the *[Markdown Guide](https://www.markdownguide.org)*.

To denote links as code, add backticks inside the brackets:

See the section on [`code`](#code).

Output:

I love supporting the EFF.
This is the Markdown Guide.
See the section on code.

Attribute a custom anchor to a heading

Anchors are automatically generated based on the heading's content. You can customize the anchor this way:

### Heading {#custom-id}

Output:

Heading {#custom-id}

Code formatting

Inline

Wrap with single backticks to highlight as`code`code

Codeblocks

Create a code block with three backticks ``` before and after your block of code.

Output:

sudo apt hello
cat /etc/apt/sources.list

Also possible with a tabulation or four empty spaces at the beginning of the lines:

Tabulation

sudo apt hello
echo "hi"

Four whitespaces

sudo apt hello

Let's test the wrapping of a long line:

apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test apt install test

Codeblocks with syntax highlighting

Set the language right after the first backticks (for example ```html ) to get syntax highlighting

Samples:

HTML

<!DOCTYPE html>
<html lang="fr" itemscope itemtype="http://schema.org/WebPage">
  <head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

CSS

/* Comment */
.blog-post h2, h3 {
  margin-top: 1.6em;
  margin-bottom: 0.8em;
}

Bash

# Comment

if [[ ! $system =~ Linux|MacOS|BSD ]]; then
	echo "This version of bashtop does not support $system platform."

sudo apt install test

Diff

- delete
+ add
! test
# comment

Escaping with backslashes

Any ASCII punctuation character may be escaped using a single backslash.

Example:

\*this is not italic*

Output:

*this is not italic*

Markdown provides backslash escapes for the following characters:

\   backslash
`   backtick
*   asterisk
_   underscore
{}  curly braces
[]  square brackets
()  parentheses
#   hash mark
+	plus sign
-	minus sign (hyphen)
.   dot
!   exclamation mark

Images

Basic syntax

  ![Semantic description of the image](https://roneo.org/img/ok.png)

Semantic description of the image

Note: The text inside the square brackets is important!

Screen reader users get informations about the image with this attribute called ALT, for alternative text.

Including descriptive alt text helps maintain accessibility for every visitor and should always be included with an image. When you add alt text be sure to describe the content and function of the picture.
In addition to the accessibility benefits, ALT is useful for SEO. It's also displayed when, for some reason, the picture is not loaded by the browser.

Image with title and caption

![Semantic description](https://roneo.org/img/ok.png "Your title")*Your caption*

Semantic descriptionYour caption

Clickable images

For clickable images, simply wrap the image markup into a link markup:

[![Semantic description](https://roneo.org/img/ok.png "Your title")](http://jamstack.club)

Output:

Semantic description

Image with an identifier

You can call the image with an identifier as we do for links

![Semantic desc.][image identifier]

Lorem ipsum dolor sit amet consectetur adipisicing elit [...]

[image identifier]: https://roneo.org/img/ok.png "Title"

Semantic desc.

Task lists

- [X] Write the press release
- [ ] Update the website

Output:

Tables

| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |

or

| Syntax | Description |
| - | --- |
| Header | Title |
| Paragraph | Text|

will render the same way:

Syntax Description
Header Title
Paragraph Text

Text alignment in tables

| Syntax    | Description |   Test Text |
| :-------- | :---------: | ----------: |
| Header    |    Title    | Here's this |
| Paragraph |    Text     |    And more |

See the way the text is aligned, depending on the position of ':'

Syntax Description Test Text
Header Title Here's this
Paragraph Text And more

Footnotes

Here's a sentence with a footnote[^1].
(see the result at the bottom of the page)

[^1]: This is the first footnote.

Output:

Here's a sentence with a footnote[1].
(see the result at the bottom of the page)

Long footnote

Here's a longer one.[^bignote]
(see the result at the bottom of the page)

[^bignote]: Here's one with multiple paragraphs and code.
	
	Indent paragraphs to include them in the footnote.
	
	`{ my code }`
	
	Note that you can place the footnote anywhere you want in your article

Output:

Here's a longer one.[2]
(see the result at the bottom of the page)

Definition List

term
: definition

second term
: meaning

complex term
: long definition including **bold text**. Velit tempor cillum aute culpa pariatur enim laboris consectetur tempor. Aute elit non do ipsum. Nisi quis culpa magna esse ipsum. Ad aliquip ullamco minim cillum in ullamco.

Output:

term
definition
second term
meaning
complex term
long definition including bold text. Velit tempor cillum aute culpa pariatur enim laboris consectetur tempor. Aute elit non do ipsum. Nisi quis culpa magna esse ipsum. Ad aliquip ullamco minim cillum in ullamco.

Headings

Add ## at the beginning of a line to set as Heading.
You can use up to 6 # symbols for the corresponding Heading levels

## Heading 1
[...]

###### Heading 6

Heading 2

pedit quia voluptates atque nobis, perspiciatis deserunt perferendis, nostrum, voluptatem voluptas dolorem iure voluptatum? Accusantium a dolores dicta?Pariatur voluptates quam ut, cum aliquid eum, officiis laudantium totam suscipit, ducimus odit nobis! Corrupti, doloremque sed optio voluptatibus deserunt quas repellat eius minus quasi, ipsam unde esse sequi deleniti.

Heading 3

pedit quia voluptates atque nobis, perspiciatis deserunt perferendis, nostrum, voluptatem voluptas dolorem iure voluptatum? Accusantium a dolores dicta?Pariatur voluptates quam ut, cum aliquid eum, officiis laudantium totam suscipit, ducimus odit nobis! Corrupti, doloremque sed optio voluptatibus deserunt quas repellat eius minus quasi, ipsam unde esse sequi deleniti.

Heading 4

pedit quia voluptates atque nobis, perspiciatis deserunt perferendis, nostrum, voluptatem voluptas dolorem iure voluptatum? Accusantium a dolores dicta?Pariatur voluptates quam ut, cum aliquid eum, officiis laudantium totam suscipit, ducimus odit nobis! Corrupti, doloremque sed optio voluptatibus deserunt quas repellat eius minus quasi, ipsam unde esse sequi deleniti.

Heading 5

pedit quia voluptates atque nobis, perspiciatis deserunt perferendis, nostrum, voluptatem voluptas dolorem iure voluptatum? Accusantium a dolores dicta?Pariatur voluptates quam ut, cum aliquid eum, officiis laudantium totam suscipit, ducimus odit nobis! Corrupti, doloremque sed optio voluptatibus deserunt quas repellat eius minus quasi, ipsam unde esse sequi deleniti.

Heading 6

pedit quia voluptates atque nobis, perspiciatis deserunt perferendis, nostrum, voluptatem voluptas dolorem iure voluptatum? Accusantium a dolores dicta?Pariatur voluptates quam ut, cum aliquid eum, officiis laudantium totam suscipit, ducimus odit nobis! Corrupti, doloremque sed optio voluptatibus deserunt quas repellat eius minus quasi, ipsam unde esse sequi deleniti.

References


  1. This is the first footnote. ↩︎

  2. Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    { my code }

    Note that you can place the footnote anywhere you want in your article ↩︎

标签:Markdown,text,apt,备忘,语法,item,https,test,Output
From: https://www.cnblogs.com/wlchengg/p/16936521.html

相关文章

  • Flex 布局教程:语法篇
    Flex布局教程:语法篇转载自:阮一峰的网络日志Flex布局教程:语法篇网页布局(layout)是CSS的一个重点应用。布局的传统解决方案,基于盒状模型,依赖display属性+po......
  • 备忘录模式
    大家有没有看过尼古拉斯凯奇主演过的《NEXT》(《预见未来》)?尼古拉斯凯奇饰演一个可以预视并且扭转未来的人,其中一个情节很是让人心动——男女主角见面的那段情节:。。。。。。......
  • 【拓展】你真的会写 Markdown 么?
    1文章简介本文使用Markdown进行排版,详尽介绍了相关书写规范,排版工具为mdnice需要注意的是,有部分编辑器自定义语法,并不完全通用所有平台2通用语法2.1标题在文字写书写......
  • Java基础语法(2)数据类型
         ......
  • markdown语法整理
    目录一、前言二、Markdown基本语法2.1标题2.2加粗2.3斜体2.4高亮2.5上标2.6下标2.7代码引用(>式)2.8代码引用(```式)2.9代码引入(`式)2.10插入链接(链接显......
  • Vue模板语法
     Vue模板语法有2大类:          1.插值语法:              功能:用于解析标签体内容。         ......
  • javaSE基础-语法基础
    基础语法Java语言出现于1991年,JDK1.0版本正式发布于1995年Java之父:JamesGosling(詹姆斯•高斯林)Java是一种面向对象的编程语言Java语言是一种编译解释型语言Java语......
  • 想体验ES6语法?那用gulp+Babel来搭建ES6环境吧~
    参考:​​ES6初体验——gulp+Babel搭建ES6环境​​​​gulp-load-plugins模块化管理插件​​那至于怎么使用gulp构建工具这一问题这里就略过咯(可以参考我之前发过的......
  • 语法糖
          在方法的参数和返回值上,可利用反射获取泛型信息                               ......
  • Markdown学习
    Markdown学习二级标题三级标题四级标题五级标题六级标题字体样式粗体斜体粗斜体废弃引用引用超链接百度图片分割线代码publicstaticvoidsetNam......