Pelican: Nested list do not work?

Created on 25 Mar 2017  ยท  7Comments  ยท  Source: getpelican/pelican

I tried different ways to write nested lists in my markdown files, but I always get in the output HTML file normal lists instead.

How to write nested lists in Pelican?

Most helpful comment

The same way you do it in markdown, indent with a tab or 4 spaces per level.

- list 1
- list 2
    - list 2.1
        - list 2.1.1
    - list 2.2
    - list 2.3 
- list 3

All 7 comments

The same way you do it in markdown, indent with a tab or 4 spaces per level.

- list 1
- list 2
    - list 2.1
        - list 2.1.1
    - list 2.2
    - list 2.3 
- list 3

I had to add a blank line between the last line of text and the first line of the list to make it work.

GitHub-flavored markdown accepts 2 levels of indentation (which I prefer), so this:

- test
  - nested

turn into this:

  • test

    • nested

Is it possible to force this behavior in pelican?

Pelican relies on the Python-Markdown library for Markdown rendering, so this is actually outside the scope of what Pelican can control.

Actually, to make markdown easier to use, pelican could just configure python-markdown to accept 2 spaces as indentation (this will apply to all indentation, including code; there's also an extension to fix just list's indentation).

To be clear, how markup is rendered is still not directly in Pelican's bailiwick. You are correct that there are ways to control how Python-Markdown behaves, but instead of doing that for all users in Pelican core, that should be configured by individual end users via the MARKDOWN setting (see appropriate entry in the Settings section of the docs for more detail). I think that using a custom Python-Markdown extension is indeed perhaps the best way to achieve the desired result.

To be clear, how markup is rendered is still not directly in Pelican's bailiwick. You are correct that there are ways to control how Python-Markdown behaves, but instead of doing that for all users in Pelican core, that should be configured by individual end users via the MARKDOWN setting (see appropriate entry in the Settings section of the docs for more detail). I think that using a custom Python-Markdown extension is indeed perhaps the best way to achieve the desired result.

Ok, thanks. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

therealmaxmoon picture therealmaxmoon  ยท  8Comments

Moini picture Moini  ยท  6Comments

chenjiandongx picture chenjiandongx  ยท  3Comments

soulchainer picture soulchainer  ยท  7Comments

networkpadawan picture networkpadawan  ยท  3Comments