Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits
NameSize
..
#strings.awk1.2 KiBlog stats plain blame
Article-separator.awk187 Blog stats plain blame
File-lists.awk4.2 KiBlog stats plain blame
Flags.awk787 Blog stats plain blame
Group-contents.awk537 Blog stats plain blame
Header-description.awk948 Blog stats plain blame
Header-title.awk767 Blog stats plain blame
Heading-anchors.awk441 Blog stats plain blame
Pagenav.awk1.5 KiBlog stats plain blame
Presentation.awk7.7 KiBlog stats plain blame
README.md2.0 KiBlog stats plain blame
Syntax-highlighting.awk5.5 KiBlog stats plain blame
_print.awk11 Blog stats plain blame
post-pagenav.awk49 Blog stats plain blame

All .awk files in this folder are ran by generate.sh and generate-dev.sh, after ssg and lowdown have created all HTML pages. These files are meant to work on the resultant HTML.

For improved efficiency, rather than running every script seperately, they are meant to be concatinated into one script (generate.sh and generate-dev.sh combine them in /tmp/syndamiadotcom-awk), which is ran for each HTML file. This forces us to work with the following constraints:

  • NO awk script should print the current line (print should only be used to add new lines)
    The script that starts with '_' contains the print of the current line, all scripts that start with a capital letter are ran before it and all with small letter - after.
  • If we print the current line in every script, the concatenated will print the current line multiple times
  • Variable names between scripts must be unique
  • exit mustn't be used! Instead, use a variable and then add a check to every relevant rule.

ftags

ftags are strings/words in the Markdown source files, that start with "&&" and continue with any (valid) sequence of characters. The name initially stood for "file tags", since I got the idea while making the file lists functionality. Now I like to think of them as "format tags", since they are used for so much more.

On the "backend", they just get replaced with specific HTML. List of scripts that handle ftags:

Script ftags
File-lists.awk &&folder, &&file, &&/files, &&fd, &&ft-TYPE (TYPE is one of photo, text, zip, movie, markdown)
Flags.awk &&gb, &&bg
Presentation.awk &&presentation, &&slide, &&/slide, &&clide, &&/clide, &&table, &&ftable, &&tarow, &&/table, &&linebN (N is one of 1, 2, ..., 9), &&fontSIZE (SIZE is one of 18, 20, 22, 25, 27, 35), &&/font, &&centered, &&/centered, &&fright, &&/fright, &&cont, &&/cont

Information regarding their usage can be found at the top of their respective script file.