Difference between revisions of "Md-toc"
m (Updated version.) |
(Updated to new release.) |
||
Line 2: | Line 2: | ||
|Name=md-toc | |Name=md-toc | ||
|Short description=Automatically generate a compliant table of contents for a markdown file to improve document readability | |Short description=Automatically generate a compliant table of contents for a markdown file to improve document readability | ||
− | |Full description=The table of contents (a.k.a: TOC) generated by this program is designed to | + | |Full 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. | 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 TOC at the first | + | When used with the in-place option this script will write the TOC at the first |
− | occurrency of a marker. The default marker is `` | + | occurrency of a marker. The default marker is ``<!--TOC-->``, which, being |
− | result invisible after the markdown file has been translated. | + | 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``, | + | 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 | ``h3``) will be included in the TOC but the user can decide to keep all | ||
possible levels. | possible levels. | ||
Line 15: | Line 16: | ||
md_toc makes it is possible to generate ordered and unordered TOCs. | md_toc makes it is possible to generate ordered and unordered TOCs. | ||
In both cases each element of the TOC is by default a | 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 | + | link to a paragraph in the web page. It is also possible to generate |
− | a non-linked version of the TOC. | + | a non-linked version of the TOC. |
If the user wants it, there is the possibility to ignore space indentations | If the user wants it, there is the possibility to ignore space indentations | ||
− | within the TOC. | + | 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 | + | Rules for generating the TOC are determined by the selected |
− | markdown parser. md-toc aimes infact to be as conformant as possible in | + | 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 | + | respect to each one of them. This was possible by studying the available |
documentations and by reverse engineering the source codes. | documentations and by reverse engineering the source codes. | ||
|Homepage URL=https://github.com/frnmst/md-toc | |Homepage URL=https://github.com/frnmst/md-toc | ||
Line 32: | Line 33: | ||
|Decommissioned or Obsolete=No | |Decommissioned or Obsolete=No | ||
|Keywords=markdown, md, table-of-contents, toc | |Keywords=markdown, md, table-of-contents, toc | ||
− | |Version identifier= | + | |Version identifier=6.0.0 |
− | |Version date=2019/ | + | |Version date=2019/06/12 |
|Version status=alpha | |Version status=alpha | ||
|Version download=https://github.com/frnmst/md-toc/archive/5.0.1.tar.gz | |Version download=https://github.com/frnmst/md-toc/archive/5.0.1.tar.gz | ||
− | |Version comment= | + | |Version comment=Added skip lines option. Fixed indentation spaces issue. Other fixes. |
|Last review by=Frnmst | |Last review by=Frnmst | ||
− | |Last review date=2019/ | + | |Last review date=2019/06/12 |
|Submitted date=2018/01/27 | |Submitted date=2018/01/27 | ||
|User level=intermediate | |User level=intermediate | ||
Line 101: | Line 102: | ||
|Prerequisite kind=Required to build | |Prerequisite kind=Required to build | ||
|Prerequisite description=Sphinx | |Prerequisite description=Sphinx | ||
+ | }} | ||
+ | {{Software prerequisite | ||
+ | |Prerequisite kind=Required to use | ||
+ | |Prerequisite description=Setuptools | ||
+ | }} | ||
+ | {{Software prerequisite | ||
+ | |Prerequisite kind=Required to build | ||
+ | |Prerequisite description=Alabaster | ||
}} | }} | ||
{{Featured}} | {{Featured}} |
Revision as of 11:04, 12 June 2019
md-toc
https://blog.franco.net.eu.org/software/#md-toc
Automatically generate and add an accurate table of contents to markdown files.
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.
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.
GitHub and GitLab have introduced their version of the markdown TOC after md-toc and similar tools were created:
- in March 2021 GitHub added an interactive TOC button at the top-left of readme files. This system works for markdown and others
- GitLab added an extension called Table of contents to its Gitlab Flavored Mardown
Features
- works offline
- edits file in place using a TOC marker or output to standard output
- maximum heading level selection (1 to 6)
- list indentation based on heading, which can optionally be disabled
- outputs an ordered or unordered TOC list
- creates anchor links to markdown headings by default or a plain list as alternative
- checks if heading level is coherent: this avoid creating an erroneous TOC. This feature can be disabled if needed
- skip any number lines before generating the TOC
- can read content from standard input
- handles multiple files at once
- selection of newline string
- check if there is difference between existing TOC in file and newly generated one
- selection of list marker
- supports GitHub, GitLab, Commonmark, Redcarpet and others
- pre-commit md-toc hook
And more! See the feature comparison table
Documentation
Documentation at: https://docs.franco.net.eu.org/md-toc/
Download
https://blog.franco.net.eu.org/software/md-toc-8.2.0/md-toc-8.2.0.tar.gz
version 8.2.0
(beta)
released on 8 August 2023
OpenPGP signature URL: https://blog.franco.net.eu.org/software/md-toc-8.2.0/md-toc-8.2.0.tar.gz.sig
OpenPGP public key: https://blog.franco.net.eu.org/pubkeys/pgp_pubkey_since_2019.txt
User level
IntermediateMicroblog

Donate link
https://www.buymeacoffee.com/frnmstAccepts cryptocurrency donations.
VCS Checkout
Categories
Related Projects
Licensing
License
Verified by
Verified on
Notes
License
Verified by
agyaanapan
Verified on
13 June 2021
Notes
See also https://docs.franco.net.eu.org/md-toc/copyright_license.html for a list of all the licenses used.
Leaders and contributors
Contact(s) | Role |
---|---|
Resources and communication
Audience | Resource type | URI |
---|---|---|
Users, Developers | Bug Tracking | https://framagit.org/frnmst/md-toc/-/issues |
Users, Developers | Changelog | https://blog.franco.net.eu.org/software/CHANGELOG-md-toc.html |
Users, Developers | Bug Tracking | https://software.franco.net.eu.org/frnmst/md-toc/issues |
Users, Developers | Bug Tracking | https://codeberg.org/frnmst/md-toc/issues |
Documentation | Support | https://docs.franco.net.eu.org/md-toc/ |
Video | Support | https://redirect.invidious.io/watch?v=guyVdPNmC0A |
Users, Developers | Bug Tracking | https://github.com/frnmst/md-toc/issues |
Python (Ref) | https://pypi.org/project/md-toc |
Software prerequisites
Kind | Description |
---|---|
Required to build | python3-build |
Required to build | flake8-docstrings |
Required to build | sphinx-copybutton |
Required to build | sphinx-book-theme |
Weak prerequisite | pyfakefs |
Required to build | venv |
Required to use | https://blog.franco.net.eu.org/software/#fpyutils |
Required to build | Flake8 |
Required to use | Setuptools |
Required to build | Sphinx |
Required to use | Python 3 |
This entry (in part or in whole) was last reviewed on 8 August 2023.
Version comment
Release 8.2.0 - Add the new `--diff` option - Add more comparisons in the feature tables (see documentation) - Closed old issue for inactivity
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.
The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.