toc4github
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
$ 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:
$ 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.
# how to import
from toc4github import make_toc
# signature
make_toc(lines: Iterable[str]|str) -> str
Showcase
In addition, All my repos' TOC are generated by toc4github. Have fun ... ^___^
Metadata
Release files for toc4github 0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| toc4github-0.17.tar.gz | 29.2 kB | Without provenance | Details for toc4github-0.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| toc4github-0.17-py3-none-any.whl | Python 3 | none | any | Details for toc4github-0.17-py3-none-any.whl |
Total release size: 33.8 kB
Release files / toc4github-0.17.tar.gz
| Download URL | toc4github-0.17.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4a937c38a75b4552b26fbaff87a8da21b64052fe9dadc469908eba4c65675ad
|
|
BLAKE2b-256 checksum How to use checksums |
8b3124281a6cabd4e105e5af71e8eeb11a529d12bef04173c1ac6df7735f661e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.3
|
Release files / toc4github-0.17-py3-none-any.whl
| Download URL | toc4github-0.17-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
464f862927590f92c34c39f41d4c9fdc5cd4c6251c06d155ca19c774d558255f
|
|
BLAKE2b-256 checksum How to use checksums |
7828359de1e2f602edf29f754afd89b2719c73efd8d29f67e55fdaec70046d5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.3
|
Security for toc4github 0.17
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.