Skip to main content

TOCinator

MIT license Py version GitHub tag

This python module parses your Markdown file and generates a Table of Content(TOC) for that file. It should be noted that this is still in development and may not always function as expected.

The TOC below was completely generated using this module.

Table of Content

  1. Features of this module
  2. Code Generated using tocinator
  3. Rendered Code
  4. Installation
  5. How to use this module
    1. What not to do
  6. General Layout

Features of this module

  1. Generate Markdown-ready code.
  2. Generated TOC has links to the actual headings and subheading. Which means you can just paste the generated code in your README file and click on any of the links to go to the desired heading.

Code Generated using tocinator

Below is an example of TOC generated using tocinator. The README used in the below snippets is from my other repository. Do check it out if you code in C, it might be of your interest. Code

Rendered Code

Render

Installation

With pip

$ pip3 install tocinator

Without pip

  1. Clone this repository.
$ git clone git@github.com:Coder-RG/tocinator
  1. Change directory to cloned repository.
$ cd tocinator
  1. Run the file at command line:
$ python3 src/tocinator/tocinator.py <input-file> <output-file>

How to use this module

  1. Use ## for headings
  2. Use ### for subheadings.

Example 1: (installed with pip)

$ python3 -m tocinator README.md OUT.md

Example 2: (installed without pip)

$ python3 src/tocinator/tocinator.py README.md OUT.md

If the .md file is in another folder, then use absolute path.

$ python3 src/tocinator/tocinator.py <path-to-folder>/README.md <path-to-folder>/TEST.md

Example 3: (installed without pip)

$ python3 src/tocinator/tocinator.py /home/username/project/README.md /home/username/project/OUT.md

What not to do

  1. # and #### are not used in the parsing yet and therefore won't be displayed in the TOC.
  2. Only use alphanumeric for heading and subheadings. Otherwise, the links won't work.

General Layout

Code

Render

Code is rendered using grip module. Do check out grip if you want to render your markdown files in your browser.

Metadata

Release files for tocinator 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tocinator 1.0.2
File Size Uploaded
tocinator-1.0.2.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tocinator 1.0.2
File Interpreter ABI Platform
tocinator-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / tocinator-1.0.2.tar.gz

Download URL tocinator-1.0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3bc396a83c4bf5abbcc44f05d35678ae0a614d17abdba792273ad3dad2f2587f
BLAKE2b-256 checksum
How to use checksums
be393b063dfe41e7a1aa8bfcab79f20ce4d66849f0801cb6f5e1d4ad88011f82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release files / tocinator-1.0.2-py3-none-any.whl

Download URL tocinator-1.0.2-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a54801735e2185e8456ccca3857f72a23a32c9a0d8101a532ee94594296c89e
BLAKE2b-256 checksum
How to use checksums
12530556b988037ec2db8477dfb12e8afddb9b50402f8b367373b195ec3d22e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page