codekingpro/portable-devtools
114k
1Metadata-Version: 2.42Name: markdown-it-py3Version: 4.2.04Summary: Python port of markdown-it. Markdown parsing, done right!5Keywords: markdown,lexer,parser,commonmark,markdown-it6Author-email: Chris Sewell <chrisj_sewell@hotmail.com>7Requires-Python: >=3.108Description-Content-Type: text/markdown9Classifier: Development Status :: 5 - Production/Stable10Classifier: Intended Audience :: Developers11Classifier: License :: OSI Approved :: MIT License12Classifier: Programming Language :: Python :: 313Classifier: Programming Language :: Python :: 3.1014Classifier: Programming Language :: Python :: 3.1115Classifier: Programming Language :: Python :: 3.1216Classifier: Programming Language :: Python :: 3.1317Classifier: Programming Language :: Python :: Implementation :: CPython18Classifier: Programming Language :: Python :: Implementation :: PyPy19Classifier: Topic :: Software Development :: Libraries :: Python Modules20Classifier: Topic :: Text Processing :: Markup21License-File: LICENSE22License-File: LICENSE.markdown-it23Requires-Dist: mdurl~=0.124Requires-Dist: psutil ; extra == "benchmarking"25Requires-Dist: pytest ; extra == "benchmarking"26Requires-Dist: pytest-benchmark ; extra == "benchmarking"27Requires-Dist: commonmark~=0.9 ; extra == "compare"28Requires-Dist: markdown~=3.4 ; extra == "compare"29Requires-Dist: mistletoe~=1.0 ; extra == "compare"30Requires-Dist: mistune~=3.0 ; extra == "compare"31Requires-Dist: panflute~=2.3 ; extra == "compare"32Requires-Dist: markdown-it-pyrs ; extra == "compare"33Requires-Dist: linkify-it-py>=1,<3 ; extra == "linkify"34Requires-Dist: mdit-py-plugins>=0.5.0 ; extra == "plugins"35Requires-Dist: gprof2dot ; extra == "profiling"36Requires-Dist: mdit-py-plugins>=0.5.0 ; extra == "rtd"37Requires-Dist: myst-parser ; extra == "rtd"38Requires-Dist: pyyaml ; extra == "rtd"39Requires-Dist: sphinx ; extra == "rtd"40Requires-Dist: sphinx-copybutton ; extra == "rtd"41Requires-Dist: sphinx-design ; extra == "rtd"42Requires-Dist: sphinx-book-theme~=1.0 ; extra == "rtd"43Requires-Dist: jupyter_sphinx ; extra == "rtd"44Requires-Dist: ipykernel ; extra == "rtd"45Requires-Dist: coverage ; extra == "testing"46Requires-Dist: pytest ; extra == "testing"47Requires-Dist: pytest-cov ; extra == "testing"48Requires-Dist: pytest-regressions ; extra == "testing"49Requires-Dist: pytest-timeout ; extra == "testing"50Requires-Dist: requests ; extra == "testing"51Project-URL: Documentation, https://markdown-it-py.readthedocs.io52Project-URL: Homepage, https://github.com/executablebooks/markdown-it-py53Provides-Extra: benchmarking54Provides-Extra: compare55Provides-Extra: linkify56Provides-Extra: plugins57Provides-Extra: profiling58Provides-Extra: rtd59Provides-Extra: testing60 61# markdown-it-py62 63[![Github-CI][github-ci]][github-link]64[![Coverage Status][codecov-badge]][codecov-link]65[![PyPI][pypi-badge]][pypi-link]66[![Conda][conda-badge]][conda-link]67[![PyPI - Downloads][install-badge]][install-link]68 69<p align="center">70 <img alt="markdown-it-py icon" src="https://raw.githubusercontent.com/executablebooks/markdown-it-py/master/docs/_static/markdown-it-py.svg">71</p>72 73> Markdown parser done right.74 75- Follows the __[CommonMark spec](http://spec.commonmark.org/)__ for baseline parsing76- Configurable syntax: you can add new rules and even replace existing ones.77- Pluggable: Adds syntax extensions to extend the parser (see the [plugin list][md-plugins]).78- High speed (see our [benchmarking tests][md-performance])79- Easy to configure for [security][md-security]80- Member of [Google's Assured Open Source Software](https://cloud.google.com/assured-open-source-software/docs/supported-packages)81 82This is a Python port of [markdown-it], and some of its associated plugins.83For more details see: <https://markdown-it-py.readthedocs.io>.84 85For details on [markdown-it] itself, see:86 87- The __[Live demo](https://markdown-it.github.io)__88- [The markdown-it README][markdown-it-readme]89 90**See also:** [markdown-it-pyrs](https://github.com/chrisjsewell/markdown-it-pyrs) for an experimental Rust binding,91for even more speed!92 93## Installation94 95### PIP96 97```bash98pip install markdown-it-py[plugins]99```100 101or with extras102 103```bash104pip install markdown-it-py[linkify,plugins]105```106 107### Conda108 109```bash110conda install -c conda-forge markdown-it-py111```112 113or with extras114 115```bash116conda install -c conda-forge markdown-it-py linkify-it-py mdit-py-plugins117```118 119## Usage120 121### Python API Usage122 123Render markdown to HTML with markdown-it-py and a custom configuration124with and without plugins and features:125 126```python127from markdown_it import MarkdownIt128from mdit_py_plugins.front_matter import front_matter_plugin129from mdit_py_plugins.footnote import footnote_plugin130 131md = (132 MarkdownIt('commonmark', {'breaks':True,'html':True})133 .use(front_matter_plugin)134 .use(footnote_plugin)135 .enable('table')136)137text = ("""138---139a: 1140---141 142a | b143- | -1441 | 2145 146A footnote [^1]147 148[^1]: some details149""")150tokens = md.parse(text)151html_text = md.render(text)152 153## To export the html to a file, uncomment the lines below:154# from pathlib import Path155# Path("output.html").write_text(html_text)156```157 158### Command-line Usage159 160Render markdown to HTML with markdown-it-py from the161command-line:162 163```console164usage: markdown-it [-h] [-v] [--stdin|filenames [filenames ...]]165 166Parse one or more markdown files, convert each to HTML, and print to stdout167 168positional arguments:169 --stdin read source Markdown file from standard input170 filenames specify an optional list of files to convert171 172optional arguments:173 -h, --help show this help message and exit174 -v, --version show program's version number and exit175 176Interactive:177 178 $ markdown-it179 markdown-it-py [version 0.0.0] (interactive)180 Type Ctrl-D to complete input, or Ctrl-C to exit.181 >>> # Example182 ... > markdown *input*183 ...184 <h1>Example</h1>185 <blockquote>186 <p>markdown <em>input</em></p>187 </blockquote>188 189Batch:190 191 $ markdown-it README.md README.footer.md > index.html192 193```194 195## References / Thanks196 197Big thanks to the authors of [markdown-it]:198 199- Alex Kocharin [github/rlidwka](https://github.com/rlidwka)200- Vitaly Puzrin [github/puzrin](https://github.com/puzrin)201 202Also [John MacFarlane](https://github.com/jgm) for his work on the CommonMark spec and reference implementations.203 204[github-ci]: https://github.com/executablebooks/markdown-it-py/actions/workflows/tests.yml/badge.svg?branch=master205[github-link]: https://github.com/executablebooks/markdown-it-py206[pypi-badge]: https://img.shields.io/pypi/v/markdown-it-py.svg207[pypi-link]: https://pypi.org/project/markdown-it-py208[conda-badge]: https://anaconda.org/conda-forge/markdown-it-py/badges/version.svg209[conda-link]: https://anaconda.org/conda-forge/markdown-it-py210[codecov-badge]: https://codecov.io/gh/executablebooks/markdown-it-py/branch/master/graph/badge.svg211[codecov-link]: https://codecov.io/gh/executablebooks/markdown-it-py212[install-badge]: https://img.shields.io/pypi/dw/markdown-it-py?label=pypi%20installs213[install-link]: https://pypistats.org/packages/markdown-it-py214 215[CommonMark spec]: http://spec.commonmark.org/216[markdown-it]: https://github.com/markdown-it/markdown-it217[markdown-it-readme]: https://github.com/markdown-it/markdown-it/blob/master/README.md218[md-security]: https://markdown-it-py.readthedocs.io/en/latest/security.html219[md-performance]: https://markdown-it-py.readthedocs.io/en/latest/performance.html220[md-plugins]: https://markdown-it-py.readthedocs.io/en/latest/plugins.html221 222 