All Projects → radude → mdx_truly_sane_lists

radude / mdx_truly_sane_lists

Licence: MIT license
Extension for Python-Markdown that makes lists truly sane. Custom indents for nested lists and fix for messy linebreaks and paragraphs between lists.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to mdx truly sane lists

figureAltCaption
Extension for Python Markdown to add captions to images
Stars: ✭ 15 (-68.09%)
Mutual labels:  python-markdown, markdown-extension
markdown
markdown tools, libraries & scripts
Stars: ✭ 52 (+10.64%)
Mutual labels:  markup
Leader Line
Draw a leader line in your web page.
Stars: ✭ 1,872 (+3882.98%)
Mutual labels:  markup
Scroll
Static publishing software with a newspaper feel built on Tree Notation. Scroll is public domain software.
Stars: ✭ 206 (+338.3%)
Mutual labels:  markup
Abstractml
An HTML abstraction focused on simplicity, with support for JavaScript and CSS. Perfect for experts and beginners!
Stars: ✭ 123 (+161.7%)
Mutual labels:  markup
Hypertext
Any-way-you-want-it, type-safe HTML in Swift.
Stars: ✭ 236 (+402.13%)
Mutual labels:  markup
Sowing Machine
🌱A React UI toolchain & JSX alternative
Stars: ✭ 64 (+36.17%)
Mutual labels:  markup
common-markup-state-machine
CMSM: Common markup state machine
Stars: ✭ 43 (-8.51%)
Mutual labels:  markup
bs-declaredom
Strongly typed declarative markup for the DOM and CSS
Stars: ✭ 66 (+40.43%)
Mutual labels:  markup
Django Markupfield
📑 a MarkupField for Django
Stars: ✭ 184 (+291.49%)
Mutual labels:  markup
Badges
📝 Markdown code for lots of small badges 🎀 📌 (shields.io, forthebadge.com etc) 😎. Contributions are welcome! Please add yours!
Stars: ✭ 2,987 (+6255.32%)
Mutual labels:  markup
Svgo
Go Language Library for SVG generation
Stars: ✭ 1,779 (+3685.11%)
Mutual labels:  markup
rentry
Markdown pastebin from command line
Stars: ✭ 252 (+436.17%)
Mutual labels:  markup
Awesome Jamstack
📔 Curated list of resources: books, videos, articles, speaker decks, tools about using the JAMstack (A modern web development architecture for creating fast, secure and dynamic websites)
Stars: ✭ 115 (+144.68%)
Mutual labels:  markup
Preact Markup
⚡️ Render HTML5 as VDOM, with Components as Custom Elements!
Stars: ✭ 167 (+255.32%)
Mutual labels:  markup
A11y.css
This CSS file intends to warn developers about possible risks and mistakes that exist in HTML code. It can also be used to roughly evaluate a site's quality by simply including it as an external stylesheet.
Stars: ✭ 1,277 (+2617.02%)
Mutual labels:  markup
Awesomespotlightview
Awesome tool for create tutorial walkthrough or coach tour
Stars: ✭ 225 (+378.72%)
Mutual labels:  markup
attoparser
A tiny but fast java event-style markup parser.
Stars: ✭ 46 (-2.13%)
Mutual labels:  markup
xidoc
A consistent markup language
Stars: ✭ 40 (-14.89%)
Mutual labels:  markup
slackdown
A simple Slack message text formatting to HTML code converter.
Stars: ✭ 27 (-42.55%)
Mutual labels:  markup

Mdx Truly Sane Lists

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:

HTML

Data:

- attributes
 
- customer 
    - first_name
    - family_name
    - email
- person
    - first_name
    - family_name
    - birth_date
- subscription_id

- request

No extension:

<ul>
<li>
<p>attributes</p>
</li>
<li>
<p>customer </p>
<ul>
<li>first_name</li>
<li>family_name</li>
<li>email</li>
</ul>
</li>
<li>person<ul>
<li>first_name</li>
<li>family_name</li>
<li>birth_date</li>
</ul>
</li>
<li>
<p>subscription_id</p>
</li>
<li>
<p>request</p>
</li>
</ul>

Truly sane + 4 spaces:

<ul>
<li>attributes</li>
</ul>
<ul>
<li>customer <ul>
<li>first_name</li>
<li>family_name</li>
<li>email</li>
</ul>
</li>
<li>person<ul>
<li>first_name</li>
<li>family_name</li>
<li>birth_date</li>
</ul>
</li>
<li>subscription_id</li>
</ul>
<ul>
<li>request</li>
</ul>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].