Automatically generate a compliant table of contents for a markdown file to improve document readability https://docs.franco.net.eu.org/md-toc/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
2.9 KiB

{"version": 2, "width": 174, "height": 46, "timestamp": 1521395243, "env": {"SHELL": "/bin/bash", "TERM": "st-256color"}}
[0.009865, "o", "Running a demo to show some of md_toc's capabilities...\r\n"]
[0.010509, "o", "\r\n"]
[2.011863, "o", "$ md_toc -h\r\n"]
[2.21847, "o", "usage: md_toc [-h] [-i] [-n] [-t TOC_MARKER] [-v]\r\n {github,cmark,redcarpet,gitlab} ... FILE_NAME\r\n\r\nMarkdown Table Of Contents: Automatically generate a compliant table\r\nof contents for a markdown file to improve document readability.\r\n\r\npositional arguments:\r\n FILE_NAME the I/O file name\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n -i, --in-place overwrite the input file\r\n -n, --no-links avoids adding links to the corresponding content\r\n -t TOC_MARKER, --toc-marker TOC_MARKER\r\n set the string to be used as the marker for\r\n positioning the table of contents. Defaults to [](TOC)\r\n -v, --version show program's version number and exit\r\n\r\nmarkdown parser:\r\n {github,cmark,redcarpet,gitlab}\r\n\r\nReturn values: 0 OK, 1 Error, 2 Invalid command\r\n\r\nCopyright (C) 2018 Franco Masotti, frnmst\r\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r\nThis is free soft"]
[2.218538, "o", "ware: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.\r\n"]
[2.233581, "o", "\r\n"]
[7.236907, "o", "$ cat foo.md\r\n"]
[7.239637, "o", "# Hi\r\n\r\n[](TOC)\r\n\r\nhey\r\n\r\n## How are you? !!!\r\n\r\n## fine, thanks\r\n\r\n### Bye\r\n\r\n## Bye bye\r\n"]
[7.241085, "o", "\r\n"]
[12.244051, "o", "$ md_toc github foo.md\r\n"]
[12.449938, "o", "- [Hi](#hi)\r\n - [How are you? !!!](#how-are-you-----------)\r\n - [fine, thanks](#fine-thanks)\r\n - [Bye](#bye)\r\n - [Bye bye](#bye-bye)\r\n"]
[12.46659, "o", "\r\n"]
[17.468522, "o", "$ md_toc gitlab -o foo.md\r\n"]
[17.673403, "o", "1. [Hi](#hi)\r\n 1. [How are you? !!!](#how-are-you)\r\n 2. [fine, thanks](#fine-thanks)\r\n 1. [Bye](#bye)\r\n 3. [Bye bye](#bye-bye)\r\n"]
[17.689824, "o", "\r\n"]
[22.691577, "o", "$ md_toc -n github foo.md\r\n"]
[22.898801, "o", "- Hi\r\n - How are you? !!!\r\n - fine, thanks\r\n - Bye\r\n - Bye bye\r\n"]
[22.913503, "o", "\r\n"]
[27.915307, "o", "$ Editing the file in-place..."]
[27.91691, "o", "\r\n"]
[27.917858, "o", "$ md_toc -i redcarpet foo.md\r\n"]
[28.137716, "o", "$ cat foo.md\r\n"]
[28.139199, "o", "# Hi\r\n\r\n[](TOC)\r\n\r\n- [Hi](#hi)\r\n - [How are you? !!!](#how-are-you)\r\n - [fine, thanks](#fine-thanks)\r\n - [Bye](#bye)\r\n - [Bye bye](#bye-bye)\r\n\r\n[](TOC)\r\n\r\nhey\r\n\r\n## How are you? !!!\r\n\r\n## fine, thanks\r\n\r\n### Bye\r\n\r\n## Bye bye\r\n"]