mcpField
O
obsidian-markdown

obsidian-markdown

github.com/davepoon生产力3.7k153 次安装1 天前更新
代码仓库

关于 obsidian-markdown

obsidian-markdown 是一项供 Claude Code 使用的技能,用于创建和编辑符合 Obsidian 语法的 Markdown,涵盖维基链接、嵌入、标注块和 YAML 属性等功能。

主要功能

  1. 01创建和编辑 Obsidian Markdown
  2. 02添加维基链接和块引用
  3. 03嵌入笔记与媒体文件
  4. 04格式化标注块及嵌套标注块
  5. 05管理 YAML 属性和标签
  6. 06使用表格、数学公式和 Mermaid 图表

适用场景

  1. 01在 Obsidian 库中撰写笔记
  2. 02链接到笔记标题或块
  3. 03嵌入图像、音频或 PDF
  4. 04用属性和标签整理笔记

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/davepoon/buildwithclaude --skill obsidian-markdown

安装后在 Claude Code 中输入/obsidian-markdown确认已加载。

详细介绍

Obsidian 风格 Markdown

此技能使 Claude Code 能够创建和编辑有效的 Obsidian 风格 Markdown,包括维基链接、嵌入内容、标注、属性及所有相关语法。

何时使用此技能

  • 在 Obsidian 库中处理 .md 文件
  • 创建带有维基链接或内部链接的笔记
  • 为笔记、图像、音频或 PDF 添加嵌入内容
  • 使用标注(信息框、警告、提示等)
  • 以 YAML 格式管理 frontmatter/属性
  • 使用标签和嵌套标签
  • 创建块引用和块 ID

基本格式

段落和换行

段落之间以空行分隔。段落内的单个换行会被忽略,除非使用:

  • 在行尾添加两个空格
  • 或使用 <br> 显式换行
标题
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
文本样式
**Bold text**
*Italic text*
***Bold and italic***
~~Strikethrough~~
==Highlighted text==

内部链接(维基链接)

基本维基链接
[[Note Name]]
[[Note Name|Display Text]]
[[Folder/Note Name]]
标题链接
[[Note Name#Heading]]
[[Note Name#Heading|Display Text]]
[[#Heading in Current Note]]
块引用
[[Note Name#^block-id]]
[[Note Name#^block-id|Display Text]]
[[#^block-id]]
创建块 ID

在任意段落或列表项末尾添加块 ID:

This is a paragraph you can reference. ^my-block-id

- List item with ID ^list-block

嵌入内容

嵌入笔记
![[Note Name]]
![[Note Name#Heading]]
![[Note Name#^block-id]]
嵌入图像
![[image.png]]
![[image.png|400]]
![[image.png|400x300]]
嵌入音频
![[audio.mp3]]
嵌入 PDF
![[document.pdf]]
![[document.pdf#page=5]]
![[document.pdf#height=400]]
嵌入视频
![[video.mp4]]

标注

基本标注语法
> [!note]
> This is a note callout.

> [!warning]
> This is a warning callout.

> [!tip] Custom Title
> This callout has a custom title.
标注类型
类型别名描述
note默认的蓝色信息框
abstractsummary, tldr摘要
info信息
todo任务/待办事项
tiphint, important实用提示
successcheck, done成功消息
questionhelp, faq问题/常见问题
warningcaution, attention警告消息
failurefail, missing失败消息
dangererror错误/危险
bug错误报告
example示例内容
quotecite引文
可折叠标注
> [!note]+ Expanded by default
> Content visible initially.

> [!note]- Collapsed by default
> Content hidden initially.
嵌套标注
> [!question] Can callouts be nested?
> > [!answer] Yes!
> > Callouts can be nested inside each other.

列表

无序列表
- Item 1
- Item 2
  - Nested item
  - Another nested item
- Item 3
有序列表
1. First item
2. Second item
   1. Nested numbered item
3. Third item
任务列表
- [ ] Uncompleted task
- [x] Completed task
- [ ] Another task

代码块

行内代码
Use `inline code` for short snippets.
围栏代码块
```javascript
function hello() {
  console.log("Hello, world!");
}
```
支持的语言

Obsidian 支持多种语言的语法高亮,包括: javascript、typescript、python、rust、go、java、c、cpp、csharp、ruby、php、html、css、json、yaml、markdown、bash、sql 等。

表格

| Header 1 | Header 2 | Header 3 |
|----------|:--------:|---------:|
| Left     | Center   | Right    |
| aligned  | aligned  | aligned  |

数学公式(LaTeX)

行内数学公式
The equation $E = mc^2$ is famous.
块级数学公式
$$
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

图表(Mermaid)

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

脚注

This is a sentence with a footnote.[^1]

[^1]: This is the footnote content.

注释

%%
This is a comment that won't be rendered.
%%

Inline %%comment%% within text.

属性(Frontmatter)

基本属性
---
title: My Note Title
date: 2024-01-15
tags:
  - tag1
  - tag2
author: John Doe
---
属性类型
类型示例
文本title: My Title
数字rating: 5
复选框completed: true
日期date: 2024-01-15
日期和时间created: 2024-01-15T10:30:00
列表tags: [a, b, c] 或多行格式
链接related: "[[Other Note]]"
多值属性
---
tags:
  - project
  - work
  - important
aliases:
  - My Alias
  - Another Name
cssclasses:
  - wide-page
  - cards
---

标签

行内标签
This note is about #productivity and #tools.
嵌套标签
#project/work
#status/in-progress
#priority/high
Frontmatter 中的标签
---
tags:
  - project
  - project/work
  - status/active
---

HTML 支持

Obsidian 支持部分 HTML:

<div class="my-class">
  Custom HTML content
</div>

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

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

完整示例

---
title: Project Alpha Overview
date: 2024-01-15
tags:
  - project
  - documentation
status: active
---

# Project Alpha Overview

## Summary

This document outlines the key aspects of **Project Alpha**. For related materials, see [[Project Alpha/Resources]] and [[Team Members]].

> [!info] Quick Facts
> - Start Date: January 2024
> - Team Size: 5 members
> - Status: Active

## Key Features

1. [[Feature A]] - Core functionality
2. [[Feature B]] - User interface
3. [[Feature C]] - API integration

### Feature A Details

The main equation governing our approach is $f(x) = ax^2 + bx + c$.

![[feature-a-diagram.png|500]]

> [!tip] Implementation Note
> See [[Technical Specs#^impl-note]] for implementation details.

## Tasks

- [x] Initial planning ^planning-task
- [ ] Development phase
- [ ] Testing phase
- [ ] Deployment

## Code Example

```python
def process_data(input):
    return transform(input)

架构

graph LR
    A[Input] --> B[Process]
    B --> C[Output]

说明

此方法受到==近期研究==1的启发。

%% 待办:添加更多示例 下周与团队一起审阅 %%

#project/alpha #documentation


## References

- [Obsidian Formatting Syntax](https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax)
- [Advanced Formatting](https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax)
- [Internal Links](https://help.obsidian.md/Linking+notes+and+files/Internal+links)
- [Embedding Files](https://help.obsidian.md/Linking+notes+and+files/Embed+files)
- [Callouts](https://help.obsidian.md/Editing+and+formatting/Callouts)
- [Properties](https://help.obsidian.md/Editing+and+formatting/Properties)

Footnotes

  1. Smith, J.(2024)。数据处理的现代方法。 ↩

评论

支持 Markdown