Skip to content

Conversation

@kongdd
Copy link
Contributor

@kongdd kongdd commented Feb 24, 2025

This is pretty cool!
Just little revise, this package also works for typst.

fix for #1487.

@kongdd
Copy link
Contributor Author

kongdd commented Feb 26, 2025

Typst

Those modification enable the following toc in typst:

// = 一级标题
// == 二级标题
== 1.2. 一级标题
== 1.3. 一级标题
== 1.4. 一级标题
== 1.5. 一级标题
== 1.6. 一级标题
== 1.7. 一级标题

This feature is needed, as a large document needs to be separated into small pieces.

Users can disable this feature, by adding a arbitrary character in the front of heading symbol.

// /= 一级标题
// /== 二级标题
== 1. 一级标题
== 2. 一级标题
== 3. 一级标题
== 4. 一级标题
== 5. 一级标题
== 6. 一级标题

Markdown

Markdown can achieve this feature through a dirty script (original version, without modification):

<!-- omit in toc
# 1. 一级标题
## 1.1. 二级标题
-->

## 1.2. 一级标题
## 1.3. 一级标题
## 1.4. 一级标题
## 1.5. 一级标题
## 1.6. 一级标题
## 1.7. 一级标题

@kongdd
Copy link
Contributor Author

kongdd commented Feb 26, 2025

在博士毕业论文,以及书稿中,一般不使用章节编号一般不包括最后一个".",因此做了如上修改。
所有功能已测试完毕,希望能被接受。这是更新后的样式:

// = 一级标题
// == 二级标题
== 1.2 一级标题
=== 1.2.1 一级标题

= 2 一级标题
== 2.1 一级标题
== 2.2 一级标题
== 2.3 一级标题

@yzhang-gh
Copy link
Owner

感谢👍️

不过如你所见,我已经很久没有时间维护这个仓库了,所以想尽量保持现状不新加功能了(除非有严重的问题),抱歉。你其实可以 build 之后离线安装

@kongdd
Copy link
Contributor Author

kongdd commented Feb 26, 2025

好的,感谢回复。如果这样的话,我想fork之后,仅保留toc部分,新建一个vscode-typst,在社区发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants