开源软件名称(OpenSource Name):rasbt/markdown-toclify开源软件地址(OpenSource Url):https://github.com/rasbt/markdown-toclify开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):markdown-toclifymarkdown_toclify.py is a Python command line script that adds a Table of Contents with internal section-links to Markdown documents. This project is hosted at: https://github.com/rasbt/markdown-toclify. Compatible to CommonMark (formerly known as Common Markdown). Sebastian Raschka 2014-2015 Requires: UsageYou can simply copy the stand_alone script ./markdown_toclify/markdown_toclify.py to a local directory on your computer and use it from there. The basic usage is quite simple, you just need to provide a Markdown-formatted input file and the modified Markdown contents will be printed to the standard output screen.
Command line argumentspositional arguments: input.md path to the Markdown input file optional arguments: -h, --help show this help message and exit -o output.md, --output output.md path to the Markdown output file -b, --back_to_top add [back to top] links. -g, --github omits id-anchor tags (recommended for GitHub) -s pixels, --spacer pixels add horizontal space (in pixels) after the table of contents -n, --nolink create the table of contents without internal links -e EXCLUDE_H, --exclude_h EXCLUDE_H exclude eading levels, e.g., "2,3" to exclude all level 2 and 3 headings --placeholder PLACEHOLDER inserts TOC at the placeholder string instead of inserting it on top of the document --no_toc_header suppresses the Table of Contents header --remove_dashes Removes dashes from generated slugs -v, --version show program's version number and exit Using the Python moduleAlternatively, markdown_toclify can be installed via pip
and used from the command line as
Furthermore, markdown_toclify can also be imported as module and be used within Python. For example,
The markdown_toclify module has the same functionality as the command line tool. For more information about the usage, please refer to the help function via
#Examples [back to top] Basic usageInput fileSimple output fileCommand:
Advanced optionsOutput file with back-to-top links and vertical spaceCommand:
Heading level exclusionCommand:
TOC insertion at a placeholder positionCommand:
Input
Output |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论