Browse Source

Added new asciinema demo.

master
Franco Masotti 4 years ago
parent
commit
775a81faae
  1. 24
      asciinema/md_toc_asciinema_2_0_0.json
  2. 76
      asciinema/md_toc_asciinema_2_0_0_demo.sh

24
asciinema/md_toc_asciinema_2_0_0.json

@ -0,0 +1,24 @@
{"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"]

76
asciinema/md_toc_asciinema_2_0_0_demo.sh

@ -0,0 +1,76 @@
#!/bin/bash
#
# md_toc_asciinema_2_0_0_demo.sh
#
# Copyright (C) 2017-2018 frnmst (Franco Masotti) <franco.masotti@live.com>
# <franco.masotti@student.unife.it>
#
# This file is part of md-toc.
#
# 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 5 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/>.
#
printf "Running a demo to show some of md_toc's capabilities...\n"
printf "\n"
sleep 2
printf "$ md_toc -h\n"
md_toc -h
printf "\n"
sleep 5
cat <<-EOF > foo.md
# Hi
[](TOC)
hey
## How are you? !!!
## fine, thanks
### Bye
## Bye bye
EOF
printf "$ cat foo.md\n"
cat foo.md
printf "\n"
sleep 5
printf "$ md_toc github foo.md\n"
md_toc github foo.md
printf "\n"
sleep 5
printf "$ md_toc gitlab -o foo.md\n"
md_toc gitlab -o foo.md
printf "\n"
sleep 5
printf "$ md_toc -n github foo.md\n"
md_toc -n github foo.md
printf "\n"
sleep 5
printf "$ Editing the file in-place...\n"
printf "$ md_toc -i redcarpet foo.md\n"
md_toc -i redcarpet foo.md
printf "$ cat foo.md\n"
cat foo.md
rm foo.md
Loading…
Cancel
Save