All Projects → frnmst → md-toc

frnmst / md-toc

Licence: GPL-3.0 License
Automatically generate a compliant table of contents for a markdown file to improve document readability

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to md-toc

YAFRA
YAFRA is a semi-automated framework for analyzing and representing reports about IT Security incidents.
Stars: ✭ 22 (+22.22%)
Mutual labels:  gitlab
svn2git
Tool to help and automate migration from SVN to GitLab
Stars: ✭ 34 (+88.89%)
Mutual labels:  gitlab
gitlab task manager
Microsoft Todo inspired task manager leveraging Gitlab's Issue Tracker as the backend
Stars: ✭ 22 (+22.22%)
Mutual labels:  gitlab
github-templates
Good templates for the issue, pull request, and contributing templates on GitHub, GitLab, and Bitbucket.
Stars: ✭ 65 (+261.11%)
Mutual labels:  gitlab
GitHub-Web-IDE
⚡ Open GitHub repositories in online web IDE
Stars: ✭ 242 (+1244.44%)
Mutual labels:  gitlab
gitlab ynh
GitLab package for YunoHost
Stars: ✭ 17 (-5.56%)
Mutual labels:  gitlab
cmark-scala
Parse, manipulate and render CommonMark in Scala Native
Stars: ✭ 13 (-27.78%)
Mutual labels:  commonmark
ganttlab
A live Gantt chart for GitLab and GitHub
Stars: ✭ 30 (+66.67%)
Mutual labels:  gitlab
nwotable
One app for all your notes on all your devices.
Stars: ✭ 22 (+22.22%)
Mutual labels:  commonmark
obsidian
A WordPress starter kit for the modern web.
Stars: ✭ 20 (+11.11%)
Mutual labels:  gitlab
monolog-http
A collection of monolog handlers that use a PSR-18 HTTP Client to send your logs
Stars: ✭ 34 (+88.89%)
Mutual labels:  gitlab
geet
Command line interface for performing Git hosting service operations
Stars: ✭ 14 (-22.22%)
Mutual labels:  gitlab
rocketchat-gitlab-hook
Add GitLab notifications via a new WebHook in Rocket.Chat
Stars: ✭ 80 (+344.44%)
Mutual labels:  gitlab
gmail-gitlab-filtering
Google Apps Script for Gmail to filter and sort email from GitLab
Stars: ✭ 84 (+366.67%)
Mutual labels:  gitlab
pipelines-as-code
Pipelines as Code
Stars: ✭ 37 (+105.56%)
Mutual labels:  gitlab
gnome-shell-extensions-sync
Syncs gnome shell keybindings, tweaks settings and extensions with their configuration across all gnome installations
Stars: ✭ 188 (+944.44%)
Mutual labels:  gitlab
vim-eightheader
Vim plugin: Easily create custom headlines, foldtext, toc, etc
Stars: ✭ 17 (-5.56%)
Mutual labels:  table-of-contents
gitlab-setup
A Packer / Terraform / Ansible configuration to install Gitlab and Gitlab-CI
Stars: ✭ 53 (+194.44%)
Mutual labels:  gitlab
gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (+27.78%)
Mutual labels:  gitlab
gitlab-job-log-viewer
Browser extension for code highlighting raw logs in Gitlab CI
Stars: ✭ 21 (+16.67%)
Mutual labels:  gitlab

Markdown Table Of Contents

PyPI md-toc version Debian 12 package nixpkgs unstable package Downloads Dependent repos (via libraries.io) pre-commit Buy me a coffee

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

Video

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

Description

The table of contents (a.k.a: TOC) generated by this program is designed to work with several markdown parsers such as the ones used by GitHub and GitLab.

When used with the in-place option this script will write the TOC at the first occurrency of a marker. The default marker is <!--TOC-->, which, being an HTML comment, will result invisible after the markdown file has been translated.

By default titles up to three indentation levels (in HTML: h1, h2, h3) will be included in the TOC but the user can decide to keep all possible levels.

md_toc makes it is possible to generate ordered and unordered TOCs. In both cases each element of the TOC is by default a link to a paragraph in the web page. It is also possible to generate a non-linked version of the TOC.

If the user wants it, there is the possibility to ignore space indentations within the TOC and to skip an initial number of lines from the markdown file.

Rules for generating the TOC are determined by the selected markdown parser. md-toc aimes infact to be as conformant as possible in respect to each one of them. This was possible by studying the available documentations and by reverse engineering the source codes.

Documentation

https://docs.franco.net.eu.org/md-toc/

Please read carefully the Markdown specification section of the documentation to learn how this program parsers markdown files and builds a correct output.

API examples

md-toc has a public API. This means for example that you can you easily build a TOC within another Python program. The easiest way to build one for a markdown file is:

>>> import md_toc
>>> f = open('foo.md')
>>> print(f.read(), end='')
# this
## is
## a
### foo
#### booo
### foo
## file

## bye

# bye
>>> print(md_toc.build_toc('foo.md'), end='')
- [this](#this)
  - [is](#is)
  - [a](#a)
    - [foo](#foo)
    - [foo](#foo-1)
  - [file](#file)
  - [bye](#bye)
- [bye](#bye-1)

CLI Helps

$ md_toc --help
$ md_toc github --help
$ md_toc redcarpet --help

License

Copyright (C) 2017-2022 Franco Masotti (franco DoT masotti {-A-T-} tutanota DoT com)

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/>.

Changelog and trusted source

You can check the authenticity of new releases using my public key.

Changelogs, instructions, sources and keys can be found at blog.franco.net.eu.org/software.

Crypto donations

  • Bitcoin: bc1qnkflazapw3hjupawj0lm39dh9xt88s7zal5mwu
  • Monero: 84KHWDTd9hbPyGwikk33Qp5GW7o7zRwPb8kJ6u93zs4sNMpDSnM5ZTWVnUp2cudRYNT6rNqctnMQ9NbUewbj7MzCBUcrQEY
  • Dogecoin: DMB5h2GhHiTNW7EcmDnqkYpKs6Da2wK3zP
  • Vertcoin: vtc1qd8n3jvkd2vwrr6cpejkd9wavp4ld6xfu9hkhh0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].