我已经安装了Nikola (https://getnikola.com/),并创建了一个标记文件,它成功地显示为post。
在我的conf.py中,我的markdown扩展在安装后如下所示。
MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.codehilite', 'markdown.extensions.extra']似乎默认情况下应该包含目录,所以我启用了它
MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.codehilite', 'markdown.extensions.extra','markdown.extensions.toc']然后将文本TOC添加到我的markdown文件中,该文件有几个示例标题
<!--
.. title: Witness the Quickness
.. slug: witness-the-quickness
.. date: 2020-10-26 18:46:36 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
[TOC]
Sample text with some headings below
# Well, Well well
## Duppy guides my hand
### The smiles on their faces在生成的html文件中,它只显示TOC文本。它确实像预期的那样将#Headings转换为html标题,但没有目录。
是否需要更改/启用其他设置才能使其正常工作?
发布于 2020-10-28 03:03:23
[TOC]必须在自己的段落中。添加一个新行,如下所示:
<!--
.. title: Witness the Quickness
.. slug: witness-the-quickness
.. date: 2020-10-26 18:46:36 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
[TOC]
Sample text with some headings below
# Well, Well well
## Duppy guides my hand
### The smiles on their faceshttps://stackoverflow.com/questions/64554646
复制相似问题