markdown-create-table-of-contents tool
markdown-create-table-of-contents
is a useful tool for
parsing a markdown file to find ##, ### to create a table
of contents (TOC) for links at github.
Table of Contents,
Documentation and references,
OVERVIEW
This tool is useful for creating a Table of Contents for .md files.
PREREQUISITES
I used the following language,
You will need the following go packages,
go get -u -v github.com/sirupsen/logrus
RUN
The following steps are located in
run.sh.
To run
markdown-create-table-of-contents.go
from the command line,
go run .
go run markdown-create-table-of-contents.go
go run markdown-create-table-of-contents.go -debug
TEST
The following steps are located in
unit-tests.sh.
To create _test
files,
gotests -w -all markdown-create-table-of-contents.go
To unit test the code,
go test -cover ./... | tee test/test_coverage.txt
cat test/test_coverage.txt
INSTALL
Will place an executable in your go bin,
go install markdown-create-table-of-contents.go
USAGE
markdown-create-table-of-contents {-h|-v|-debug} -i [FILENAME] -h3
The default is to use README.md and create a table of contents,
-h
Help,
markdown-create-table-of-contents -h
-v
Version,
markdown-create-table-of-contents -v
-i string
Use a specific input file input.md
,
markdown-create-table-of-contents -i input.md
-h3
Include sub headings 3 ###
,
markdown-create-table-of-contents -i input.md -h3
-debug
markdown-create-table-of-contents -i input.md -h3 -debug