用途
该技能用于创建和编辑有效的 Obsidian 风格 Markdown。Obsidian 在 CommonMark 和 GFM 基础上扩展了 wikilinks、嵌入、callouts、属性、注释等语法。本技能只覆盖 Obsidian 专有扩展,标准 Markdown(标题、粗体、斜体、列表、引用、代码块、表格)视为已有知识。
主要能力
内部链接(Wikilinks)
[[Note Name]]:链接到笔记[[Note Name|Display Text]]:自定义显示文本[[Note Name#Heading]]:链接到标题[[Note Name#^block-id]]:链接到块[[#Heading in same note]]:同一笔记内的标题链接
块 ID 通过在任意段落末尾追加 ^block-id 定义。对于列表和引用,将块 ID 放在块之后的单独一行。
选择 wikilinks 还是 Markdown 链接时:vault 内的笔记使用 [[wikilinks]](Obsidian 会自动跟踪重命名),外部 URL 仅使用 [text](url)。
嵌入
在任意 wikilink 前加 ! 即可内联嵌入其内容:
![[Note Name]]:嵌入完整笔记![[Note Name#Heading]]:嵌入章节![[image.png]]:嵌入图片![[image.png|300]]:按宽度嵌入图片![[document.pdf#page=3]]:嵌入 PDF 页面
音频、视频、搜索嵌入和外部图片见 EMBEDS.md。
Callouts
> [!note]
> Basic callout.
> [!warning] Custom Title
> Callout with a custom title.
> [!faq]- Collapsed by default
> Foldable callout (- collapsed, + expanded).
常见类型:note、tip、warning、info、example、quote、bug、danger、success、failure、question、abstract、todo。完整列表、别名、嵌套和自定义 CSS callouts 见 CALLOUTS.md。
属性(Frontmatter)
---
title: My Note
date: 2024-01-15
tags:
- project
- active
aliases:
- Alternative Name
cssclasses:
- custom-class
---
默认属性:tags(可搜索标签)、aliases(用于链接建议的替代笔记名)、cssclasses(用于样式的 CSS 类)。所有属性类型、标签语法规则和高级用法见 PROPERTIES.md。
标签
#tag:行内标签#nested/tag:带层级的嵌套标签
标签可包含字母、数字(不能作为首字符)、下划线、连字符和正斜杠。标签也可在 frontmatter 的 tags 属性中定义。
注释
This is visible %%but this is hidden%% text.
%%
This entire block is hidden in reading view.
%%
Obsidian 专有格式
==Highlighted text==:高亮语法
数学(LaTeX)
行内:$e^{i\pi} + 1 = 0$
块级:
$$
\frac{a}{b} = c
$$
图表(Mermaid)
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Do this]
B -->|No| D[Do that]
要将 Mermaid 节点链接到 Obsidian 笔记,添加 class NodeName internal-link;。
脚注
Text with a footnote[^1].[^1]: Footnote content.- 行内脚注:
Inline footnote.^[This is inline.]
使用方式
创建 Obsidian 笔记的工作流:
- 在文件顶部添加带属性的 frontmatter(title、tags、aliases)。所有属性类型见 PROPERTIES.md。
- 使用标准 Markdown 编写结构内容,并配合上述 Obsidian 专有语法。
- 使用 wikilinks(
[[Note]])链接 vault 内的相关笔记,外部 URL 使用标准 Markdown 链接。 - 使用
![[embed]]语法嵌入其他笔记、图片或 PDF 的内容。所有嵌入类型见 EMBEDS.md。 - 使用
> [!type]语法添加 callouts 以突出信息。所有 callout 类型见 CALLOUTS.md。 - 在 Obsidian 的阅读视图中验证笔记渲染正确。
完整示例
---
title: Project Alpha
date: 2024-01-15
tags:
- project
- active
status: in-progress
---
# Project Alpha
This project aims to [[improve workflow]] using modern techniques.
> [!important] Key Deadline
> The first milestone is due on ==January 30th==.
## Tasks
- [x] Initial planning
- [ ] Development phase
- [ ] Backend implementation
- [ ] Frontend design
## Notes
The algorithm uses $O(n \log n)$ sorting. See [[Algorithm Notes#Sorting]] for details.
![[Architecture Diagram.png|600]]
Reviewed in [[Meeting Notes 2024-01-10#Decisions]].
适用场景
适用于在 Obsidian vault 中创建、编辑和维护 .md 文件,尤其是需要使用 wikilinks、嵌入、callouts、属性、标签、注释、高亮、LaTeX 数学、Mermaid 图表和脚注等 Obsidian 专有语法的场景。
限制
本技能只覆盖 Obsidian 专有扩展,标准 Markdown 语法(标题、粗体、斜体、列表、引用、代码块、表格)视为已有知识,不在此展开。关于收费、价格、平台支持等信息暂未提供。