我开始使用标记来做笔记。

我用标记来查看我的笔记,它很漂亮。

但是随着我的笔记变长,我发现很难找到我想要的东西。

我知道markdown可以创建表,但它是否能够创建目录,跳转到部分,或定义页面部分markdown?

或者,是否有降价阅读器/编辑器可以做这些事情。搜索也是一个不错的功能。

简而言之,我想让它成为我很棒的笔记工具,功能就像写一本书一样。


当前回答

这里有一个有用的方法。应该在任何MarkDown编辑器中产生可点击的引用。

# Table of contents
1. [Introduction](#introduction)
2. [Some paragraph](#paragraph1)
    1. [Sub paragraph](#subparagraph1)
3. [Another paragraph](#paragraph2)

## This is the introduction <a name="introduction"></a>
Some introduction text, formatted in heading 2 style

## Some paragraph <a name="paragraph1"></a>
The first paragraph text

### Sub paragraph <a name="subparagraph1"></a>
This is a sub paragraph, formatted in heading 3 style

## Another paragraph <a name="paragraph2"></a>
The second paragraph text

生产:

目录

简介 一些段落 子段 另一个段落

这是介绍

一些介绍文本,格式为标题2的风格

一些段落

第一段文字

子段

这是一个子段落,格式为标题3

另一个段落

第二段文字

其他回答

下面是一个生成目录的简单bash脚本。不需要特殊的依赖项,只需要bash。

https://github.com/Lirt/markdown-toc-bash

它可以很好地处理标题内的特殊符号,标记标题中的链接和忽略代码块。

嗯…使用Markdown的标题!?

那就是:

#这相当于< h1 >

这相当于< h2>

这相当于< h3>

许多编辑器会向您展示TOC。您还可以为标题标记提供grep,并创建自己的标题标记。

希望有帮助!

--JF

MultiMarkdown 4.7有一个{{TOC}}宏,用于插入一个目录表。

有两种方法可以在你的降价文档中创建你的TOC(摘要)。

1. 手动

# My Table of content
- [Section 1](#id-section1)
- [Section 2](#id-section2)

<div id='id-section1'/>
## Section 1
<div id='id-section2'/>
## Section 2

2. 以编程方式

例如,你可以使用一个脚本,为你生成摘要,看看我的项目在github - summarizeMD -

我也尝试过其他脚本/npm模块(例如doctoc),但没有人用工作锚重现TOC。

这里有一个有用的方法。应该在任何MarkDown编辑器中产生可点击的引用。

# Table of contents
1. [Introduction](#introduction)
2. [Some paragraph](#paragraph1)
    1. [Sub paragraph](#subparagraph1)
3. [Another paragraph](#paragraph2)

## This is the introduction <a name="introduction"></a>
Some introduction text, formatted in heading 2 style

## Some paragraph <a name="paragraph1"></a>
The first paragraph text

### Sub paragraph <a name="subparagraph1"></a>
This is a sub paragraph, formatted in heading 3 style

## Another paragraph <a name="paragraph2"></a>
The second paragraph text

生产:

目录

简介 一些段落 子段 另一个段落

这是介绍

一些介绍文本,格式为标题2的风格

一些段落

第一段文字

子段

这是一个子段落,格式为标题3

另一个段落

第二段文字