Skip to main content

An utility that is able to generate a table of contents for a markdown file.

Project description

Automatically generate a table of contents for a markdown file to improve document readability.

The table of contents generated by this program is designed to work with markdown parsers such as the one used by GitHub and GitLab.

When used with the in-place option this script will write the table of contents at the first occurrency of a marker. The default marker is [](TOC) which will result as invisible when reading the parsed markdown file.

Titles up to three indentation levels (in HTML: h1, h2, h3) will be included in the table of contents.

As a final remark, it is possible to generate an ordered and an unordered table of contents. In both cases, each element of the toc is a clickable link to a paragraph in the page.

Video

https://asciinema.org/a/155223.png

Documentation

http://frnmst.github.io/md-toc

Conventions

  • PEP.

  • 4 space indentation.

Help

usage: md_toc [-h] [-v] {wtoc} ...

Markdown Table Of Contents

positional arguments:
  {wtoc}
    wtoc         write the table of contents

  optional arguments:
    -h, --help     show this help message and exit
    -v, --version  show program's version number and exit

  Return values: 0 OK, 1 Error, 2 Invalid command

License

Copyright (C) 2017 frnmst (Franco Masotti) <franco.masotti@live.com> <franco.masotti@student.unife.it>

md-toc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

md-toc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with md-toc. If not, see <http://www.gnu.org/licenses/>.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md_toc-0.0.1.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md_toc-0.0.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file md_toc-0.0.1.tar.gz.

File metadata

  • Download URL: md_toc-0.0.1.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for md_toc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a78d34ad84b7fa3717e0dd5d955816f1320f9674df460383a3a6e9ef5672dd3a
MD5 fe063a952cd5613904b82ba63849391c
BLAKE2b-256 5835d6b33ae5d933e45c683db8a52fd1ec84a9db06c019a87ce77a23fb58a193

See more details on using hashes here.

File details

Details for the file md_toc-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for md_toc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7e566c9ce6dd15855b03dc4c66005e8bd725c34659c3d0cece843d98c4b677b
MD5 0c078cae00b5ad4ec48658f149123361
BLAKE2b-256 e4bbaba7c83a60011574a1e76c76b9fd0fb7f49dae21887ab9c34d53ad8aaaa5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page