Entry source is now prog.c for IOCCC years 2014 thru 2020, or is now dirname.c IOCCC years 1984 thru 2013. To achieve this state, we renamed the following: renamed: 2004/hibachi/src/hibachi.c -> 2004/hibachi/hibachi.c renamed: 2012/omoikane/nyaruko.alt.c -> 2012/omoikane/omoikane.alt.c renamed: 2012/omoikane/nyaruko.alt2.c -> 2012/omoikane/omoikane.alt2.c renamed: 2012/omoikane/nyaruko.c -> 2012/omoikane/omoikane.c renamed: 2012/omoikane/nyaruko.orig.c -> 2012/omoikane/omoikane.orig.c Modified `bin/subst.entry-index.sh` to add to entry `index.html` file, links to the `Makefile` and the _C code_ to the top navigation bar. Changed `bin/subst.entry-index.sh` VERSION from "1.2.2 2024-02-25" to "1.3 2024-03-02". Moved printing the Inventory link in the top navigation bar from `bin/subst.entry-navbar.awk` to `bin/subst.entry-index.sh`. Changed `bin/subst.entry-navbar.awk` VERSION from "1.0.1 2024-02-23" to "1.1 2024-03-02". Moved printing the Inventory link in the top navigation bar from `bin/subst.year-navbar.awk` to `bin/subst.year-index.sh`. Changed `bin/subst.year-index.sh` VERSION from "1.0 2024-02-11" to "1.1 2024-03-02". Changed `bin/subst.year-navbar.awk` VERSION from "1.0 2024-02-11" to "1.1 2024-03-02". Added location names (both default and common) to `author.html`. Changed `tmp/gen_author_json.sh` VERSION from "1.0 2023-06-06" to "1.1 2024-03-04". Added location names (both default and common) to `author.html`. Changed `bin/gen-authors.sh` VERSION from "1.2 2024-03-09" to "1.3 2024-03-04". The manifest and the resulting `.entry.json` files have been changed for `2004/hibachi` and `2012/omoikane`. The Makefiles for `2004/hibachi` and `2012/omoikane` copy the source file into the "previously used location". The `make clobber` rule removes the copied source. The `.gitignore` files have been updated accordingly. Improved how the concept of IOCCC terms _entry_, _author_ and _submission_ are used in markdown files. Links to markdown files (files ending in .md) within the repo were changed to link to HTML files (files ending in .html). Special cases where `README.md` became `index.html` were modified accordingly. Fixed URL for `bugs.html` in Makefile comments. Fixed name of `bin/sgi.sh` referenced in comments in `.gitignore` files. Links to locations within the repo are now relative. For example a link to `/contact.html` may become `../contact.html' or '../../contact.html` depending on the directory level of the markdown file. Nearly all links with absolute URLs under _https://www.ioccc.org_ or `https://ioccc-src.github.io/temp-test-ioccc_ have been changed to relative paths within the repo. Some exceptions to this (such as referring to a GitHub repo) were preserved. Fixed a number of inside `faq.md` and `bugs.md`. Added HTML name tags (in the form of an _entry_id_) for each entry referenced in `bugs.md`. Fixed links from outside of `bugs.html` into `bugs.html` accordingly. Where FAQ entries are referenced, a named tag is used so that if a FAQ is ever renumbered, links outside of `faq.html` will still work. Changed the _inventory_order_ of a compressed tarball from _300_ to _100000_. While this may have been done for the manifest, this changed had not yet been propagated into the `.entry.json` files. Links to web sites that were in the for <URL> are now [URL](URL). Performed `name www` to process all of the above. Improved format of `authors.html`. Full names are now bold. Location codes are now links back into `location.html` and location names (both default and common) are now italics. Added _author_handle_ each author. Changed `bin/gen-authors.sh` VERSION from "1.1 2024-02-25" to "1.2 2024-03-09". Improved format of `location.html` as location codes are now bold, author counts in a given location are now bold, and location names (both default and common) are now italics. Changed `bin/gen-location.sh` VERSION from "1.0.1 2024-02-23" to "1.1 2024-03-04". Added italic location name after location code in entry `index.html` files. Changed `bin/output-index-author.sh` VERSION from "1.4.1 2024-02-23" to "1.5 2024-03-04". Added _Location of authors_ to the sidebar as a link to `location.html`. TODO: While nearly all of the above mentioned changes are likely correct, they likely introduced a few errors that need correcting.
172 lines
4.0 KiB
Awk
Executable File
172 lines
4.0 KiB
Awk
Executable File
#!/usr/bin/env awk
|
|
#
|
|
# subst.entry-navbar.awk - output substitutions for navbar on behalf of an entry
|
|
#
|
|
# This tool is usually invoked from the bin/subst.entry-index.sh output tool.
|
|
# That tool, in turn, is usually invoked by:
|
|
#
|
|
# -o bin/subst.entry-index.sh
|
|
#
|
|
# IMPORTANT: Each command line option / argument MUST be printed on a separate line!
|
|
#
|
|
# usage:
|
|
#
|
|
# awk -v entry_path=YYYY/dir -f bin/subst.entry-navbar.awk YYYY/.year
|
|
#
|
|
# where:
|
|
#
|
|
# YYYY IOCCC year or mock
|
|
# dir name of entry directory under YYYY
|
|
|
|
BEGIN {
|
|
|
|
# setup
|
|
#
|
|
VERSION="1.2 2024-03-02"
|
|
process_next_line = 0; # 1 ==> we found our entry_path, now process the next line
|
|
found_entry_path = 0; # 1 ==> we found our entry_path
|
|
prev_line = ""; # the previous YYYY/dir line
|
|
topnav_phase = "mid"; # topnav name to use (-H topnav=topnav_phase)
|
|
|
|
# error if github is not set via -v github=REPO_URL
|
|
#
|
|
if (length(entry_path) == 0) {
|
|
exit 210; # use 210 to match length(entry_path) == 0 error in the END section
|
|
}
|
|
}
|
|
|
|
# process YYYY/dir lines
|
|
#
|
|
$0 ~ /[^\/]+\/[^\/]+/ {
|
|
|
|
# split line into year (file[1]) and dir (file[2])
|
|
#
|
|
len = split($0, file, "/");
|
|
if (len != 2) {
|
|
# ERROR: invalid split of a YYYY/dir line
|
|
print "-e";
|
|
print "'invalid split of:", $0, "expected 2 part, found:", len "'";
|
|
print "-E";
|
|
print "211";
|
|
exit
|
|
}
|
|
year = file[1];
|
|
dir = file[2];
|
|
|
|
# if we need the line after we found our entry_path
|
|
#
|
|
if (process_next_line) {
|
|
|
|
# process the line after we found our entry_path
|
|
#
|
|
# report the previous entry for this year
|
|
print "-s";
|
|
print "RIGHT_LINK=../" dir "/index.html";
|
|
print "-s";
|
|
print "RIGHT_TEXT=" dir;
|
|
process_next_line = 0;
|
|
|
|
# if we found our entry_path
|
|
#
|
|
} else if (entry_path == $0) {
|
|
|
|
# in case our our entry_path is the 1st line
|
|
#
|
|
if (NR == 1) {
|
|
# no previous line entry_path is the 1st line
|
|
topnav_phase = "first";
|
|
}
|
|
|
|
# process the previous YYYY/dir line with this match
|
|
#
|
|
if (prev_line) {
|
|
|
|
# split previous line into year (file[1]) and dir (file[2])
|
|
#
|
|
prev_len = split(prev_line, file, "/");
|
|
if (prev_len != 2) {
|
|
# ERROR: invalid split of a previous YYYY/dir line
|
|
print "-e";
|
|
print "'invalid split of:", prev_line "expected 2 part, found:", prev_len "'";
|
|
print "-E";
|
|
print "212";
|
|
exit
|
|
}
|
|
prev_year = file[1];
|
|
prev_dir = file[2];
|
|
if (year != prev_year) {
|
|
# ERROR: previous YYYY/dir YYYY does not match current line
|
|
print "-e";
|
|
print "'previous line:", prev_line "year:", prev_year, "!= current line year:", year "'";
|
|
print "-E";
|
|
print "213";
|
|
}
|
|
|
|
# report the next entry for this year
|
|
print "-s";
|
|
print "LEFT_LINK=../" prev_dir "/index.html";
|
|
print "-s";
|
|
print "LEFT_TEXT=" prev_dir;
|
|
}
|
|
|
|
# process our found entry_path
|
|
#
|
|
# report up link top year index.html
|
|
print "-s";
|
|
print "UP_LINK=../index.html";
|
|
print "-s";
|
|
print "UP_TEXT=" year;
|
|
process_next_line = 1;
|
|
found_entry_path = 1;
|
|
}
|
|
|
|
# save the line as the next previous line
|
|
#
|
|
prev_line = $0;
|
|
}
|
|
|
|
# report any non-YYYY/dir line
|
|
#
|
|
$0 !~ /[^\/]+\/[^\/]+/ {
|
|
|
|
# bogus line found
|
|
print "-e";
|
|
print "'found a non-YYYY/dir line in", ARGV[1] ":", $0 "'";
|
|
print "-E";
|
|
print "214";
|
|
exit
|
|
}
|
|
|
|
END {
|
|
|
|
# error if github is not set via -v github=REPO_URL
|
|
#
|
|
if (length(entry_path) == 0) {
|
|
print "-e";
|
|
print "ERROR: github variable not set, call with -v github=REPO_URL";
|
|
print "-E";
|
|
print "210"; # use 210 to match length(entry_path) == 0 error in the BEGIN section
|
|
exit 210; # use 210 to match length(entry_path) == 0 error in the BEGIN section
|
|
}
|
|
|
|
# case: we did not find our entry_path
|
|
#
|
|
if (!found_entry_path) {
|
|
# ERROR: entry_path was not found
|
|
print "-e";
|
|
print "'we did not find:", entry_path "'";
|
|
print "-E";
|
|
print "215";
|
|
exit
|
|
|
|
} else if (process_next_line) {
|
|
# no next line entry_path is the last line
|
|
topnav_phase = "last";
|
|
}
|
|
|
|
# output the topnav phase name
|
|
#
|
|
print "-H";
|
|
print "topnav=" topnav_phase;
|
|
}
|