Markdown Examples

25 年 4 月 1 日 星期二
526 字
3 分钟

Here are some examples of basic Markdown syntax you can use when writing Markdown content in Astro.

Title

You should avoid creating duplicate article titles in the Markdown main body, as article titles are automatically generated based on the title in frontmatter.

Avoid heading levels that are too deep, usually up to the third level of heading is enough.

First Class

Second Class

Third Class `inline code'

Fourth Class

Fifth Class
Sixth Class

Paragraphs

Use two spaces at the end of a line to make a line break within a paragraph

All work and no play makes Jack a dull boy.
All work and no play makes Jack a dull boy.

Pictures

Small Size Pictures

Picture Description

Large Size Pictures

Picture Description

Pictures with captions

Picture Description
Picture Caption

Emphasizes

This is the important element and this is the secondary element.

Strikethrough

This is a deleted text.

Quote

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.

Tiam, ad mint andaepu dandae nostion secatur sequo quae.
Note that you can use Markdown syntax within a blockquote.

Nested references

quote

nested reference

References with footnotes

Don't communicate by sharing memory, share memory by communicating.
Rob Pike1

Dividing Line


This is the internal link Gyoza User Guide

This is the external link React Chinese documentation

Automatically rendered as a connection https://github.com

Email address [email protected]

Table

NameAgeFruit
Bob27Apple
Alice23Banana
John28Orange

Inline Markdown support

ItalicsBoldCode
italicsboldcode

Form Overflow

ABCDEF
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Phasellus ultricies, sapien non euismod aliquam, dui ligula tincidunt odio, at accumsan nulla sapien eget ex.Proin eleifend dictum ipsum, non euismod ipsum pulvinar et. Vivamus sollicitudin, quam in pulvinar aliquam, metus elit pretium purusProin sit amet velit nec enim imperdiet vehicula.Ut bibendum vestibulum quam, eu egestas turpis gravida necSed scelerisque nec turpis vel viverra. Vivamus vitae pretium sapien

Code Blocks

Syntax

we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntac, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash

html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
  </head>
  <body>
    <p>Test</p>
  </body>
</html>
text
const var text = "hello world"

KaTeX formulas

Use $ symbols to wrap formulas to generate in-line formulas, e.g. E=mc2E = mc^2.

Use $$ symbol-wrapped formulas to generate standalone formulas. Example:

eiπ+1=0e^{i\pi} + 1 = 0

It is also possible to use the code block (```math) approach:

VEdA=Qϵ0\oint_{\partial V} \mathbf{E} \cdot d\mathbf{A} = \frac{Q}{\epsilon_0}

List Types

Ordered List

Syntax

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

Output

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

Unordered List

Syntax

markdown
- List item
- Another item
- And another item

Output

  • List item
  • Another item
  • And another item

Nested list

Syntax

markdown
- Fruit
  - Apple
  - Orange
  - Banana
- Dairy
  - Milk
  - Cheese

Output

  • Fruit
    • Apple
    • Orange
    • Banana
  • Dairy
    • Milk
    • Cheese

Other Elements — abbr, sub, sup, kbd, mark

Syntax

markdown
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.

H<sub>2</sub>O

X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>

Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.

Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.

Output

GIF is a bitmap image format.

H2O

Xn + Yn = Zn

Press CTRL+ALT+Delete to end the session.

Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.

Spoiler

md
||hide content||

Under normal circumstances, this content will be hidden hide content and will only be shown when the mouse is hovered over.

refer to

  1. The above quote is excerpted from Rob Pike's talk during Gopherfest, November 18, 2015.

文章标题:Markdown Examples

文章作者:adityabekti

文章链接:https://adityabekti.net/posts/cek[复制]

最后修改时间:


商业转载请联系站长获得授权,非商业转载请注明本文出处及文章链接,您可以自由地在任何媒体以任何形式复制和分发作品,也可以修改和创作,但是分发衍生作品时必须采用相同的许可协议。
本文采用CC BY-NC-SA 4.0进行许可。