toc4github


Nametoc4github JSON
Version 0.17 PyPI version JSON
download
home_page
SummaryTo automatically generate Table of Contents (TOC) for markdown file, especially for README.md of Github.com
upload_time2023-10-04 03:45:57
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2020 xinlin 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 readme.md toc github markdown
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # toc4github

* [Install](#Install)
* [Usage](#Usage)
* [Showcase](#Showcase)

The `toc4github` is a very tiny tool to automatically generate Table of
Contents (TOC) for Markdown file, especially for README.md in Github.com.
It might also be used for other markdown rendering system, but
I never tested! :)

## Install

``` shell
$ pip install toc4github
$ python -m toc4github -h  # inline help
```

## Usage

You should insert a placeholder which is `{toc}` in README.md. The
placeholder ocuppies a whole line. Then:

``` shell
$ python -m toc4github [-d] [-t TITLE] <path/to/README.md>
```

Now, the placeholder is replaced by TOC generated with an optional title,
and your markdown file is updated.

Or, you can call `make_toc` interface in your python code. It returns
the TOC as string in accordance with input, and you can do anything
you want with it.

``` python
# how to import
from toc4github import make_toc
# signature
make_toc(lines: Iterable[str]|str) -> str
```

## Showcase

![toc4github](/showcase.png)

In addition, All my repos' TOC are generated by toc4github.
Have fun ... ^___^


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "toc4github",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "README.md,TOC,github,markdown",
    "author": "",
    "author_email": "xinlin-z <xinlin.zhang@hotmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8b/31/24281a6cabd4e105e5af71e8eeb11a529d12bef04173c1ac6df7735f661e/toc4github-0.17.tar.gz",
    "platform": null,
    "description": "# toc4github\n\n* [Install](#Install)\n* [Usage](#Usage)\n* [Showcase](#Showcase)\n\nThe `toc4github` is a very tiny tool to automatically generate Table of\nContents (TOC) for Markdown file, especially for README.md in Github.com.\nIt might also be used for other markdown rendering system, but\nI never tested! :)\n\n## Install\n\n``` shell\n$ pip install toc4github\n$ python -m toc4github -h  # inline help\n```\n\n## Usage\n\nYou should insert a placeholder which is `{toc}` in README.md. The\nplaceholder ocuppies a whole line. Then:\n\n``` shell\n$ python -m toc4github [-d] [-t TITLE] <path/to/README.md>\n```\n\nNow, the placeholder is replaced by TOC generated with an optional title,\nand your markdown file is updated.\n\nOr, you can call `make_toc` interface in your python code. It returns\nthe TOC as string in accordance with input, and you can do anything\nyou want with it.\n\n``` python\n# how to import\nfrom toc4github import make_toc\n# signature\nmake_toc(lines: Iterable[str]|str) -> str\n```\n\n## Showcase\n\n![toc4github](/showcase.png)\n\nIn addition, All my repos' TOC are generated by toc4github.\nHave fun ... ^___^\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2020 xinlin  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": "To automatically generate Table of Contents (TOC) for markdown file, especially for README.md of Github.com",
    "version": "0.17",
    "project_urls": {
        "homepage": "https://github.com/xinlin-z/toc4github"
    },
    "split_keywords": [
        "readme.md",
        "toc",
        "github",
        "markdown"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7828359de1e2f602edf29f754afd89b2719c73efd8d29f67e55fdaec70046d5a",
                "md5": "85d0a84f55e00de9ec171af3dbf84a37",
                "sha256": "464f862927590f92c34c39f41d4c9fdc5cd4c6251c06d155ca19c774d558255f"
            },
            "downloads": -1,
            "filename": "toc4github-0.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "85d0a84f55e00de9ec171af3dbf84a37",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4597,
            "upload_time": "2023-10-04T03:45:55",
            "upload_time_iso_8601": "2023-10-04T03:45:55.685844Z",
            "url": "https://files.pythonhosted.org/packages/78/28/359de1e2f602edf29f754afd89b2719c73efd8d29f67e55fdaec70046d5a/toc4github-0.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b3124281a6cabd4e105e5af71e8eeb11a529d12bef04173c1ac6df7735f661e",
                "md5": "41407562a1fdea3b62966b6cef7f2d28",
                "sha256": "e4a937c38a75b4552b26fbaff87a8da21b64052fe9dadc469908eba4c65675ad"
            },
            "downloads": -1,
            "filename": "toc4github-0.17.tar.gz",
            "has_sig": false,
            "md5_digest": "41407562a1fdea3b62966b6cef7f2d28",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 29184,
            "upload_time": "2023-10-04T03:45:57",
            "upload_time_iso_8601": "2023-10-04T03:45:57.571584Z",
            "url": "https://files.pythonhosted.org/packages/8b/31/24281a6cabd4e105e5af71e8eeb11a529d12bef04173c1ac6df7735f661e/toc4github-0.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-04 03:45:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xinlin-z",
    "github_project": "toc4github",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "toc4github"
}
        
Elapsed time: 0.12020s