markdown-tree-parser
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 = '''
Title
=====
# Code
Code 1
------
Some text
\```
# TODO
\```
Code 2
------
\```python
# TODO
print('test')
\```
# 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__':
unittest.main()
Metadata
Release files for markdown-tree-parser 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markdown_tree_parser-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / markdown_tree_parser-0.1-py3-none-any.whl
| Download URL | markdown_tree_parser-0.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3677cd3407f231599b0402a2cf6d6bcd54991c7c634f10ac2597270622847177
|
|
BLAKE2b-256 checksum How to use checksums |
3075809064911f0df86734d995d5d6529e59338a52c440eebfebdd357642d13b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.4
|