jinja-markdown2


Namejinja-markdown2 JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/mkbabb/jinja-markdown2
SummaryA Jinja2 extension for rendering Markdown with markdown2.
upload_time2024-06-14 18:19:47
maintainerNone
docs_urlNone
authorMike Babb
requires_python<4.0,>=3.10
licenseMIT
keywords jinja2 markdown2
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # jinja-markdown2

Inspired by the original [jinja-markdown](https://github.com/jpsca/jinja-markdown).

Uses `jinja2` + `markdown2` to render markdown code _after_ jinja's templating magic
(variable interpolation, etc.) is done. Critical difference between the naive:

    Markdown ->  HTML -> Jinja

Notice, the above processes the markdown _first_ and jinja templating _last_. Whilst
this approach technically works, it results in a myriad of problems with the resultant
HTML that markdown2 formulates.

The flow is then:

    HTML -> Jinja -> Markdown

## Usage

Python:

```python
...
from jinja_markdown2 import MarkdownExtension

jinja_env = ...
jinja_env.add_extension(MarkdownExtension)
...
```

Markdown:

```html
{% markdown %}

## Hello {{ world_name }}

{% endmarkdown %}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mkbabb/jinja-markdown2",
    "name": "jinja-markdown2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "jinja2, markdown2",
    "author": "Mike Babb",
    "author_email": "mike7400@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/18/bc/f5905398419e4683cf1385eb5ba1217529f49e937b907ca1704d3276de4b/jinja_markdown2-0.4.0.tar.gz",
    "platform": null,
    "description": "# jinja-markdown2\n\nInspired by the original [jinja-markdown](https://github.com/jpsca/jinja-markdown).\n\nUses `jinja2` + `markdown2` to render markdown code _after_ jinja's templating magic\n(variable interpolation, etc.) is done. Critical difference between the naive:\n\n    Markdown ->  HTML -> Jinja\n\nNotice, the above processes the markdown _first_ and jinja templating _last_. Whilst\nthis approach technically works, it results in a myriad of problems with the resultant\nHTML that markdown2 formulates.\n\nThe flow is then:\n\n    HTML -> Jinja -> Markdown\n\n## Usage\n\nPython:\n\n```python\n...\nfrom jinja_markdown2 import MarkdownExtension\n\njinja_env = ...\njinja_env.add_extension(MarkdownExtension)\n...\n```\n\nMarkdown:\n\n```html\n{% markdown %}\n\n## Hello {{ world_name }}\n\n{% endmarkdown %}\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Jinja2 extension for rendering Markdown with markdown2.",
    "version": "0.4.0",
    "project_urls": {
        "Homepage": "https://github.com/mkbabb/jinja-markdown2",
        "Repository": "https://github.com/mkbabb/jinja-markdown2"
    },
    "split_keywords": [
        "jinja2",
        " markdown2"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79e4145cc23195b673d73f5cd27c760f7dc1fd1b890d9a4088413e9afe57cc38",
                "md5": "ec8813f724ebdca67717c8a761671e27",
                "sha256": "ee43255a20f97874006a1d003d13bdd27ba8c39708738df8bd5cd1ce6029ab01"
            },
            "downloads": -1,
            "filename": "jinja_markdown2-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ec8813f724ebdca67717c8a761671e27",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 3520,
            "upload_time": "2024-06-14T18:19:46",
            "upload_time_iso_8601": "2024-06-14T18:19:46.285107Z",
            "url": "https://files.pythonhosted.org/packages/79/e4/145cc23195b673d73f5cd27c760f7dc1fd1b890d9a4088413e9afe57cc38/jinja_markdown2-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18bcf5905398419e4683cf1385eb5ba1217529f49e937b907ca1704d3276de4b",
                "md5": "6235d084fd8fb4328e14c2164b7dc564",
                "sha256": "51addceeec19f4dffb90d495c423bf5196fe721991ebb67f08af637332224790"
            },
            "downloads": -1,
            "filename": "jinja_markdown2-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6235d084fd8fb4328e14c2164b7dc564",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 2764,
            "upload_time": "2024-06-14T18:19:47",
            "upload_time_iso_8601": "2024-06-14T18:19:47.856788Z",
            "url": "https://files.pythonhosted.org/packages/18/bc/f5905398419e4683cf1385eb5ba1217529f49e937b907ca1704d3276de4b/jinja_markdown2-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-14 18:19:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mkbabb",
    "github_project": "jinja-markdown2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "jinja-markdown2"
}
        
Elapsed time: 0.70101s