mdformat_admon


Namemdformat_admon JSON
Version 2.0.3 PyPI version JSON
download
home_pageNone
SummaryAn mdformat plugin for admonitions.
upload_time2024-04-15 01:23:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8.0
licenseNone
keywords markdown markdown-it mdformat
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mdformat-admon

[![Build Status][ci-badge]][ci-link] [![PyPI version][pypi-badge]][pypi-link]

<!-- [![codecov.io][cov-badge]][cov-link]
[cov-badge]: https://codecov.io/gh/executablebooks/mdformat-admon/branch/main/graph/badge.svg
[cov-link]: https://codecov.io/gh/executablebooks/mdformat-admon
 -->

An [mdformat](https://github.com/executablebooks/mdformat) plugin for `admonitions`, a set of helpers for supporting new admonition syntaxes, and tool for rendering admonition HTML.

## `mdformat` Usage

Add this package wherever you use `mdformat` and the plugin will be auto-recognized. No additional configuration necessary. See [additional information on `mdformat` plugins here](https://mdformat.readthedocs.io/en/stable/users/plugins.html)

### Pre-Commit

```yaml
repos:
  - repo: https://github.com/executablebooks/mdformat
    rev: 0.7.16
    hooks:
      - id: mdformat
        additional_dependencies:
          - mdformat-admon
```

### pipx

```sh
pipx install mdformat
pipx inject mdformat mdformat-admon
```

## HTML Rendering

To generate HTML output, `python_markdown_admon_plugin` can be imported from `mdit_plugins`. More plugins will be added in the future. For more guidance on `MarkdownIt`, see the docs: <https://markdown-it-py.readthedocs.io/en/latest/using.html#the-parser>

```py
from markdown_it import MarkdownIt
from mdformat_admon.mdit_plugins import python_markdown_admon_plugin

md = MarkdownIt()
md.use(python_markdown_admon_plugin)

text = '!!! note ""\n    *content*'
md.render(text)
# <div class="admonition note">
# <p><em>content</em></p>
# </div>
```

## Extensibility

Because admonition syntax varies wildly between implementations, this package provides a set of helpers for building new admonition parsers under `mdformat_admon.factories`.

- Supported by `mdformat-admon`
    - [python-markdown](https://python-markdown.github.io/extensions/admonition)
- Supported by other packages
    - [`mdformat-mkdocs`](https://github.com/KyleKing/mdformat-mkdocs)
        - [MKDocs Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions)
    - [`mdformat-gfm-alerts`](https://github.com/KyleKing/mdformat-gfm-alerts)
        - [Github "Alerts"](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) and [MicroSoft "Alerts"](https://learn.microsoft.com/en-us/contribute/content/markdown-reference#alerts-note-tip-important-caution-warning)
    - [`mdformat-obsidian`](https://github.com/KyleKing/mdformat-obsidian)
        - [Obsidian Callouts](https://help.obsidian.md/How+to/Use+callouts)
- Currently Unsupported (or at least not known to be supported)
    - Variations of Directives:
        - [node.js markdown-it-container](https://github.com/markdown-it/markdown-it-container)
        - [MyST](https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html)
        - [Sphinx Directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html)
        - [reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/directives.html#specific-admonitions)
        - [pymdown-extensions](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition)
        - [PyMDown](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition)
    - [Mozilla Callouts](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#notes_warnings_and_callouts)

See how different admonition formats are handled in this test file: [./tests/pre-commit-test.md](https://raw.githubusercontent.com/KyleKing/mdformat-admon/main/tests/pre-commit-test.md)

## Contributing

See [CONTRIBUTING.md](https://github.com/KyleKing/mdformat-admon/blob/main/CONTRIBUTING.md)

[ci-badge]: https://github.com/kyleking/mdformat-admon/workflows/CI/badge.svg?branch=main
[ci-link]: https://github.com/kyleking/mdformat-admon/actions?query=workflow%3ACI+branch%3Amain+event%3Apush
[pypi-badge]: https://img.shields.io/pypi/v/mdformat-admon.svg
[pypi-link]: https://pypi.org/project/mdformat-admon

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mdformat_admon",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.0",
    "maintainer_email": null,
    "keywords": "markdown, markdown-it, mdformat",
    "author": null,
    "author_email": "kyleking <dev.act.kyle@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7d/51/01054c5cede0b7796871f80a07f1fd78e26bcd2f195527b662349666c101/mdformat_admon-2.0.3.tar.gz",
    "platform": null,
    "description": "# mdformat-admon\n\n[![Build Status][ci-badge]][ci-link] [![PyPI version][pypi-badge]][pypi-link]\n\n<!-- [![codecov.io][cov-badge]][cov-link]\n[cov-badge]: https://codecov.io/gh/executablebooks/mdformat-admon/branch/main/graph/badge.svg\n[cov-link]: https://codecov.io/gh/executablebooks/mdformat-admon\n -->\n\nAn [mdformat](https://github.com/executablebooks/mdformat) plugin for `admonitions`, a set of helpers for supporting new admonition syntaxes, and tool for rendering admonition HTML.\n\n## `mdformat` Usage\n\nAdd this package wherever you use `mdformat` and the plugin will be auto-recognized. No additional configuration necessary. See [additional information on `mdformat` plugins here](https://mdformat.readthedocs.io/en/stable/users/plugins.html)\n\n### Pre-Commit\n\n```yaml\nrepos:\n  - repo: https://github.com/executablebooks/mdformat\n    rev: 0.7.16\n    hooks:\n      - id: mdformat\n        additional_dependencies:\n          - mdformat-admon\n```\n\n### pipx\n\n```sh\npipx install mdformat\npipx inject mdformat mdformat-admon\n```\n\n## HTML Rendering\n\nTo generate HTML output, `python_markdown_admon_plugin` can be imported from `mdit_plugins`. More plugins will be added in the future. For more guidance on `MarkdownIt`, see the docs: <https://markdown-it-py.readthedocs.io/en/latest/using.html#the-parser>\n\n```py\nfrom markdown_it import MarkdownIt\nfrom mdformat_admon.mdit_plugins import python_markdown_admon_plugin\n\nmd = MarkdownIt()\nmd.use(python_markdown_admon_plugin)\n\ntext = '!!! note \"\"\\n    *content*'\nmd.render(text)\n# <div class=\"admonition note\">\n# <p><em>content</em></p>\n# </div>\n```\n\n## Extensibility\n\nBecause admonition syntax varies wildly between implementations, this package provides a set of helpers for building new admonition parsers under `mdformat_admon.factories`.\n\n- Supported by `mdformat-admon`\n    - [python-markdown](https://python-markdown.github.io/extensions/admonition)\n- Supported by other packages\n    - [`mdformat-mkdocs`](https://github.com/KyleKing/mdformat-mkdocs)\n        - [MKDocs Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions)\n    - [`mdformat-gfm-alerts`](https://github.com/KyleKing/mdformat-gfm-alerts)\n        - [Github \"Alerts\"](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) and [MicroSoft \"Alerts\"](https://learn.microsoft.com/en-us/contribute/content/markdown-reference#alerts-note-tip-important-caution-warning)\n    - [`mdformat-obsidian`](https://github.com/KyleKing/mdformat-obsidian)\n        - [Obsidian Callouts](https://help.obsidian.md/How+to/Use+callouts)\n- Currently Unsupported (or at least not known to be supported)\n    - Variations of Directives:\n        - [node.js markdown-it-container](https://github.com/markdown-it/markdown-it-container)\n        - [MyST](https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html)\n        - [Sphinx Directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html)\n        - [reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/directives.html#specific-admonitions)\n        - [pymdown-extensions](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition)\n        - [PyMDown](https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/admonition)\n    - [Mozilla Callouts](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#notes_warnings_and_callouts)\n\nSee how different admonition formats are handled in this test file: [./tests/pre-commit-test.md](https://raw.githubusercontent.com/KyleKing/mdformat-admon/main/tests/pre-commit-test.md)\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/KyleKing/mdformat-admon/blob/main/CONTRIBUTING.md)\n\n[ci-badge]: https://github.com/kyleking/mdformat-admon/workflows/CI/badge.svg?branch=main\n[ci-link]: https://github.com/kyleking/mdformat-admon/actions?query=workflow%3ACI+branch%3Amain+event%3Apush\n[pypi-badge]: https://img.shields.io/pypi/v/mdformat-admon.svg\n[pypi-link]: https://pypi.org/project/mdformat-admon\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An mdformat plugin for admonitions.",
    "version": "2.0.3",
    "project_urls": {
        "homepage": "https://github.com/kyleking/mdformat-admon"
    },
    "split_keywords": [
        "markdown",
        " markdown-it",
        " mdformat"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "583e667c485571a22e5ddb0c692d6cd0de8bf607faabab07b7888f802dc798e1",
                "md5": "6e39755a9a653b03412e3c1a881a1af6",
                "sha256": "d3a114fb894a4db2828e895dab9f48399d49805c63cf425d1b3c65e21e3d0053"
            },
            "downloads": -1,
            "filename": "mdformat_admon-2.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e39755a9a653b03412e3c1a881a1af6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.0",
            "size": 9452,
            "upload_time": "2024-04-15T01:23:58",
            "upload_time_iso_8601": "2024-04-15T01:23:58.488051Z",
            "url": "https://files.pythonhosted.org/packages/58/3e/667c485571a22e5ddb0c692d6cd0de8bf607faabab07b7888f802dc798e1/mdformat_admon-2.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7d5101054c5cede0b7796871f80a07f1fd78e26bcd2f195527b662349666c101",
                "md5": "0522a2a834eae5ccf19ae97d54c6e5b5",
                "sha256": "2890a68ec3be06e08772d9c92d84c665b398fba1fa18f870b989f94aa6cd5aad"
            },
            "downloads": -1,
            "filename": "mdformat_admon-2.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0522a2a834eae5ccf19ae97d54c6e5b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0",
            "size": 12823,
            "upload_time": "2024-04-15T01:23:59",
            "upload_time_iso_8601": "2024-04-15T01:23:59.757074Z",
            "url": "https://files.pythonhosted.org/packages/7d/51/01054c5cede0b7796871f80a07f1fd78e26bcd2f195527b662349666c101/mdformat_admon-2.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-15 01:23:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kyleking",
    "github_project": "mdformat-admon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "mdformat_admon"
}
        
Elapsed time: 0.22370s