New Feature
Now you can use a template string to customize output text of your headings.
For template {bullet} {num-nest[.]} [{title}]({path})
, you can get heading text like - 1.2 [heading title](#heading%20title)
. So you can generate a TOC of your note.
Usage steps:
- Edit you template string in setting panel
- Open a note
- Run command "Copy Current Headings As Text"
- Paste text from clipboard to your note.
Syntax
title
: content of your heading, likeheading
path
: like#heading
, used to generate link to this headingnum
: like1
、2
num-nest[-]
: like1-2-3
bullet
: just-
, used to generate list
Limit
Obsidian will replace spaces in heading to %20
, however, github replaces space to -
instead. So maybe generated TOC can not be used directly.
eg. For Heading Content
:
- obsidian:
#Heading%20Content
- github:
#heading-content
You can find discussions here:
新功能
现在你可以通过模板来自定义导出的标题格式
比如{bullet} {num-nest[.]} [{title}]({path})
, 可以得到 - 1.2 [heading title](#heading%20title)
. 所以可以通过这个来生成 TOC
使用步骤
- 在设置面板中编辑模板字符串
- 打开一个笔记
- 运行命令“Copy Current Headings As Text”
- 内容被写到了剪贴板,手动粘贴到笔记中
模板语法
title
: 标题的内容heading
path
: 在内容前面加一个#
, 比如#heading
, 用来生成对标题的链接num
: 编号1
、2
num-nest[-]
: 嵌套的编号1-2-3
bullet
: 仅仅是一个-
, 用来生成列表
限制
Obsidian 会把标题中的空格替换成 %20
,而 github 则是替换成 -
。所以可能生成的TOC没办法直接在github之类的地方使用
比如对于标题 Heading Content
- obsidian:
#Heading%20Content
- github:
#heading-content
对于这个问题,论坛里面有讨论: