python-markdown-math-0.6/ 0000755 0001750 0001750 00000000000 13310733217 016311 5 ustar dmitry dmitry 0000000 0000000 python-markdown-math-0.6/setup.py 0000644 0001750 0001750 00000001220 13310733160 020013 0 ustar dmitry dmitry 0000000 0000000 #!/usr/bin/env python3 from setuptools import setup with open('README.md') as readme_file: long_description = readme_file.read() setup(name='python-markdown-math', description='Math extension for Python-Markdown', long_description=long_description, long_description_content_type='text/markdown', author='Dmitry Shachnev', author_email='mitya57@gmail.com', version='0.6', url='https://github.com/mitya57/python-markdown-math', py_modules=['mdx_math'], entry_points={ 'markdown.extensions': [ 'mdx_math = mdx_math:MathExtension', ], }, license='BSD') python-markdown-math-0.6/changelog 0000644 0001750 0001750 00000002206 13310732740 020163 0 ustar dmitry dmitry 0000000 0000000 Version 0.6, 2018-06-13 ======================= * Include LICENSE and tests in the tarball. Version 0.5, 2018-05-03 ======================= * Re-upload with fixed metadata and description. Version 0.4, 2018-05-03 ======================= * Added AsciiMath support. To switch from LaTeX syntax to AsciiMath, set the “use_asciimath” configuration option to true. * The dollar sign can now be escaped when the “enable_dollar_delimiter” option is enabled (\$ produces $). * Inline math can now be used inside standalone math. Version 0.3, 2017-03-24 ======================= * Added “add_preview” configuration option, which adds preview nodes as recognized by MathJax before every script node. - Thanks to Antoine Amarilli and Danni Randeris for their initial work. * Added a test suite. * Documentation improvements. Version 0.2, 2015-12-05 ======================= * Fix compatibility with earlier Python-Markdown versions. - Thanks to Bryan A. Jones for the contribution. * Add installation instructions from PyPI. - Thanks to Drew Hubl for the contribution. Version 0.1, 2015-08-12 ======================= * Initial release. python-markdown-math-0.6/test.py 0000755 0001750 0001750 00000003565 13272376735 017675 0 ustar dmitry dmitry 0000000 0000000 #!/usr/bin/env python3 from markdown import Markdown import unittest class MathTestCase(unittest.TestCase): def verify(self, mkd_name, html_name, config=None): config = config or dict() md = Markdown(extensions=['mdx_math'], extension_configs={'mdx_math': config}) with open('test_data/%s.mkd' % mkd_name) as mkd_file: mkd = mkd_file.read() with open('test_data/%s.html' % html_name) as html_file: html = html_file.read() self.assertEqual(html, md.convert(mkd) + '\n') def r(mkd_name, html_name, **config): return lambda self: self.verify(mkd_name, html_name, config=config) test_inline_latex = r('inline_latex', 'inline') test_inline_latex_escaped = r('inline_latex_escaped', 'inline_latex_escaped') test_inline_latex_preview = r('inline_latex', 'inline_preview', add_preview=True) test_inline_tex = r('inline_tex', 'inline', enable_dollar_delimiter=True) test_inline_tex_disabled = r('inline_tex', 'inline_tex_disabled') test_inline_tex_escaped = r('inline_tex_escaped', 'inline_tex_escaped', enable_dollar_delimiter=True) test_inline_inside_code = r('inline_latex_inside_code', 'inline_latex_inside_code') test_inline_inside_standalone = r('inline_inside_standalone', 'inline_inside_standalone') test_standalone_latex = r('standalone_latex', 'standalone') test_standalone_latex_escaped = r('standalone_latex_escaped', 'standalone_latex_escaped') test_standalone_latex_preview = r('standalone_latex', 'standalone_preview', add_preview=True) test_standalone_tex = r('standalone_tex', 'standalone') test_begin_end = r('beginend', 'beginend') test_begin_end_preview = r('beginend', 'beginend_preview', add_preview=True) test_inline_asciimath = r('inline_asciimath', 'inline_asciimath', use_asciimath=True) if __name__ == '__main__': unittest.main(verbosity=2) python-markdown-math-0.6/MANIFEST.in 0000644 0001750 0001750 00000000155 13310200540 020034 0 ustar dmitry dmitry 0000000 0000000 include README.md include changelog include LICENSE include test.py recursive-include test_data *.mkd *.html python-markdown-math-0.6/README.md 0000644 0001750 0001750 00000005064 13272610642 017600 0 ustar dmitry dmitry 0000000 0000000 [][Travis] [Travis]: https://travis-ci.org/mitya57/python-markdown-math Math extension for Python-Markdown ================================== This extension adds math formulas support to [Python-Markdown]. [Python-Markdown]: https://github.com/Python-Markdown/markdown Installation ------------ ### Install from PyPI ``` $ pip install python-markdown-math ``` ### Install locally Use `setup.py build` and `setup.py install` to build and install this extension, respectively. The extension name is `mdx_math`, so you need to add that name to your list of Python-Markdown extensions. Check [Python-Markdown documentation] for details on how to load extensions. [Python-Markdown documentation]: https://python-markdown.github.io/reference/#extensions Usage ----- To use this extension, you need to include [MathJax] library in HTML files, like: ```html ``` (replace `2.7.4` with the latest version if it is available). [MathJax]: https://www.mathjax.org/ Also, you need to specify a configuration for MathJax. Please note that most of standard configuratons include `tex2jax` extension, which is not needed with this code. Example of MathJax configuration: ```html ``` To pass the extension to Python-Markdown, use `mdx_math` as extension name. For example: ```python >>> md = markdown.Markdown(extensions=['mdx_math']) >>> md.convert('$$e^x$$') '
\n\n
' ``` Usage from the command line: ``` $ echo "\(e^x\)" | python3 -m markdown -x mdx_math``` Math Delimiters --------------- For inline math, use `\(...\)`. For standalone math, use `$$...$$`, `\[...\]` or `\begin...\end`. The single-dollar delimiter (`$...$`) for inline math is disabled by default, but can be enabled by passing `enable_dollar_delimiter=True` in the extension configuration. If you want to this extension to generate a preview node (which will be shown when MathJax has not yet processed the node, or when JavaScript is unavailable), use `add_preview=True` configuration option. Notes ----- If you use [ReText](https://github.com/retext-project/retext), this extension is not needed as it is included by default. python-markdown-math-0.6/python_markdown_math.egg-info/ 0000755 0001750 0001750 00000000000 13310733217 024237 5 ustar dmitry dmitry 0000000 0000000 python-markdown-math-0.6/python_markdown_math.egg-info/entry_points.txt 0000644 0001750 0001750 00000000071 13310733217 027533 0 ustar dmitry dmitry 0000000 0000000 [markdown.extensions] mdx_math = mdx_math:MathExtension python-markdown-math-0.6/python_markdown_math.egg-info/dependency_links.txt 0000644 0001750 0001750 00000000001 13310733217 030305 0 ustar dmitry dmitry 0000000 0000000 python-markdown-math-0.6/python_markdown_math.egg-info/SOURCES.txt 0000644 0001750 0001750 00000002065 13310733217 026126 0 ustar dmitry dmitry 0000000 0000000 LICENSE MANIFEST.in README.md changelog mdx_math.py setup.cfg setup.py test.py python_markdown_math.egg-info/PKG-INFO python_markdown_math.egg-info/SOURCES.txt python_markdown_math.egg-info/dependency_links.txt python_markdown_math.egg-info/entry_points.txt python_markdown_math.egg-info/top_level.txt test_data/beginend.html test_data/beginend.mkd test_data/beginend_preview.html test_data/inline.html test_data/inline_asciimath.html test_data/inline_asciimath.mkd test_data/inline_inside_standalone.html test_data/inline_inside_standalone.mkd test_data/inline_latex.mkd test_data/inline_latex_escaped.html test_data/inline_latex_escaped.mkd test_data/inline_latex_inside_code.html test_data/inline_latex_inside_code.mkd test_data/inline_preview.html test_data/inline_tex.mkd test_data/inline_tex_disabled.html test_data/inline_tex_escaped.html test_data/inline_tex_escaped.mkd test_data/standalone.html test_data/standalone_latex.mkd test_data/standalone_latex_escaped.html test_data/standalone_latex_escaped.mkd test_data/standalone_preview.html test_data/standalone_tex.mkd python-markdown-math-0.6/python_markdown_math.egg-info/top_level.txt 0000644 0001750 0001750 00000000011 13310733217 026761 0 ustar dmitry dmitry 0000000 0000000 mdx_math python-markdown-math-0.6/python_markdown_math.egg-info/PKG-INFO 0000644 0001750 0001750 00000007206 13310733217 025341 0 ustar dmitry dmitry 0000000 0000000 Metadata-Version: 2.1 Name: python-markdown-math Version: 0.6 Summary: Math extension for Python-Markdown Home-page: https://github.com/mitya57/python-markdown-math Author: Dmitry Shachnev Author-email: mitya57@gmail.com License: BSD Description: [][Travis] [Travis]: https://travis-ci.org/mitya57/python-markdown-math Math extension for Python-Markdown ================================== This extension adds math formulas support to [Python-Markdown]. [Python-Markdown]: https://github.com/Python-Markdown/markdown Installation ------------ ### Install from PyPI ``` $ pip install python-markdown-math ``` ### Install locally Use `setup.py build` and `setup.py install` to build and install this extension, respectively. The extension name is `mdx_math`, so you need to add that name to your list of Python-Markdown extensions. Check [Python-Markdown documentation] for details on how to load extensions. [Python-Markdown documentation]: https://python-markdown.github.io/reference/#extensions Usage ----- To use this extension, you need to include [MathJax] library in HTML files, like: ```html ``` (replace `2.7.4` with the latest version if it is available). [MathJax]: https://www.mathjax.org/ Also, you need to specify a configuration for MathJax. Please note that most of standard configuratons include `tex2jax` extension, which is not needed with this code. Example of MathJax configuration: ```html ``` To pass the extension to Python-Markdown, use `mdx_math` as extension name. For example: ```python >>> md = markdown.Markdown(extensions=['mdx_math']) >>> md.convert('$$e^x$$') '
\n\n
' ``` Usage from the command line: ``` $ echo "\(e^x\)" | python3 -m markdown -x mdx_math``` Math Delimiters --------------- For inline math, use `\(...\)`. For standalone math, use `$$...$$`, `\[...\]` or `\begin...\end`. The single-dollar delimiter (`$...$`) for inline math is disabled by default, but can be enabled by passing `enable_dollar_delimiter=True` in the extension configuration. If you want to this extension to generate a preview node (which will be shown when MathJax has not yet processed the node, or when JavaScript is unavailable), use `add_preview=True` configuration option. Notes ----- If you use [ReText](https://github.com/retext-project/retext), this extension is not needed as it is included by default. Platform: UNKNOWN Description-Content-Type: text/markdown python-markdown-math-0.6/setup.cfg 0000644 0001750 0001750 00000000103 13310733217 020124 0 ustar dmitry dmitry 0000000 0000000 [bdist_wheel] universal = 1 [egg_info] tag_build = tag_date = 0 python-markdown-math-0.6/mdx_math.py 0000644 0001750 0001750 00000006342 13310201364 020462 0 ustar dmitry dmitry 0000000 0000000 # -*- coding: utf-8 -*- ''' Math extension for Python-Markdown ================================== Adds support for displaying math formulas using [MathJax](http://www.mathjax.org/). Author: 2015-2017, Dmitry Shachnev