Skip to main content

Extension for Python-Markdown that makes lists truly sane. Custom indents for nested lists and fix for messy linebreaks.

Project description

Build Status

An extension for Python-Markdown that makes lists truly sane. Features custom indents for nested lists and fix for messy linebreaks and paragraphs between lists.

Features

  • nested_indent option: Custom indent for nested lists. Defaults to 2. Doesn’t mess with code indents, which is still 4.

  • truly_sane option: Makes linebreaks and paragraphs in lists behave as usually expected by user. No longer adds weird p, no extra linebreaks, no longer fuses lists together when they shouldn’t be fused (see screenshots and examples below). Defaults to True.

  • Inherits sane lists behavior, which doesn’t allow the mixing of ordered and unordered lists.

Installation

Pypi: ‘’

pip3 install mdx_truly_sane_lists

Directly from git:

pip3 install git+git://github.com/radude/mdx_truly_sane_lists

Usage

Basic:

from markdown import markdown

# Default config is truly_sane: True, nested_indent: 2
markdown(text='some text', extensions=['mdx_truly_sane_lists'])

With explicit config:

from markdown import markdown

markdown(text='some text',
         extensions=[
             'mdx_truly_sane_lists',
         ],
         extension_configs={
             'mdx_truly_sane_lists': {
                 'nested_indent': 2,
                 'truly_sane': True,
             }},
         )

Screenshots and examples

You can preview the new behaviour live at rentry.co (uses nested_indent: 2, truly_sane: True)

Some ugly screenshots because I’m lazy and cannot into gimp:

image1 image2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdx_truly_sane_lists-1.0.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file mdx_truly_sane_lists-1.0.tar.gz.

File metadata

File hashes

Hashes for mdx_truly_sane_lists-1.0.tar.gz
Algorithm Hash digest
SHA256 f00be6d525ab3e4e4b45d96368853b0769c51c1512f262bf02c36b5f618dd013
MD5 68b5c992001188d9f2cb9c53fc74ca8c
BLAKE2b-256 d226386d8cd35f124ae5cd470e427f5284611106d99365a42c365dd611f8c1bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page