1. 特殊代码块#
1.1. 代码高亮#
// 这是一个简单的函数,用于计算斐波那契数列function fibonacci(n) { if (n <= 1) { return n; } return fibonacci(n - 1) + fibonacci(n - 2);}脚本类语言(例如 bat , bash , powershell )和文本默认不带行号:
#!/usr/bin/env bash
echo "Start build..."pnpm installpnpm buildecho "Done."1.2. 行号标记#
- 指定行号标记变更 diff
function demo() { console.log('this line is marked as deleted') // This line and the next one are marked as inserted console.log('this is the second inserted line')
return 'this line uses the neutral default marker type'}- 为变更行加上标签
<button role="button" {...props} value={value} className={buttonClassName} disabled={disabled} active={active}> {children && !active && (typeof children === 'string' ? <span>{children}</span> : children)}</button>- 使用行前 +/- 标记变更 diff
function demo() { console.log('this line is marked as deleted') // This line and the next one are marked as inserted console.log('this is the second inserted line')
return 'this line uses the neutral default marker type'}--- a/README.md+++ b/README.md@@ -1,3 +1,4 @@+this is an actual diff file-all contents will remain unmodified no whitespace will be removed either1.3. 高亮标记代码块内文本#
function demo() { // Mark any given text inside lines return 'Multiple matches of the given text are supported';}2. 图片配置#
2.1. 图片加标题#

2.2. 图片大小配置#
-
正常大小

正常大小 -
图片缩小

图片缩小
2.3. 图片并排显示#


2.4. 图片代码并排显示#

src/ content/ blog/ mobile-nav-and-subposts/ index.mdx mobile-navigation.mdx subposts.mdx3. 标注卡片#
3.1. 常用标注卡片#
| 标注名称 | 说明 |
|---|---|
| Note | 用于标注一般信息或备注 |
| Tip | 用于标注提示信息或技巧 |
| Warning | 用于标注警告信息或注意事项 |
| Danger | 用于标注危险信息或警告 |
| Important | 用于标注重要信息或警告信息 |
3.2. 与其他组件组合使用#
Note (高级React开发教程)
这是一个高级的 React 开发教程,假设你已经熟悉 React 的 hooks 和组件生命周期。如果你需要复习,检查官方 React 文档。
Tip (提高开发效率)
你可以通过按下 Ctrl + Alt + F (Windows/Linux) or Cmd + Option + F (Mac) 快速格式化代码。
其他快捷键:
| 操作 | Windows/Linux | Mac |
|---|---|---|
| 搜索 | Ctrl + F | Cmd + F |
| 替换 | Ctrl + H | Cmd + H |
| 保存所有 | Ctrl + Alt + S | Cmd + Option + S |
Warning (浏览器兼容性问题)
该 API 不支持 Internet Explorer ,且在旧浏览器中支持有限。
if (!Object.fromEntries) { Object.fromEntries = function(entries) { const obj = {}; for (const [key, value] of entries) { obj[key] = value; } return obj; };}查看浏览器兼容性表格以获取详细信息。
Danger (数据丢失风险)
运行此命令将永久删除当前目录中的所有文件。请确保在继续之前备份重要数据。
# 这将删除当前目录中的所有文件,请确保在继续之前备份重要数据rm -rf ./*# 安全的替代方案,需要确认rm -ri ./*操作无法撤销,恢复工具可能无法恢复数据。
Important (版本2.0的主要API变化)
版本 2.0 引入了显著的 API 变化。你需要更新你的代码以使用新的参数结构。
- 现在
configure()方法返回 Promise 对象 - 认证需要 API 密钥对象而不是字符串
- 事件处理程序使用新的回调模式
一个迁移示例如下:
app.configure("api-key-string");await app.configure({ key: "api-key-string", version: "2.0" });
app.on('event', callback);app.on('event', { handler: callback, options: { once: true } });Definition (连续函数)
函数 是连续的,如果对于每个开集 ,其前像 是 的开集。
Explanation (等价表述)
使得 。
Theorem (大数定律)
设 是独立同分布的随机变量序列,其数学期望为 . 对于任意 :
Proof (证明)
我们将使用切比雪夫不等式证明证明。设 和 .:
由于随机变量是独立的,我们有 :
代入不等式,我们有 :
当 时,右端近于 0 ,证明了定理。
Lemma (单调收敛定理)
设 是一个非负可测函数序列,满足 对于所有 和几乎所有 . 定义 . 则 :
Proof (证明)
设 ,其中 。
注意到 对于所有 ,所以 . 取极限 :
组合这些不等式,我们有 :
因此, 。
Exercise (计算函数的导数)
计算 的导数。
Answer
Problem (算术平均数的收敛性)
设 收敛到 ,则 也收敛到 。
Solution (证明)
设 ,存在 ,使得对所有 ,有 。
设 。
对所有 ,我们有 :
设 . 则有 :
当 , 和 . 对足够大的 ,我们有 :
因此, 收敛到 。
最近更新: