obsidian-markdown

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Obsidian Flavored Markdown Skill

Obsidian风味Markdown使用指南

This skill enables skills-compatible agents to create and edit valid Obsidian Flavored Markdown, including all Obsidian-specific syntax extensions.
本技能支持兼容技能的Agent创建和编辑符合规范的Obsidian风味Markdown,包括所有Obsidian专属的语法扩展。

Overview

概述

Obsidian uses a combination of Markdown flavors:
Obsidian结合了多种Markdown变体:

Basic Formatting

基础格式

Paragraphs and Line Breaks

段落与换行

markdown
This is a paragraph.

This is another paragraph (blank line between creates separate paragraphs).

For a line break within a paragraph, add two spaces at the end  
or use Shift+Enter.
markdown
This is a paragraph.

This is another paragraph (blank line between creates separate paragraphs).

For a line break within a paragraph, add two spaces at the end  
or use Shift+Enter.

Headings

标题

markdown
undefined
markdown
undefined

Heading 1

Heading 1

Heading 2

Heading 2

Heading 3

Heading 3

Heading 4

Heading 4

Heading 5
Heading 5
Heading 6
Heading 6
undefined
undefined

Text Formatting

文本格式

StyleSyntaxExampleOutput
Bold
**text**
or
__text__
**Bold**
Bold
Italic
*text*
or
_text_
*Italic*
Italic
Bold + Italic
***text***
***Both***
Both
Strikethrough
~~text~~
~~Striked~~
Striked
Highlight
==text==
==Highlighted==
==Highlighted==
Inline code
`code`
`code`
code
样式语法示例效果
粗体
**text**
__text__
**Bold**
Bold
斜体
*text*
_text_
*Italic*
Italic
粗斜体
***text***
***Both***
Both
删除线
~~text~~
~~Striked~~
Striked
高亮
==text==
==Highlighted==
==Highlighted==
行内代码
`code`
`code`
code

Escaping Formatting

转义格式符

Use backslash to escape special characters:
markdown
\*This won't be italic\*
\#This won't be a heading
1\. This won't be a list item
Common characters to escape:
\*
,
\_
,
\#
,
\`
,
\|
,
\~
使用反斜杠转义特殊字符:
markdown
\*This won't be italic\*
\#This won't be a heading
1\. This won't be a list item
常见需转义的字符:
\*
,
\_
,
\#
,
\`
,
\|
,
\~

Internal Links (Wikilinks)

内部链接(维基链接)

Basic Links

基础链接

markdown
[[Note Name]]
[[Note Name.md]]
[[Note Name|Display Text]]
markdown
[[Note Name]]
[[Note Name.md]]
[[Note Name|Display Text]]

Link to Headings

链接到标题

markdown
[[Note Name#Heading]]
[[Note Name#Heading|Custom Text]]
[[#Heading in same note]]
[[##Search all headings in vault]]
markdown
[[Note Name#Heading]]
[[Note Name#Heading|Custom Text]]
[[#Heading in same note]]
[[##Search all headings in vault]]

Link to Blocks

链接到块

markdown
[[Note Name#^block-id]]
[[Note Name#^block-id|Custom Text]]
Define a block ID by adding
^block-id
at the end of a paragraph:
markdown
This is a paragraph that can be linked to. ^my-block-id
For lists and quotes, add the block ID on a separate line:
markdown
> This is a quote
> With multiple lines

^quote-id
markdown
[[Note Name#^block-id]]
[[Note Name#^block-id|Custom Text]]
在段落末尾添加
^block-id
来定义块ID:
markdown
This is a paragraph that can be linked to. ^my-block-id
对于列表和引用,在单独一行添加块ID:
markdown
> This is a quote
> With multiple lines

^quote-id

Search Links

搜索链接

markdown
[[##heading]]     Search for headings containing "heading"
[[^^block]]       Search for blocks containing "block"
markdown
[[##heading]]     搜索包含“heading”的标题
[[^^block]]       搜索包含“block”的块

Markdown-Style Links

Markdown风格链接

markdown
[Display Text](Note%20Name.md)
[Display Text](Note%20Name.md#Heading)
[Display Text](https://example.com)
[Note](obsidian://open?vault=VaultName&file=Note.md)
Note: Spaces must be URL-encoded as
%20
in Markdown links.
markdown
[Display Text](Note%20Name.md)
[Display Text](Note%20Name.md#Heading)
[Display Text](https://example.com)
[Note](obsidian://open?vault=VaultName&file=Note.md)
注意:Markdown链接中的空格必须编码为
%20

Embeds

嵌入内容

Embed Notes

嵌入笔记

markdown
![[Note Name]]
![[Note Name#Heading]]
![[Note Name#^block-id]]
markdown
![[Note Name]]
![[Note Name#Heading]]
![[Note Name#^block-id]]

Embed Images

嵌入图片

markdown
![[image.png]]
![[image.png|640x480]]    Width x Height
![[image.png|300]]        Width only (maintains aspect ratio)
markdown
![[image.png]]
![[image.png|640x480]]    宽 x 高
![[image.png|300]]        仅设置宽度(保持宽高比)

External Images

外部图片

markdown
![Alt text](https://example.com/image.png)
![Alt text|300](https://example.com/image.png)
markdown
![Alt text](https://example.com/image.png)
![Alt text|300](https://example.com/image.png)

Embed Audio

嵌入音频

markdown
![[audio.mp3]]
![[audio.ogg]]
markdown
![[audio.mp3]]
![[audio.ogg]]

Embed PDF

嵌入PDF

markdown
![[document.pdf]]
![[document.pdf#page=3]]
![[document.pdf#height=400]]
markdown
![[document.pdf]]
![[document.pdf#page=3]]
![[document.pdf#height=400]]

Embed Lists

嵌入列表

markdown
![[Note#^list-id]]
Where the list has been defined with a block ID:
markdown
- Item 1
- Item 2
- Item 3

^list-id
markdown
![[Note#^list-id]]
列表需先定义块ID:
markdown
- Item 1
- Item 2
- Item 3

^list-id

Embed Search Results

嵌入搜索结果

markdown
```query
tag:#project status:done
```
markdown
```query
tag:#project status:done
```

Callouts

提示框(Callouts)

Basic Callout

基础提示框

markdown
> [!note]
> This is a note callout.

> [!info] Custom Title
> This callout has a custom title.

> [!tip] Title Only
markdown
> [!note]
> This is a note callout.

> [!info] Custom Title
> This callout has a custom title.

> [!tip] Title Only

Foldable Callouts

可折叠提示框

markdown
> [!faq]- Collapsed by default
> This content is hidden until expanded.

> [!faq]+ Expanded by default
> This content is visible but can be collapsed.
markdown
> [!faq]- Collapsed by default
> This content is hidden until expanded.

> [!faq]+ Expanded by default
> This content is visible but can be collapsed.

Nested Callouts

嵌套提示框

markdown
> [!question] Outer callout
> > [!note] Inner callout
> > Nested content
markdown
> [!question] Outer callout
> > [!note] Inner callout
> > Nested content

Supported Callout Types

支持的提示框类型

TypeAliasesDescription
note
-Blue, pencil icon
abstract
summary
,
tldr
Teal, clipboard icon
info
-Blue, info icon
todo
-Blue, checkbox icon
tip
hint
,
important
Cyan, flame icon
success
check
,
done
Green, checkmark icon
question
help
,
faq
Yellow, question mark
warning
caution
,
attention
Orange, warning icon
failure
fail
,
missing
Red, X icon
danger
error
Red, zap icon
bug
-Red, bug icon
example
-Purple, list icon
quote
cite
Gray, quote icon
类型别名描述
note
-蓝色,铅笔图标
abstract
summary
,
tldr
蓝绿色,剪贴板图标
info
-蓝色,信息图标
todo
-蓝色,复选框图标
tip
hint
,
important
青色,火焰图标
success
check
,
done
绿色,对勾图标
question
help
,
faq
黄色,问号图标
warning
caution
,
attention
橙色,警告图标
failure
fail
,
missing
红色,叉号图标
danger
error
红色,闪电图标
bug
-红色,Bug图标
example
-紫色,列表图标
quote
cite
灰色,引用图标

Custom Callouts (CSS)

自定义提示框(CSS)

css
.callout[data-callout="custom-type"] {
  --callout-color: 255, 0, 0;
  --callout-icon: lucide-alert-circle;
}
css
.callout[data-callout="custom-type"] {
  --callout-color: 255, 0, 0;
  --callout-icon: lucide-alert-circle;
}

Lists

列表

Unordered Lists

无序列表

markdown
- Item 1
- Item 2
  - Nested item
  - Another nested
- Item 3

* Also works with asterisks
+ Or plus signs
markdown
- Item 1
- Item 2
  - Nested item
  - Another nested
- Item 3

* Also works with asterisks
+ Or plus signs

Ordered Lists

有序列表

markdown
1. First item
2. Second item
   1. Nested numbered
   2. Another nested
3. Third item

1) Alternative syntax
2) With parentheses
markdown
1. First item
2. Second item
   1. Nested numbered
   2. Another nested
3. Third item

1) Alternative syntax
2) With parentheses

Task Lists

任务列表

markdown
- [ ] Incomplete task
- [x] Completed task
- [ ] Task with sub-tasks
  - [ ] Subtask 1
  - [x] Subtask 2
markdown
- [ ] Incomplete task
- [x] Completed task
- [ ] Task with sub-tasks
  - [ ] Subtask 1
  - [x] Subtask 2

Quotes

引用

markdown
> This is a blockquote.
> It can span multiple lines.
>
> And include multiple paragraphs.
>
> > Nested quotes work too.
markdown
> This is a blockquote.
> It can span multiple lines.
>
> And include multiple paragraphs.
>
> > Nested quotes work too.

Code

代码

Inline Code

行内代码

markdown
Use `backticks` for inline code.
Use double backticks for ``code with a ` backtick inside``.
markdown
Use `backticks` for inline code.
Use double backticks for ``code with a ` backtick inside``.

Code Blocks

代码块

markdown
```
Plain code block
```

```javascript
// Syntax highlighted code block
function hello() {
  console.log("Hello, world!");
}
```

```python
markdown
```
Plain code block
```

```javascript
// Syntax highlighted code block
function hello() {
  console.log("Hello, world!");
}
```

```python

Python example

Python example

def greet(name): print(f"Hello, {name}!")
undefined
def greet(name): print(f"Hello, {name}!")
undefined

Nesting Code Blocks

嵌套代码块

Use more backticks or tildes for the outer block:
markdown
````markdown
Here's how to create a code block:
```js
console.log("Hello")
```
````
使用更多反引号或波浪线作为外层分隔符:
markdown
````markdown
Here's how to create a code block:
```js
console.log("Hello")
```
````

Tables

表格

markdown
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |
markdown
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

Alignment

对齐方式

markdown
| Left     | Center   | Right    |
|:---------|:--------:|---------:|
| Left     | Center   | Right    |
markdown
| Left     | Center   | Right    |
|:---------|:--------:|---------:|
| Left     | Center   | Right    |

Using Pipes in Tables

在表格中使用竖线

Escape pipes with backslash:
markdown
| Column 1 | Column 2 |
|----------|----------|
| [[Link\|Display]] | ![[Image\|100]] |
使用反斜杠转义竖线:
markdown
| Column 1 | Column 2 |
|----------|----------|
| [[Link\|Display]] | ![[Image\|100]] |

Math (LaTeX)

数学公式(LaTeX)

Inline Math

行内数学公式

markdown
This is inline math: $e^{i\pi} + 1 = 0$
markdown
This is inline math: $e^{i\pi} + 1 = 0$

Block Math

块级数学公式

markdown
$$
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix} = ad - bc
$$
markdown
$$
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix} = ad - bc
$$

Common Math Syntax

常用数学公式语法

markdown
$x^2$              Superscript
$x_i$              Subscript
$\frac{a}{b}$      Fraction
$\sqrt{x}$         Square root
$\sum_{i=1}^{n}$   Summation
$\int_a^b$         Integral
$\alpha, \beta$    Greek letters
markdown
$x^2$              上标
$x_i$              下标
$\frac{a}{b}$      分数
$\sqrt{x}$         平方根
$\sum_{i=1}^{n}$   求和
$\int_a^b$         积分
$\alpha, \beta$    希腊字母

Diagrams (Mermaid)

图表(Mermaid)

markdown
```mermaid
graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Do this]
    B -->|No| D[Do that]
    C --> E[End]
    D --> E
```
markdown
```mermaid
graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Do this]
    B -->|No| D[Do that]
    C --> E[End]
    D --> E
```

Sequence Diagrams

序列图

markdown
```mermaid
sequenceDiagram
    Alice->>Bob: Hello Bob
    Bob-->>Alice: Hi Alice
```
markdown
```mermaid
sequenceDiagram
    Alice->>Bob: Hello Bob
    Bob-->>Alice: Hi Alice
```

Linking in Diagrams

图表中的链接

markdown
```mermaid
graph TD
    A[Biology]
    B[Chemistry]
    A --> B
    class A,B internal-link;
```
markdown
```mermaid
graph TD
    A[Biology]
    B[Chemistry]
    A --> B
    class A,B internal-link;
```

Footnotes

脚注

markdown
This sentence has a footnote[^1].

[^1]: This is the footnote content.

You can also use named footnotes[^note].

[^note]: Named footnotes still appear as numbers.

Inline footnotes are also supported.^[This is an inline footnote.]
markdown
This sentence has a footnote[^1].

[^1]: This is the footnote content.

You can also use named footnotes[^note].

[^note]: Named footnotes still appear as numbers.

Inline footnotes are also supported.^[This is an inline footnote.]

Comments

注释

markdown
This is visible %%but this is hidden%% text.

%%
This entire block is hidden.
It won't appear in reading view.
%%
markdown
This is visible %%but this is hidden%% text.

%%
This entire block is hidden.
It won't appear in reading view.
%%

Horizontal Rules

水平线

markdown
---
***
___
- - -
* * *
markdown
---
***
___
- - -
* * *

Properties (Frontmatter)

属性(前置元数据)

Properties use YAML frontmatter at the start of a note:
yaml
---
title: My Note Title
date: 2024-01-15
tags:
  - project
  - important
aliases:
  - My Note
  - Alternative Name
cssclasses:
  - custom-class
status: in-progress
rating: 4.5
completed: false
due: 2024-02-01T14:30:00
---
属性使用YAML前置元数据,位于笔记开头:
yaml
---
title: My Note Title
date: 2024-01-15
tags:
  - project
  - important
aliases:
  - My Note
  - Alternative Name
cssclasses:
  - custom-class
status: in-progress
rating: 4.5
completed: false
due: 2024-02-01T14:30:00
---

Property Types

属性类型

TypeExample
Text
title: My Title
Number
rating: 4.5
Checkbox
completed: true
Date
date: 2024-01-15
Date & Time
due: 2024-01-15T14:30:00
List
tags: [one, two]
or YAML list
Links
related: "[[Other Note]]"
类型示例
文本
title: My Title
数字
rating: 4.5
复选框
completed: true
日期
date: 2024-01-15
日期时间
due: 2024-01-15T14:30:00
列表
tags: [one, two]
或YAML列表
链接
related: "[[Other Note]]"

Default Properties

默认属性

  • tags
    - Note tags
  • aliases
    - Alternative names for the note
  • cssclasses
    - CSS classes applied to the note
  • tags
    - 笔记标签
  • aliases
    - 笔记的别名
  • cssclasses
    - 应用于笔记的CSS类

Tags

标签

markdown
#tag
#nested/tag
#tag-with-dashes
#tag_with_underscores

In frontmatter:
---
tags:
  - tag1
  - nested/tag2
---
Tags can contain:
  • Letters (any language)
  • Numbers (not as first character)
  • Underscores
    _
  • Hyphens
    -
  • Forward slashes
    /
    (for nesting)
markdown
#tag
#nested/tag
#tag-with-dashes
#tag_with_underscores

In frontmatter:
---
tags:
  - tag1
  - nested/tag2
---
标签可包含:
  • 字母(任意语言)
  • 数字(不能作为首字符)
  • 下划线
    _
  • 连字符
    -
  • 斜杠
    /
    (用于嵌套)

HTML Content

HTML内容

Obsidian supports HTML within Markdown:
markdown
<div class="custom-container">
  <span style="color: red;">Colored text</span>
</div>

<details>
  <summary>Click to expand</summary>
  Hidden content here.
</details>

<kbd>Ctrl</kbd> + <kbd>C</kbd>
Obsidian支持在Markdown中嵌入HTML:
markdown
<div class="custom-container">
  <span style="color: red;">Colored text</span>
</div>

<details>
  <summary>Click to expand</summary>
  Hidden content here.
</details>

<kbd>Ctrl</kbd> + <kbd>C</kbd>

Complete Example

完整示例

markdown
---
title: Project Alpha
date: 2024-01-15
tags:
  - project
  - active
status: in-progress
priority: high
---
markdown
---
title: Project Alpha
date: 2024-01-15
tags:
  - project
  - active
status: in-progress
priority: high
---

Project Alpha

Project Alpha

Overview

概述

This project aims to [[improve workflow]] using modern techniques.
[!important] Key Deadline The first milestone is due on ==January 30th==.
本项目旨在使用现代技术[[提升工作流]]。
[!important] 关键截止日期 第一个里程碑截止日期为 ==1月30日==。

Tasks

任务

  • Initial planning
  • Resource allocation
  • Development phase
    • Backend implementation
    • Frontend design
  • Testing
  • Deployment
  • 初始规划
  • 资源分配
  • 开发阶段
    • 后端实现
    • 前端设计
  • 测试
  • 部署

Technical Notes

技术说明

The main algorithm uses the formula $O(n \log n)$ for sorting.
python
def process_data(items):
    return sorted(items, key=lambda x: x.priority)
核心算法使用 $O(n \log n)$ 排序公式。
python
def process_data(items):
    return sorted(items, key=lambda x: x.priority)

Architecture

架构

mermaid
graph LR
    A[Input] --> B[Process]
    B --> C[Output]
    B --> D[Cache]
mermaid
graph LR
    A[输入] --> B[处理]
    B --> C[输出]
    B --> D[缓存]

Related Documents

相关文档

  • ![[Meeting Notes 2024-01-10#Decisions]]
  • [[Budget Allocation|Budget]]
  • [[Team Members]]
  • ![[2024-01-10会议记录#决策]]
  • [[预算分配|预算]]
  • [[团队成员]]

References

参考资料

For more details, see the official documentation1.
%% Internal notes:
  • Review with team on Friday
  • Consider alternative approaches %%
undefined

Footnotes

更多详情请参阅官方文档1
%% 内部笔记:
  • 周五与团队评审
  • 考虑替代方案 %%
undefined

Footnotes

References

参考资料