METADATA 6.8 KB

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