Skip to main content

Markdown tree parser

Project description


Parse markdown file to python object, which contains markdown tree headings

Usage examples

import unittest

from markdown_tree_parser.parser import parse_string

class TestParser(unittest.TestCase):

    def test_code_block(self):
        text = '''

# Code

Code 1
Some text

Code 2

# Heading
        out = parse_string(text)
        self.assertEqual(out.title, 'Title')
        self.assertEqual(out[0][0].text, 'Code 1')
        self.assertEqual(out[0][0].source, 'Some text\n```\n# TODO\n```\n')
        self.assertEqual(out[0][1].text, 'Code 2')
        self.assertEqual(out[0][1].source, "```python\n# TODO\nprint('test')\n```\n")
        self.assertEqual(out[1].text, 'Heading')

if __name__ == '__main__':

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for markdown-tree-parser, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size markdown_tree_parser-0.1-py3-none-any.whl (5.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page