Markdown toc 扩展更改 `paragraph` ¶ 符号 [英] Markdown toc extension change `paragraph` ¶ symbol

查看:86
本文介绍了Markdown toc 扩展更改 `paragraph` ¶ 符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://pythonhosted.org/Markdown/extensions/toc.html#用法,其中有永久链接的选项.

  1. 我想将& para 的默认符号更改为其他一些ASCII字符.怎么做?
  2. 要更改符号与标题之间的距离吗?
  1. I want to change the default symbol of &para to some other ASCII char. How to do it?
  2. Change the distance of the symbol form the header?

示例:现在我明白了

<h3 id="title1">title1<a title="Permanent link" href="#title1" class="headerlink">¶</a></h3>

但是我想将¶符号更改为其他ASCII并更改其与标头的距离.

But I want to change the ¶ symbol to other ASCII and change its distance from header.

推荐答案

您可以使用 MARKDOWN

You can use the MARKDOWN config setting to pass config options to Markdown, including extensions. In your pelicanconf.py file, include the following:

MARKDOWN = {
    'extension_configs': {
        'markdown.extensions.toc': {'permalink': 'your replacement string here'}
    }
}

样式更改将通过 CSS 完成.您可能需要修改主题以包括一些CSS,以便为 headerlink 类的任何元素添加填充.例如,要在永久链接的左侧添加空间 1em ,请包含以下规则:

Stylistic changes would be done through CSS. You will likely need to modify the theme to include some CSS to add some padding to any element with the headerlink class. For example, to add 1em of space to the left of the permalink, include the following rule:

.headerlink {
    padding-left: 1em;
}

有关鹈鹕主题的更多信息,请参见文档.

For more information about Pelican themes, see the documentation.

这篇关于Markdown toc 扩展更改 `paragraph` ¶ 符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆