METADATA 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. Metadata-Version: 2.4
  2. Name: markdown-it-py
  3. Version: 4.0.0
  4. Summary: Python port of markdown-it. Markdown parsing, done right!
  5. Keywords: markdown,lexer,parser,commonmark,markdown-it
  6. Author-email: Chris Sewell <chrisj_sewell@hotmail.com>
  7. Requires-Python: >=3.10
  8. Description-Content-Type: text/markdown
  9. Classifier: Development Status :: 5 - Production/Stable
  10. Classifier: Intended Audience :: Developers
  11. Classifier: License :: OSI Approved :: MIT License
  12. Classifier: Programming Language :: Python :: 3
  13. Classifier: Programming Language :: Python :: 3.10
  14. Classifier: Programming Language :: Python :: 3.11
  15. Classifier: Programming Language :: Python :: 3.12
  16. Classifier: Programming Language :: Python :: 3.13
  17. Classifier: Programming Language :: Python :: Implementation :: CPython
  18. Classifier: Programming Language :: Python :: Implementation :: PyPy
  19. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  20. Classifier: Topic :: Text Processing :: Markup
  21. License-File: LICENSE
  22. License-File: LICENSE.markdown-it
  23. Requires-Dist: mdurl~=0.1
  24. Requires-Dist: psutil ; extra == "benchmarking"
  25. Requires-Dist: pytest ; extra == "benchmarking"
  26. Requires-Dist: pytest-benchmark ; extra == "benchmarking"
  27. Requires-Dist: commonmark~=0.9 ; extra == "compare"
  28. Requires-Dist: markdown~=3.4 ; extra == "compare"
  29. Requires-Dist: mistletoe~=1.0 ; extra == "compare"
  30. Requires-Dist: mistune~=3.0 ; extra == "compare"
  31. Requires-Dist: panflute~=2.3 ; extra == "compare"
  32. Requires-Dist: markdown-it-pyrs ; extra == "compare"
  33. Requires-Dist: linkify-it-py>=1,<3 ; extra == "linkify"
  34. Requires-Dist: mdit-py-plugins>=0.5.0 ; extra == "plugins"
  35. Requires-Dist: gprof2dot ; extra == "profiling"
  36. Requires-Dist: mdit-py-plugins>=0.5.0 ; extra == "rtd"
  37. Requires-Dist: myst-parser ; extra == "rtd"
  38. Requires-Dist: pyyaml ; extra == "rtd"
  39. Requires-Dist: sphinx ; extra == "rtd"
  40. Requires-Dist: sphinx-copybutton ; extra == "rtd"
  41. Requires-Dist: sphinx-design ; extra == "rtd"
  42. Requires-Dist: sphinx-book-theme~=1.0 ; extra == "rtd"
  43. Requires-Dist: jupyter_sphinx ; extra == "rtd"
  44. Requires-Dist: ipykernel ; extra == "rtd"
  45. Requires-Dist: coverage ; extra == "testing"
  46. Requires-Dist: pytest ; extra == "testing"
  47. Requires-Dist: pytest-cov ; extra == "testing"
  48. Requires-Dist: pytest-regressions ; extra == "testing"
  49. Requires-Dist: requests ; extra == "testing"
  50. Project-URL: Documentation, https://markdown-it-py.readthedocs.io
  51. Project-URL: Homepage, https://github.com/executablebooks/markdown-it-py
  52. Provides-Extra: benchmarking
  53. Provides-Extra: compare
  54. Provides-Extra: linkify
  55. Provides-Extra: plugins
  56. Provides-Extra: profiling
  57. Provides-Extra: rtd
  58. Provides-Extra: testing
  59. # markdown-it-py
  60. [![Github-CI][github-ci]][github-link]
  61. [![Coverage Status][codecov-badge]][codecov-link]
  62. [![PyPI][pypi-badge]][pypi-link]
  63. [![Conda][conda-badge]][conda-link]
  64. [![PyPI - Downloads][install-badge]][install-link]
  65. <p align="center">
  66. <img alt="markdown-it-py icon" src="https://raw.githubusercontent.com/executablebooks/markdown-it-py/master/docs/_static/markdown-it-py.svg">
  67. </p>
  68. > Markdown parser done right.
  69. - Follows the __[CommonMark spec](http://spec.commonmark.org/)__ for baseline parsing
  70. - Configurable syntax: you can add new rules and even replace existing ones.
  71. - Pluggable: Adds syntax extensions to extend the parser (see the [plugin list][md-plugins]).
  72. - High speed (see our [benchmarking tests][md-performance])
  73. - Easy to configure for [security][md-security]
  74. - Member of [Google's Assured Open Source Software](https://cloud.google.com/assured-open-source-software/docs/supported-packages)
  75. This is a Python port of [markdown-it], and some of its associated plugins.
  76. For more details see: <https://markdown-it-py.readthedocs.io>.
  77. For details on [markdown-it] itself, see:
  78. - The __[Live demo](https://markdown-it.github.io)__
  79. - [The markdown-it README][markdown-it-readme]
  80. **See also:** [markdown-it-pyrs](https://github.com/chrisjsewell/markdown-it-pyrs) for an experimental Rust binding,
  81. for even more speed!
  82. ## Installation
  83. ### PIP
  84. ```bash
  85. pip install markdown-it-py[plugins]
  86. ```
  87. or with extras
  88. ```bash
  89. pip install markdown-it-py[linkify,plugins]
  90. ```
  91. ### Conda
  92. ```bash
  93. conda install -c conda-forge markdown-it-py
  94. ```
  95. or with extras
  96. ```bash
  97. conda install -c conda-forge markdown-it-py linkify-it-py mdit-py-plugins
  98. ```
  99. ## Usage
  100. ### Python API Usage
  101. Render markdown to HTML with markdown-it-py and a custom configuration
  102. with and without plugins and features:
  103. ```python
  104. from markdown_it import MarkdownIt
  105. from mdit_py_plugins.front_matter import front_matter_plugin
  106. from mdit_py_plugins.footnote import footnote_plugin
  107. md = (
  108. MarkdownIt('commonmark', {'breaks':True,'html':True})
  109. .use(front_matter_plugin)
  110. .use(footnote_plugin)
  111. .enable('table')
  112. )
  113. text = ("""
  114. ---
  115. a: 1
  116. ---
  117. a | b
  118. - | -
  119. 1 | 2
  120. A footnote [^1]
  121. [^1]: some details
  122. """)
  123. tokens = md.parse(text)
  124. html_text = md.render(text)
  125. ## To export the html to a file, uncomment the lines below:
  126. # from pathlib import Path
  127. # Path("output.html").write_text(html_text)
  128. ```
  129. ### Command-line Usage
  130. Render markdown to HTML with markdown-it-py from the
  131. command-line:
  132. ```console
  133. usage: markdown-it [-h] [-v] [filenames [filenames ...]]
  134. Parse one or more markdown files, convert each to HTML, and print to stdout
  135. positional arguments:
  136. filenames specify an optional list of files to convert
  137. optional arguments:
  138. -h, --help show this help message and exit
  139. -v, --version show program's version number and exit
  140. Interactive:
  141. $ markdown-it
  142. markdown-it-py [version 0.0.0] (interactive)
  143. Type Ctrl-D to complete input, or Ctrl-C to exit.
  144. >>> # Example
  145. ... > markdown *input*
  146. ...
  147. <h1>Example</h1>
  148. <blockquote>
  149. <p>markdown <em>input</em></p>
  150. </blockquote>
  151. Batch:
  152. $ markdown-it README.md README.footer.md > index.html
  153. ```
  154. ## References / Thanks
  155. Big thanks to the authors of [markdown-it]:
  156. - Alex Kocharin [github/rlidwka](https://github.com/rlidwka)
  157. - Vitaly Puzrin [github/puzrin](https://github.com/puzrin)
  158. Also [John MacFarlane](https://github.com/jgm) for his work on the CommonMark spec and reference implementations.
  159. [github-ci]: https://github.com/executablebooks/markdown-it-py/actions/workflows/tests.yml/badge.svg?branch=master
  160. [github-link]: https://github.com/executablebooks/markdown-it-py
  161. [pypi-badge]: https://img.shields.io/pypi/v/markdown-it-py.svg
  162. [pypi-link]: https://pypi.org/project/markdown-it-py
  163. [conda-badge]: https://anaconda.org/conda-forge/markdown-it-py/badges/version.svg
  164. [conda-link]: https://anaconda.org/conda-forge/markdown-it-py
  165. [codecov-badge]: https://codecov.io/gh/executablebooks/markdown-it-py/branch/master/graph/badge.svg
  166. [codecov-link]: https://codecov.io/gh/executablebooks/markdown-it-py
  167. [install-badge]: https://img.shields.io/pypi/dw/markdown-it-py?label=pypi%20installs
  168. [install-link]: https://pypistats.org/packages/markdown-it-py
  169. [CommonMark spec]: http://spec.commonmark.org/
  170. [markdown-it]: https://github.com/markdown-it/markdown-it
  171. [markdown-it-readme]: https://github.com/markdown-it/markdown-it/blob/master/README.md
  172. [md-security]: https://markdown-it-py.readthedocs.io/en/latest/security.html
  173. [md-performance]: https://markdown-it-py.readthedocs.io/en/latest/performance.html
  174. [md-plugins]: https://markdown-it-py.readthedocs.io/en/latest/plugins.html