Skip to main content

Convert Markdown to Tree (Dictonary)

This module is going to convert markdown(.md) file into tree-structure-object. The tree object will be exported as treelib, which is defined on this repository (https://github.com/caesar0301/treelib)

Set Up

poetry add git+https://github.com/kevin-tofu/md2tree.git

Usage

How to convert markdown file into treelib

import md2tree

tree = md2tree.file2tree(
    'README.md'
)
print(tree)

md2tree.tree2file(
    './tree.json',
    tree,
    'root'
)

print function shows graph structure like below using treelib

root
└── Convert Markdown to Tree (Dictonary)
    ├── Set Up
    └── Usage
        └── Functions

The function 'md2tree.tree2file' exports graph with data as json file

{
  "name": "root",
  "data": null,
  "children": [
    {
      "name": "1",
      "data": {
        "title": "Convert Markdown to Tree (Dictonary)",
        "texts": [
          "\n",
          " This module is going to convert markdown(.md) file into tree-structure-object.\n",
          "\n"
        ]
      },
...

Functions

Functions Description
file2tree
lines2tree
tree2dict
tree2file

Metadata

Release files for md2tree 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for md2tree 0.1.0
File Size Uploaded
md2tree-0.1.0.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for md2tree 0.1.0
File Interpreter ABI Platform
md2tree-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / md2tree-0.1.0.tar.gz

Download URL md2tree-0.1.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
106b3f68098c60ae847f72a67425ad744b52178df7a729efd7a1394773be6f2b
BLAKE2b-256 checksum
How to use checksums
45afa421692b7ed8dfaa4eef9d62903a37637ff248665f3c1e13b86becf35826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.6 Linux/6.8.0-59-generic

Release files / md2tree-0.1.0-py3-none-any.whl

Download URL md2tree-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb12483e8bec3747213d420d172845efbaf25e43183dc08a5b33555c4bb9c1d4
BLAKE2b-256 checksum
How to use checksums
d69cf723c8245881a2fc0ae59703d9a8b577580f1ada57b2610fcd51ea60d87b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.6 Linux/6.8.0-59-generic

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page