markdown2 Documentation

repository·master·Indexed 25 days ago

https://github.com/trentm/python-markdown2

A fast and complete Python implementation of Markdown designed to match the behavior of the original Perl-implemented Markdown.pl. It supports a variety of extensions called 'extras' for features such as tables, footnotes, and syntax highlighting, and can be used as both a Python module and a CLI script.

Tokens
425
Snippets
3
Records
6
Agent score
34%

What's inside markdown2

  1. Run performance benchmarks

    master
    After generating test cases, you can run the performance comparison script ./perf.py. This script processes the Markdown files in the cases/*.txt directory using various implementations, including Markdown.pl, markdown.py, and markdown2.py.
    ./perf.py
  2. Install markdown2

    master

    You can install markdown2 using pip, pypm, or by running the setup script. To include all optional dependencies (such as Pygments for code syntax highlighting), use the [all] extra.

    pip install markdown2
    pip install markdown2[all]
    pypm install markdown2
    easy_install markdown2
    python setup.py install
  3. Generate performance test cases

    master

    To generate test cases for performance testing, run the gen_perf_cases.py script. You can optionally provide a limit to specify the maximum number of recipes from the Python Cookbook dataset to use for generating test files. The generated files are small .txt files stored in the cases directory.

    ./gen_perf_cases.py 1000
  4. Enable extras (extensions) in markdown2

    master
    markdown2 supports optional syntax features called "extras" (e.g., footnotes, tables, syntax-highlighting, toc, smartypants). You can enable them via the CLI using the --extras flag or via the Python API by passing a list of names to the extras argument.