Markdown toc extension change `paragraph` ¶ symbol
Asked Answered
L

1

0

In http://pythonhosted.org/Markdown/extensions/toc.html#usage there is option of permalink.

  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?

Example: Now I get this

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

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

Loathsome answered 23/9, 2017 at 20:13 Comment(0)
S
1

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'}
    }
}

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.

Slily answered 24/9, 2017 at 0:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.