marktree


Namemarktree JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/yusu79/marktree
Summaryconvert headings in a Markdown file (.md) into a tree-like structure and output.
upload_time2024-02-10 20:33:41
maintainer
docs_urlNone
authoryusu79
requires_python>=3.8
licenseMIT License Copyright (c) 2024 yusu79 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords markdown tree pyperclip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # marktree

![GitHub License](https://img.shields.io/github/license/yusu79/marktree)
![PyPI - Version](https://img.shields.io/pypi/v/marktree)
![PyPI - Downloads](https://img.shields.io/pypi/dm/marktree)

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

## Table of Contents
- [Table of Contents](#table-of-contents)
- [Setup](#setup)
- [Quick Usage](#quick-usage)
- [Usage](#usage)
- [Dependencies](#dependencies)

## Setup
Install via pip:
```bash
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](https://yusu79.com/python-path-issue/)


## Quick Usage
```bash
$ marktree [Options] [foo.md]
```


| Options            | Description                                                                                        | 
| ------------------ | -------------------------------------------------------------------------------------------------- | 
| marktree -h        | Display the help screen.                                                                           | 
| marktree --help_jp | Display the help screen in Japanese.                                                               | 
| marktree -L 3      | The -L option determines the level at which the tree is displayed.                                 | 
| marktree -C        | The -C option outputs the Markdown text copied to the clipboard directly in tree format. | 

### Example
Prepare the following Markdown named `foo.md`.
```md
# h1 
## h2 
### h3 
#### h4 
#### h4 
## h2 
## h2
### h3 
#### h4 
##### h5 
###### h6 
### h3
# h1 
```

- Regular output (default depth is 6):
```bash
$ marktree foo.md
├── h1 
│  ├── h2 
│  │  └── h3 
│  │     ├── h4 
│  │     └── h4 
│  ├── h2 
│  └── h2
│     ├── h3 
│     │  └── h4 
│     │     └── h5 
│     │        └── h6 
│     └── h3
└── h1 
```

- Use `-L 3` to determine the depth:
```bash
$ 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:
```bash
$ 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
- [pyperclip](https://github.com/asweigart/pyperclip)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yusu79/marktree",
    "name": "marktree",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "markdown,tree,pyperclip",
    "author": "yusu79",
    "author_email": "oss@yusu79.com",
    "download_url": "https://files.pythonhosted.org/packages/e9/7e/407a2805f7d6ae3991766688d500a4c44d2276481a1a33b8262c0fe5fbb9/marktree-1.1.0.tar.gz",
    "platform": null,
    "description": "# marktree\r\n\r\n![GitHub License](https://img.shields.io/github/license/yusu79/marktree)\r\n![PyPI - Version](https://img.shields.io/pypi/v/marktree)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/marktree)\r\n\r\nThis command converts headings in a Markdown file (.md) into a tree-like structure and outputs it.\r\n\r\n## Table of Contents\r\n- [Table of Contents](#table-of-contents)\r\n- [Setup](#setup)\r\n- [Quick Usage](#quick-usage)\r\n- [Usage](#usage)\r\n- [Dependencies](#dependencies)\r\n\r\n## Setup\r\nInstall via pip:\r\n```bash\r\npip install marktree\r\n```\r\n\r\n### Handling the \"Warning\" on Windows\r\n\r\n\r\nIf you received a \"Warning\" when executing the above command on Windows, please refer to the following article.\r\n\r\nReference: [Resolution for PATH not being set when using pip install in Python on Windows | Yusu Note](https://yusu79.com/python-path-issue/)\r\n\r\n\r\n## Quick Usage\r\n```bash\r\n$ marktree [Options] [foo.md]\r\n```\r\n\r\n\r\n| Options            | Description                                                                                        | \r\n| ------------------ | -------------------------------------------------------------------------------------------------- | \r\n| marktree -h        | Display the help screen.                                                                           | \r\n| marktree --help_jp | Display the help screen in Japanese.                                                               | \r\n| marktree -L 3      | The -L option determines the level at which the tree is displayed.                                 | \r\n| marktree -C        | The -C option outputs the Markdown text copied to the clipboard directly in tree format. | \r\n\r\n### Example\r\nPrepare the following Markdown named `foo.md`.\r\n```md\r\n# h1 \r\n## h2 \r\n### h3 \r\n#### h4 \r\n#### h4 \r\n## h2 \r\n## h2\r\n### h3 \r\n#### h4 \r\n##### h5 \r\n###### h6 \r\n### h3\r\n# h1 \r\n```\r\n\r\n- Regular output (default depth is 6):\r\n```bash\r\n$ marktree foo.md\r\n\u251c\u2500\u2500 h1 \r\n\u2502  \u251c\u2500\u2500 h2 \r\n\u2502  \u2502  \u2514\u2500\u2500 h3 \r\n\u2502  \u2502     \u251c\u2500\u2500 h4 \r\n\u2502  \u2502     \u2514\u2500\u2500 h4 \r\n\u2502  \u251c\u2500\u2500 h2 \r\n\u2502  \u2514\u2500\u2500 h2\r\n\u2502     \u251c\u2500\u2500 h3 \r\n\u2502     \u2502  \u2514\u2500\u2500 h4 \r\n\u2502     \u2502     \u2514\u2500\u2500 h5 \r\n\u2502     \u2502        \u2514\u2500\u2500 h6 \r\n\u2502     \u2514\u2500\u2500 h3\r\n\u2514\u2500\u2500 h1 \r\n```\r\n\r\n- Use `-L 3` to determine the depth:\r\n```bash\r\n$ marktree -L 3 foo.md\r\n\u251c\u2500\u2500 h1 \r\n\u2502  \u251c\u2500\u2500 h2 \r\n\u2502  \u2502  \u2514\u2500\u2500 h3 \r\n\u2502  \u251c\u2500\u2500 h2 \r\n\u2502  \u2514\u2500\u2500 h2\r\n\u2502     \u251c\u2500\u2500 h3 \r\n\u2502     \u2514\u2500\u2500 h3\r\n\u2514\u2500\u2500 h1 \r\n```\r\n- Use `-C` outputs the Markdown text copied to the clipboard directly in tree format. Additionally, `-L` can be used in combination:\r\n```bash\r\n$ marktree -C -L 3\r\n\u251c\u2500\u2500 h1 \r\n\u2502  \u251c\u2500\u2500 h2 \r\n\u2502  \u2502  \u2514\u2500\u2500 h3 \r\n\u2502  \u251c\u2500\u2500 h2 \r\n\u2502  \u2514\u2500\u2500 h2\r\n\u2502     \u251c\u2500\u2500 h3 \r\n\u2502     \u2514\u2500\u2500 h3\r\n\u2514\u2500\u2500 h1 \r\n```\r\n\r\n\r\n## Usage\r\n\r\nThe `marktree` command outputs the file as a tree hierarchy, depending on the `#` of the Markdown file. \r\nThe `-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.\r\nThe `-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.\r\n\r\nThe 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.\r\n\r\n## Dependencies\r\n- [pyperclip](https://github.com/asweigart/pyperclip)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 yusu79  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "convert headings in a Markdown file (.md) into a tree-like structure and output.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://yusu79.com",
        "Repository": "https://github.com/yusu79/marktree"
    },
    "split_keywords": [
        "markdown",
        "tree",
        "pyperclip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a44212c9df87006d07098854c3c1ba7d06015396f99278eb9da4f459a631ea4e",
                "md5": "08b1bd2d1732f5c91681065a197af44d",
                "sha256": "19de1f8c27fea3c49974da2003b6b888700323d5f1740a021991151004cab726"
            },
            "downloads": -1,
            "filename": "marktree-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "08b1bd2d1732f5c91681065a197af44d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6106,
            "upload_time": "2024-02-10T20:33:39",
            "upload_time_iso_8601": "2024-02-10T20:33:39.630040Z",
            "url": "https://files.pythonhosted.org/packages/a4/42/12c9df87006d07098854c3c1ba7d06015396f99278eb9da4f459a631ea4e/marktree-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e97e407a2805f7d6ae3991766688d500a4c44d2276481a1a33b8262c0fe5fbb9",
                "md5": "933c1f8991bceaab723adf5567e93672",
                "sha256": "1087168003d0c3e5384e675a917707909639f081930b7613825cdf0274f45077"
            },
            "downloads": -1,
            "filename": "marktree-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "933c1f8991bceaab723adf5567e93672",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6366,
            "upload_time": "2024-02-10T20:33:41",
            "upload_time_iso_8601": "2024-02-10T20:33:41.311686Z",
            "url": "https://files.pythonhosted.org/packages/e9/7e/407a2805f7d6ae3991766688d500a4c44d2276481a1a33b8262c0fe5fbb9/marktree-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-10 20:33:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yusu79",
    "github_project": "marktree",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "marktree"
}
        
Elapsed time: 0.17943s