GitHub
特性支持(部分特性暂未开源):
- 版本管理:依托Git在多机器上管理笔记。
- 自动分类和标签:以知识图谱风格组织笔记。
- 笔记模块化:多文件组织树形笔记,支持交叉索引。如果其他人也使用 typst 写笔记,支持引用他们的笔记。
- 文学编程:支持自动执行笔记代码块中的代码块并显示结果。
- 笔记图谱可视化:站内标签云和关系图。
- 悬浮预览:站内链接页面预览。
- 编辑器支持:快速查找、定位和编辑笔记内容。
- 笔记切面:支持以不同的切面阅读笔记(笔记的组织方式)。
- 笔记索引:供其他人引用你的笔记。也可将索引的分类、标签和摘要文件加入LLM上下文,询问笔记中的知识或疑惑。
只要支持editor插件和lsp扩展的编辑器,都可以用来写笔记。
辅助工具(暂未开源):
- LSP自带功能:
#remige, #remige#remige, #remige自动补全引用
- 补全特殊风格前缀:
x:yx:y
- 补全子文件,LSP自动补全
#remige($1, include $2)#remige($1, include $2)
总的来说,按照树形结构组织笔记。允许使用不同的切面重新阅读整个笔记,例如,X话题既属于A也属于B,有两种组织方式:
- X话题单独分开成为一个文件:
- X话题主要属于A,并不单独成文:
此时x-topicx-topic会自动附带标签:
The `x-topic` belongs to (or, is tagged by) `A` and `B`.
The `x-topic` belongs to (or, is tagged by) `A` and `B`.
The `x-topic` belongs to (or, is tagged by) `A` and `B`.
The `x-topic` belongs to (or, is tagged by) `A` and `B`.
使用.gitignore.gitignore配置私有笔记:
.gitignore // specify the private notes
.gitignore // specify the private notes
.gitignore // specify the private notes
.gitignore // specify the private notes
提示:参考「branch-specific gitignore」以使用git VCS托管私有笔记。
Typst脚本只有一个核心概念:remigeremige,用于组织笔记内容之间的关系。
#let remige(to: auto, body: content | label) = todo();
#let remige(to: auto, body: content | label) = todo();
#let remige(to: auto, body: content | label) = todo();
#let remige(to: auto, body: content | label) = todo();
- default to is previous heading.
使用以下方式嵌入子笔记:
#include "path/to/note.typ"
#include "path/to/note.typ"
#include "path/to/note.typ"
#include "path/to/note.typ"
使用以下方式保证子笔记的嵌套级别和<my-topic><my-topic>的一致:
#include "path/to/note.typ"
#remige(to: auto, include "path/to/note.typ")
#remige(to: <my-topic>)[#include "path/to/note.typ"]
#include "path/to/note.typ"
#remige(to: auto, include "path/to/note.typ")
#remige(to: <my-topic>)[#include "path/to/note.typ"]
#include "path/to/note.typ"
#remige(to: auto, include "path/to/note.typ")
#remige(to: <my-topic>)[#include "path/to/note.typ"]
#include "path/to/note.typ"
#remige(to: auto, include "path/to/note.typ")
#remige(to: <my-topic>)[#include "path/to/note.typ"]
使用以下方式嵌入笔记到根话题:
#remige(to: none, include "path/to/note.typ")
#remige(to: none, include "path/to/note.typ")
#remige(to: none, include "path/to/note.typ")
#remige(to: none, include "path/to/note.typ")
默认所有嵌入都是尽可能是强嵌入。当嵌入关系成环时,会自动转换为弱嵌入。
- 话题在不同文件夹,子文件夹里对父文件话题或其他文件夹的remige为弱嵌入。
- 同一个文件夹内的remige,嵌套层级更深的remige为弱嵌入。
- 同一嵌套层级的remige,话题第二次出现时为弱嵌入。
把话题视为图的结点。强嵌入的边被称为分类,弱嵌入的边被称为标签。
当本笔记作为页面构建时,可以使用regexregex配置所有的remige为强嵌入。
#configure-remige-embedding(
#configure-remige-embedding(
#configure-remige-embedding(
#configure-remige-embedding(
将来typst支持自定义元素后将变为如下语法:
#show: set remige(embedding: true)
#show: set remige(embedding: true)
#show: set remige(embedding: true)
#show: set remige(embedding: true)
复杂配置:
#configure-remige-embedding(
(path: "path/to/note.typ", label: regex(".*"), strong: true),
#configure-remige-embedding(
(path: "path/to/note.typ", label: regex(".*"), strong: true),
#configure-remige-embedding(
(path: "path/to/note.typ", label: regex(".*"), strong: true),
#configure-remige-embedding(
(path: "path/to/note.typ", label: regex(".*"), strong: true),
全局配置:
在astro.config.mjsastro.config.mjs中可以配置全局配置:
export default defineConfig({
remige: { embedding: false || true },
export default defineConfig({
{ in: "some-topic.typ", path: "path/to/note.typ", label: /.*/, strong: true },
export default defineConfig({
remige: { embedding: false || true },
export default defineConfig({
{ in: "some-topic.typ", path: "path/to/note.typ", label: /.*/, strong: true },
export default defineConfig({
remige: { embedding: false || true },
export default defineConfig({
{ in: "some-topic.typ", path: "path/to/note.typ", label: /.*/, strong: true },
export default defineConfig({
remige: { embedding: false || true },
export default defineConfig({
{ in: "some-topic.typ", path: "path/to/note.typ", label: /.*/, strong: true },
条件样式控制remige的显示方式。以下配置表示,当话题属于A时,remige会默认显示。反之,remige会以其他样式显示,默认不显示:
#remige-if(belongs-to: <a-topic>)[
When the X topic is about A, we observe that X has some special feature.
#remige-if(belongs-to: <a-topic>)[
When the X topic is about A, we observe that X has some special feature.
#remige-if(belongs-to: <a-topic>)[
When the X topic is about A, we observe that X has some special feature.
#remige-if(belongs-to: <a-topic>)[
When the X topic is about A, we observe that X has some special feature.
默认不显示:
#remige-if(else: (display: none), body)
#remige-if(else: (display: none), body)
#remige-if(else: (display: none), body)
#remige-if(else: (display: none), body)
显示为旁注:
#remige-if(else: (class: "footnote"), body)
#remige-if(else: (class: "footnote"), body)
#remige-if(else: (class: "footnote"), body)
#remige-if(else: (class: "footnote"), body)
优化:当displaydisplay设置为nonenone时,等价于:
#context if check-condition(belongs-to: <a-topic>) { body }
#context if check-condition(belongs-to: <a-topic>) { body }
#context if check-condition(belongs-to: <a-topic>) { body }
#context if check-condition(belongs-to: <a-topic>) { body }
此时在编译<b-topic><b-topic>为页面时,body不会在构建产物中。
- 主页面(Index Page):
content/index.typcontent/index.typ。
- 枝干页面(Stem Pages):
content/notescontent/notes中的每个文件都被构建成一个页面,且其他话题都按以上方式决定强弱嵌入。
- 叶子页面(Leaf Pages):每个话题会构建一个独立的页面,且其他话题都为弱嵌入。
JavaScript脚本可访问到站内的笔记图谱信息。
typst会自动生成交叉引用表,你可以使用引用语法引用站内其他话题,且语言服务器能帮助你正常补全此类语法。
@painting:philosophy[绘画哲学]
@painting:philosophy[绘画哲学]
@painting:philosophy[绘画哲学]
@painting:philosophy[绘画哲学]
typst默认支持bibliography引用,除此之外,还可以导入并引用其他笔记网站的索引。