Source Code Htmlizer Written in Awk
Here we have a tool that’s in a similar vein to stagit and others. It takes a number of files on the commandline and generates HTML for them in an output directory, then generates an index with a file listing and a readme. It’s also written completely in awk(1p)
. I guess that’s the gimmick.
How to use
I don’t want to figure out how to process actual command-line arguments in awk, so I’ve made all the configuration doable through awk variables. The command I’ve been running to test schwa
is
./schwa.awk -vreadme=README.md \
-vreadmefilter='pandoc -thtml5' \
-vtemplate=template.html \
-vstatic=style.css \
-vclone='<a href="https://git.acdw.net/schwa">https://git.acdw.net/schwa</a>'
-vdesc="Source Code Htmlizer" \
*
Of course, some explanation is in order.
Command-line variables
- template
- needs documentation
- out
- needs documentation
- readme
- needs documentation
- readmefilter
- needs documentation
- clone
- needs documentation
- desc
- needs documentation
- static
- needs documentation
Templating
- CLONE
- needs documentation
- DESCRIPTION
- needs documentation
- DIRECTORY
- needs documentation
- FILENAME
- needs documentation
- OUTFILE
- needs documentation
- RAWFILE
- needs documentation
- CONTENT
- needs documentation
“Conditionals”
<!--INDEX--> ... <!--/INDEX-->
- needs documentation
<!--NORMAL--> ... <!--/NORMAL-->
- needs documentation
Contributing
Email me at git@acdw.net to contribute.
License
This project is licensed under a BSD 3-clause license. See COPYING for more details.