Skip to main content

No project description provided

Project description

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

Project details


Download files

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

Source Distribution

md2tree-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2tree-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file md2tree-0.1.0.tar.gz.

File metadata

  • Download URL: md2tree-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.6 Linux/6.8.0-59-generic

File hashes

Hashes for md2tree-0.1.0.tar.gz
Algorithm Hash digest
SHA256 106b3f68098c60ae847f72a67425ad744b52178df7a729efd7a1394773be6f2b
MD5 b9b9d9aae52bf4c76897eca91049d785
BLAKE2b-256 45afa421692b7ed8dfaa4eef9d62903a37637ff248665f3c1e13b86becf35826

See more details on using hashes here.

File details

Details for the file md2tree-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: md2tree-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.6 Linux/6.8.0-59-generic

File hashes

Hashes for md2tree-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb12483e8bec3747213d420d172845efbaf25e43183dc08a5b33555c4bb9c1d4
MD5 5bc0de8dd67b14dab01986ab553cd050
BLAKE2b-256 d69cf723c8245881a2fc0ae59703d9a8b577580f1ada57b2610fcd51ea60d87b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page