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
3.3 KiB

{"version": 2, "width": 83, "height": 46, "timestamp": 1552905547, "env": {"SHELL": "/bin/bash", "TERM": "rxvt-unicode-256color"}}
[0.010489, "o", "Running a demo to show some of md_toc's capabilities...\r\n\r\n"]
[2.014595, "o", "$ md_toc -h\r\n"]
[2.191121, "o", "usage: md_toc [-h] [-p] [-l] [-i] [-m TOC_MARKER] [-v]\r\n [FILE_NAME [FILE_NAME ...]]\r\n {github,cmark,gitlab,commonmarker,redcarpet} ...\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 -p, --in-place overwrite the input file\r\n -l, --no-links avoids adding links to the corresponding content\r\n -i, --no-indentation avoids adding indentations to the corresponding\r\n content\r\n -m 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,gitlab,commonmarker,redcarpet}\r\n\r\nReturn values: 0 OK,"]
[2.191225, "o", " 1 Error, 2 Invalid command\r\n\r\nCopyright (C) 2018-2019 Franco Masotti, frnmst\r\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.\r\n"]
[2.20289, "o", "\r\n"]
[7.20649, "o", "Inspecting the file...\r\n$ cat foo.md\r\n"]
[7.207679, "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.20814, "o", "\r\n"]
[12.210146, "o", "Run with default options...\r\n$ md_toc foo.md github\r\n"]
[12.385408, "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.396683, "o", "\r\n"]
[17.398421, "o", "Ordered list...\r\n$ md_toc foo.md gitlab -o\r\n"]
[17.575691, "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.587251, "o", "\r\n"]
[22.589181, "o", "No links...\r\n$ md_toc -l foo.md github\r\n"]
[22.767776, "o", "- Hi\r\n - How are you? !!!\r\n - fine, thanks\r\n - Bye\r\n - Bye bye\r\n"]
[22.779368, "o", "\r\n"]
[27.780919, "o", "No links and no indentation...\r\n$ md_toc -l -i foo.md github\r\n"]
[27.95595, "o", "- Hi\r\n- How are you? !!!\r\n- fine, thanks\r\n- Bye\r\n- Bye bye\r\n"]
[27.967396, "o", "\r\n"]
[32.969054, "o", "Editing the file in-place...\r\n$ md_toc -p foo.md redcarpet\r\n"]
[33.160029, "o", "$ cat foo.md\r\n"]
[33.160866, "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"]