New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

marktree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marktree

convert headings in a Markdown file (.md) into a tree-like structure and output.

  • 1.1.1
  • PyPI
  • Socket score

Maintainers
1

marktree

GitHub License PyPI - Version PyPI - Downloads

This command converts headings in a Markdown file (.md) into a tree-like structure and outputs it.

Table of Contents

  • Table of Contents
  • Setup
  • Quick Usage
  • Usage
  • Dependencies

Setup

Install via pip:

pip install marktree

Handling the "Warning" on Windows

If you received a "Warning" when executing the above command on Windows, please refer to the following article.

Reference: Resolution for PATH not being set when using pip install in Python on Windows | Yusu Note

Quick Usage

$ marktree [Options] [foo.md]
OptionsDescription
marktree -hDisplay the help screen.
marktree --help_jpDisplay the help screen in Japanese.
marktree -L 3The -L option determines the level at which the tree is displayed.
marktree -CThe -C option outputs the Markdown text copied to the clipboard directly in tree format.

Example

Prepare the following Markdown named foo.md.

# h1 
## h2 
### h3 
#### h4 
#### h4 
## h2 
## h2
### h3 
#### h4 
##### h5 
###### h6 
### h3
# h1 
  • Regular output (default depth is 6):
$ marktree foo.md
├── h1 
│  ├── h2 
│  │  └── h3 
│  │     ├── h4 
│  │     └── h4 
│  ├── h2 
│  └── h2
│     ├── h3 
│     │  └── h4 
│     │     └── h5 
│     │        └── h6 
│     └── h3
└── h1 
  • Use -L 3 to determine the depth:
$ marktree -L 3 foo.md
├── h1 
│  ├── h2 
│  │  └── h3 
│  ├── h2 
│  └── h2
│     ├── h3 
│     └── h3
└── h1 
  • Use -C outputs the Markdown text copied to the clipboard directly in tree format. Additionally, -L can be used in combination:
$ marktree -C -L 3
├── h1 
│  ├── h2 
│  │  └── h3 
│  ├── h2 
│  └── h2
│     ├── h3 
│     └── h3
└── h1 

Usage

The marktree command outputs the file as a tree hierarchy, depending on the # of the Markdown file. The -L option specifies the depth, as in the original tree command. Note that the depth can be from 1 to 6, and specifying more than that will result in an error. The -C option outputs the Markdown text structure copied to the clipboard directly in tree format. This is convenient as it eliminates the need to copy the Markdown text to another file before outputting.

The order of the options is in no particular order, including the Markdown file to be passed. Also, if you pass multiple files like markdown foo.md hoge.md, only the last file will be converted and output.

Dependencies

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc