logo
Published on

Markdown 常用标记语言

Authors

目录

目录
<TOCInline toc={props.toc} exclude="Overview" toHeading={2} />

<TOCInline toc={props.toc} exclude="Introduction" />

<TOCInline toc={props.toc} asDisclosure />'

资料

文本块

  • 邮件订阅入口
Like what you are reading?
[链接文本](https://www.example.com)
  • 加粗文本
**加粗文本**

__加粗文本__
  • 斜体文本斜体文本 斜体文本
*斜体文本*

_斜体文本_
  • 加删除线加删除线文本
~~加删除线文本~~
  • 脚注:这是一个带有脚注的句子1

  • 引用块

这是一个引用块。

> 这是一个引用块。

CAUTION

> [!CAUTION]
  • 列表
    • 子项目1
    • 子项目2
    • 子项目3
- **列表**
  - 子项目1
  * 子项目2
  + 子项目3
  • 任务

  • 任务1

  • 任务2

  • 表格

表头1表头2
内容1内容2
内容3内容4
  • 标题
# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题

Standard citation [@Nash1950]

References:

[^ref]

Standard citation [@Nash1950]

**References:**

[^ref]

代码块

`内嵌代码`
  • Python
def fib():
    a, b = 0, 1
    while True:            # First iteration:
        yield a            # yield 0 to start with and then
        a, b = b, a + b    # a will now be 1, and b will also be 1, (0 + 1)

for index, fibonacci_number in zip(range(10), fib()):
     print('{i:3}: {f:3}'.format(i=index, f=fibonacci_number))
  • Bash
npm start
# or
npm run dev
  • Javascript
var num1, num2, sum
num1 = prompt('Enter first number')
num2 = prompt('Enter second number')
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert('Sum = ' + sum) // "+" means combine into a string
var num1, num2, sum
num1 = prompt('Enter first number')
num2 = prompt('Enter second number')
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert('Sum = ' + sum) // "+" means combine into a string
analytics: {
    // supports plausible, simpleAnalytics or googleAnalytics
    plausibleDataDomain: '', // e.g. tailwind-nextjs-starter-blog.vercel.app
    simpleAnalytics: false, // true or false
    googleAnalyticsId: '', // e.g. UA-000000-2 or G-XXXXXXX
  },
siteMetadata.js
# 删除和加亮
analytics: {
-   umamiAnalytics: {
-     // We use an env variable for this site to avoid other users cloning our analytics ID
-     umamiWebsiteId: process.env.NEXT_UMAMI_ID, // e.g. 123e4567-e89b-12d3-a456-426614174000
-   },
+    plausibleAnalytics: {
+      plausibleDataDomain: '', // e.g. tailwind-nextjs-starter-blog.vercel.app
+    },
},
  • Javascript XML
// Or import PageTitle from './components/PageTitle.js' if you are using js
import PageTitle from './components/PageTitle.tsx'
;<PageTitle> Using JSX components in MDX </PageTitle>
  • TypeScript
'use client'

import { Doughnut } from 'react-chartjs-2'
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js'

ChartJS.register(ArcElement, Tooltip, Legend)

const DonutChart = ({ data }) => {
  return <Doughnut data={data} />
}

export default Doughnut
contentlayer.config.ts
export const Blog = defineDocumentType(() => ({
  name: 'Blog',
  filePathPattern: 'blog/**/*.mdx',
  contentType: 'mdx',
  fields: {
    title: { type: 'string', required: true },
    date: { type: 'date', required: true },
    tags: { type: 'list', of: { type: 'string' }, default: [] },
    ...
  },
  computedFields: {
    readingTime: { type: 'json', resolve: (doc) => readingTime(doc.body.raw) },
    slug: {
      type: 'string',
      resolve: (doc) => doc._raw.flattenedPath.replace(/^.+?(\/)/, ''),
    }
    ...
  },
}))
  • prism.css file
.code-highlight {
  @apply float-left min-w-full;
}

.code-line {
  @apply -mx-4 block border-l-4 border-opacity-0 pl-4 pr-4;
}

.code-line.inserted {
  @apply bg-green-500 bg-opacity-20;
}

.code-line.deleted {
  @apply bg-red-500 bg-opacity-20;
}

.highlight-line {
  @apply -mx-4 border-l-4 border-primary-500 bg-gray-700 bg-opacity-50;
}

.line-number::before {
  @apply -ml-2 mr-4 inline-block w-4 text-right text-gray-400;
  content: attr(line);
}

内容嵌入块

  • 在线图片嵌入链接 Deploy with Vercel

  • 本地图片(定义大小)

favicon
  • 本地图片(自适应) favicon
  • 本地图片并排

favicon
favicon
favicon
favicon
  • 对话框

  • 本地视频

  • 在线视频

Licence

MIT © Timothy Lin

Footnotes

  1. 这是脚注内容。