Skip to content

Python Markdown

Zensical supports a large number of Python Markdown extensions, which is part of what makes it so attractive for technical writing. Following is a list of all supported extensions, linking to the relevant sections of the authoring guide for which features they need to be enabled.

Defaults

Zensical has sensible defaults for the Markdown extensions settings. Make sure to check these out before you begin to configure things manually.

Supported extensions

Abbreviations

The Abbreviations extension adds the ability to add a small tooltip to an element, by wrapping it with an abbr tag. Only plain text (no markup) is supported. Enable it via:

[project.markdown_extensions.abbr]
markdown_extensions:
  - abbr

No configuration options are available. See the following authoring guides for usage:

Admonition

The Admonition extension adds support for admonitions, more commonly known as call-outs, which can be defined in Markdown by using a simple syntax. Enable it via:

[project.markdown_extensions.admonition]
markdown_extensions:
  - admonition

No configuration options are available. See the following authoring guides for usage:

Attribute Lists

The Attribute Lists extension allows to add HTML attributes and CSS classes to almost every Markdown inline- and block-level element with a special syntax. Enable it via:

[project.markdown_extensions.abbr]
markdown_extensions:
  - attr_list

No configuration options are available. See the following authoring guides for usage:

Definition Lists

The [Definition Lists] extension adds the ability to add definition lists (more commonly known as description listsdl in HTML) via Markdown to a document. Enable it via:

[project.markdown_extensions.def_list]
markdown_extensions:
  - def_list

No configuration options are available. See the following authoring guides for usage:

Footnotes

The Footnotes extension allows to define inline footnotes, which are then rendered below all Markdown content of a document. Enable it via:

[project.markdown_extensions.footnotes]
markdown_extensions:
  - footnotes

No configuration options are supported. See the following authoring guides for usage:

Markdown in HTML

The Markdown in HTML extension allows for writing Markdown inside of HTML, which is useful for wrapping Markdown content with custom elements. Enable it via:

[project.markdown_extensions.md_in_html]
markdown_extensions:
  - md_in_html

By default, Markdown ignores any content within a raw HTML block-level element. With the md_in_html extension enabled, the content of a raw HTML block-level element can be parsed as Markdown by including a markdown attribute on the opening tag. The markdown attribute will be stripped from the output, while all other attributes will be preserved.

No configuration options are available. See these examples for how md_in_html can be used:

Table of Contents

The Table of Contents extension automatically generates a table of contents from a document, which Zensical will render as part of the resulting page. Enable it via:

[project.markdown_extensions.toc]
permalink =  true
markdown_extensions:
  - toc:
      permalink: true

The following configuration options are supported:

toc.title

This option sets the title of the table of contents in the right navigation sidebar, which is normally automatically sourced from the translations for the site language. Set the title explicitly via::

[project.markdown_extensions.toc]
title = "On this page"
markdown_extensions:
  - toc:
      title: On this page

This option adds an anchor link containing the paragraph symbol or another custom symbol at the end of each headline, exactly like on the page you're currently viewing. The symbol is hidden by default to keep the page free from clutter but Zensical will make it appear on hover.

If you do not like the default symbol , you can configure another symbol or string like so:

[project.markdown_extensions.toc]
permalink = "⚓︎"
markdown_extensions:
  - toc:
      permalink: ⚓︎

This option sets the title of the anchor link which is shown on hover and read by screen readers. For accessibility reasons, it might be beneficial to change it to a more discernable name, stating that the anchor links to the section itself:

[project.markdown_extensions.toc]
permalink_title = "Anchor link to this section"
markdown_extensions:
  - toc:
      permalink_title: Anchor link to this section

toc.slugify

This option allows for customization of the slug function. For some languages, the default may not produce good and readable identifiers – consider using another slug function like for example those from Python Markdown Extensions:

[project.markdown_extensions.toc.slugify]
function = "pymdownx.slugs.slugify"
kwds = {case: "lower"}
markdown_extensions:
  - toc:
      slugify: !!python/object/apply:pymdownx.slugs.slugify
        kwds:
          case: lower

toc.toc_depth

Define the range of levels to be included in the table of contents (default: 6). This may be useful for project documentation with deeply structured headings to decrease the length of the table of contents:

[project.markdown_extensions.toc]
toc_depth = 3
markdown_extensions:
  - toc:
      toc_depth: 3

To remove the table of contents altogether:

[project.markdown_extensions.toc]
toc_depth = 0
markdown_extensions:
  - toc:
      toc_depth: 0

Other options

The other configuration options of this extension are not officially supported by Zensical, which is why they may yield unexpected results. Use them at your own risk.

Tables

The Tables extension adds the ability to create tables in Markdown by using a simple syntax. Enable it via:

[project.markdown_extensions.tables]
markdown_extensions:
  - tables

No configuration options are available. See the following authoring guides for usage: