markdown-delimiter-doer
is a useful tool for
taking a markdown file and "do whatever you want" between the delimiters
and output new markdown file.
Table of Contents,
Documentation and references,
OVERVIEW
This tool is useful for "doing something" in a file between a delimiter.
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-delimiter-doer.go
from the command line,
Run using delimiters $$
and the -htmltable
switch on input.md,
go run . -delimiter \$\$ -i input.md -o output.md -htmltable
go run markdown-delimiter-doer.go htmlswitch.go -delimiter \$\$ -i input.md -o output.md -htmltable
go run markdown-delimiter-doer.go htmlswitch.go -delimiter \$\$ -i input.md -o output.md -htmltable -debug
TEST
The following steps are located in
unit-tests.sh.
To create _test
files,
gotests -w -all markdown-delimiter-doer.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-delimiter-doer.go htmlswitch.go
USAGE
markdown-delimiter-doer {-h|-v|-debug} -delimiter [delimiter] -i [input file] -o [output file] -htmltable
-h
Help,
markdown-delimiter-doer -h
-v
Version,
markdown-delimiter-doer -v
-delimiter string
The delimiter you want to use.
-i string, -o string
The -i
and -o
switches are used to define the input and output file respectively.
markdown-delimiter-doer -i input.md -o output.md
Running this command won't do anything, you need to use a switch like -htmltable.
-htmltable
This switch is used to create an html table,
markdown-delimiter-doer -delimiter \$\$ -i input.md -o output.md -htmltable
Here is an illustration using the -htmltable
switch,
It will even check the dates and strikethrough them automatically.
-debug
markdown-delimiter-doer -delimiter \$\$ -i input.md -o output.md -htmltable -debug
FUTURE
The ability to add more switches to do whatever you want between delimiters.