mdx-truly-sane-lists


Namemdx-truly-sane-lists JSON
Version 1.3 PyPI version JSON
download
home_pagehttps://github.com/radude/mdx_truly_sane_lists
SummaryExtension for Python-Markdown that makes lists truly sane. Custom indents for nested lists and fix for messy linebreaks.
upload_time2022-07-19 13:42:45
maintainer
docs_urlNone
authorradude
requires_python
licenseMIT
keywords markdown extension markup lists markdown
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # Mdx Truly Sane Lists

[![Build Status](https://travis-ci.org/radude/mdx_truly_sane_lists.svg?branch=master)](https://travis-ci.org/radude/mdx_truly_sane_lists)


An extension for [Python-Markdown](https://github.com/Python-Markdown/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](https://python-markdown.github.io/extensions/sane_lists/) behavior, which doesn't allow the mixing of ordered and unordered lists.


## Installation

##### [Pypi](https://pypi.python.org/pypi/mdx-truly-sane-lists):

```console
pip3 install mdx_truly_sane_lists
```

##### Directly from git:

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

## Usage

Basic:

```python
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:

```python
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](https://rentry.co/) (uses `nested_indent: 2, truly_sane: True`)


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

![](https://i.imgur.com/7l2bWLY.png)
![](https://i.imgur.com/Ruwfb2A.png)

## HTML

Data:
```markdown
- attributes
 
- customer 
    - first_name
    - family_name
    - email
- person
    - first_name
    - family_name
    - birth_date
- subscription_id

- request
```

No extension:
```html before
<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:
```html
<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>
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/radude/mdx_truly_sane_lists",
    "name": "mdx-truly-sane-lists",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "markdown extension,markup,lists,markdown",
    "author": "radude",
    "author_email": "admin@rentry.co",
    "download_url": "https://files.pythonhosted.org/packages/e6/27/16456314311abac2cedef4527679924e80ac4de19dd926699c1b261e0b9b/mdx_truly_sane_lists-1.3.tar.gz",
    "platform": null,
    "description": "# Mdx Truly Sane Lists\n\n[![Build Status](https://travis-ci.org/radude/mdx_truly_sane_lists.svg?branch=master)](https://travis-ci.org/radude/mdx_truly_sane_lists)\n\n\nAn extension for [Python-Markdown](https://github.com/Python-Markdown/markdown) that makes lists truly sane. Features custom indents for nested lists and fix for messy linebreaks and paragraphs between lists.\n\n\n## Features\n\n* `nested_indent` option: Custom indent for nested lists. Defaults to `2`. Doesn't mess with code indents, which is still 4. \n\n* `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`.\n\n* Inherits [sane lists](https://python-markdown.github.io/extensions/sane_lists/) behavior, which doesn't allow the mixing of ordered and unordered lists.\n\n\n## Installation\n\n##### [Pypi](https://pypi.python.org/pypi/mdx-truly-sane-lists):\n\n```console\npip3 install mdx_truly_sane_lists\n```\n\n##### Directly from git:\n\n```console\npip3 install git+git://github.com/radude/mdx_truly_sane_lists\n```\n\n## Usage\n\nBasic:\n\n```python\nfrom markdown import markdown\n\n# Default config is truly_sane: True, nested_indent: 2\nmarkdown(text='some text', extensions=['mdx_truly_sane_lists']) \n```\n\nWith explicit config:\n\n```python\nfrom markdown import markdown\n\nmarkdown(text='some text',\n         extensions=[\n             'mdx_truly_sane_lists',\n         ],\n         extension_configs={\n             'mdx_truly_sane_lists': {\n                 'nested_indent': 2,\n                 'truly_sane': True,\n             }},\n         )\n```\n\n## Screenshots and examples\n\nYou can preview the new behaviour live at [rentry.co](https://rentry.co/) (uses `nested_indent: 2, truly_sane: True`)\n\n\nSome ugly screenshots because I'm lazy and cannot into gimp:\n\n![](https://i.imgur.com/7l2bWLY.png)\n![](https://i.imgur.com/Ruwfb2A.png)\n\n## HTML\n\nData:\n```markdown\n- attributes\n \n- customer \n    - first_name\n    - family_name\n    - email\n- person\n    - first_name\n    - family_name\n    - birth_date\n- subscription_id\n\n- request\n```\n\nNo extension:\n```html before\n<ul>\n<li>\n<p>attributes</p>\n</li>\n<li>\n<p>customer </p>\n<ul>\n<li>first_name</li>\n<li>family_name</li>\n<li>email</li>\n</ul>\n</li>\n<li>person<ul>\n<li>first_name</li>\n<li>family_name</li>\n<li>birth_date</li>\n</ul>\n</li>\n<li>\n<p>subscription_id</p>\n</li>\n<li>\n<p>request</p>\n</li>\n</ul>\n```\n\nTruly sane + 4 spaces:\n```html\n<ul>\n<li>attributes</li>\n</ul>\n<ul>\n<li>customer <ul>\n<li>first_name</li>\n<li>family_name</li>\n<li>email</li>\n</ul>\n</li>\n<li>person<ul>\n<li>first_name</li>\n<li>family_name</li>\n<li>birth_date</li>\n</ul>\n</li>\n<li>subscription_id</li>\n</ul>\n<ul>\n<li>request</li>\n</ul>\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Extension for Python-Markdown that makes lists truly sane. Custom indents for nested lists and fix for messy linebreaks.",
    "version": "1.3",
    "project_urls": {
        "Homepage": "https://github.com/radude/mdx_truly_sane_lists"
    },
    "split_keywords": [
        "markdown extension",
        "markup",
        "lists",
        "markdown"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a9edcd1027f7fd193aed152e01c6651a197c36b858f2cd1425ad04cb31a34fc",
                "md5": "63151fe85d18f9161f03c4ab10965353",
                "sha256": "b9546a4c40ff8f1ab692f77cee4b6bfe8ddf9cccf23f0a24e71f3716fe290a37"
            },
            "downloads": -1,
            "filename": "mdx_truly_sane_lists-1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63151fe85d18f9161f03c4ab10965353",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6071,
            "upload_time": "2022-07-19T13:42:43",
            "upload_time_iso_8601": "2022-07-19T13:42:43.375061Z",
            "url": "https://files.pythonhosted.org/packages/3a/9e/dcd1027f7fd193aed152e01c6651a197c36b858f2cd1425ad04cb31a34fc/mdx_truly_sane_lists-1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e62716456314311abac2cedef4527679924e80ac4de19dd926699c1b261e0b9b",
                "md5": "edd71d5f62504b02f081d9c1c8249b77",
                "sha256": "b661022df7520a1e113af7c355c62216b384c867e4f59fb8ee7ad511e6e77f45"
            },
            "downloads": -1,
            "filename": "mdx_truly_sane_lists-1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "edd71d5f62504b02f081d9c1c8249b77",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5359,
            "upload_time": "2022-07-19T13:42:45",
            "upload_time_iso_8601": "2022-07-19T13:42:45.153243Z",
            "url": "https://files.pythonhosted.org/packages/e6/27/16456314311abac2cedef4527679924e80ac4de19dd926699c1b261e0b9b/mdx_truly_sane_lists-1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-07-19 13:42:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "radude",
    "github_project": "mdx_truly_sane_lists",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mdx-truly-sane-lists"
}
        
Elapsed time: 0.28858s