improve years.html
The `bin/gen-years.sh` has been updated to include the abstract of the winning entry. Changed `bin/gen-years.sh` VERSION from "2.1.1 2025-06-06" ta "2.2.0 2025-07-10". Ran `make gen_years timestamp` to perform the above.
This commit is contained in:
1 parent
0a112099d7
commit
4eaa4fef8f
3 files changed
+401
-326
No files matched your search
+77
-2
@@ -106,7 +106,7 @@ export LC_ALL="C"
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="2.1.1 2025-06-06"
|
||||
export VERSION="2.2.0 2025-07-10"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -279,6 +279,70 @@ function output_award
|
||||
}
|
||||
|
||||
|
||||
# output_abstract
|
||||
#
|
||||
# Write the abstract name to standard output (stdout)
|
||||
#
|
||||
# usage:
|
||||
# output_abstract YYYY/dir/.entry.json
|
||||
#
|
||||
# returns:
|
||||
# 0 ==> no errors detected, but output may be empty
|
||||
# > 0 ==> function error number
|
||||
#
|
||||
function output_abstract
|
||||
{
|
||||
local ENTRY_JSON_PATH; # the .entry.json path
|
||||
local PATTERN; # XPath for JSON pattern
|
||||
local ABSTRACT; # extracted abstract from .entry.json
|
||||
|
||||
# parse args
|
||||
#
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "$0: ERROR: in output_abstract: expected 1 arg, found $#" 1>&2
|
||||
return 1
|
||||
fi
|
||||
ENTRY_JSON_PATH="$1"
|
||||
if [[ ! -e $ENTRY_JSON_PATH ]]; then
|
||||
echo "$0: ERROR: in output_abstract: .entry.json does not exist: $ENTRY_JSON_PATH" 1>&2
|
||||
return 2
|
||||
fi
|
||||
if [[ ! -f $ENTRY_JSON_PATH ]]; then
|
||||
echo "$0: ERROR: in output_abstract: .entry.json is not a file: $ENTRY_JSON_PATH" 1>&2
|
||||
return 3
|
||||
fi
|
||||
if [[ ! -r $ENTRY_JSON_PATH ]]; then
|
||||
echo "$0: ERROR: in output_abstract: .entry.json is not a readable file: $ENTRY_JSON_PATH" 1>&2
|
||||
return 4
|
||||
fi
|
||||
|
||||
# obtain the abstract string
|
||||
#
|
||||
PATTERN='$..abstract'
|
||||
if [[ $V_FLAG -ge 5 ]]; then
|
||||
echo "$0: debug[5]: about to run: $JVAL_WRAPPER -b -q -- $ENTRY_JSON_PATH '$PATTERN' | $JSTRDECODE -d -q -N -" 1>&2
|
||||
fi
|
||||
export ABSTRACT
|
||||
ABSTRACT=$("$JVAL_WRAPPER" -b -q "$ENTRY_JSON_PATH" "$PATTERN" | "$JSTRDECODE" -d -q -N -)
|
||||
status_codes=("${PIPESTATUS[@]}")
|
||||
if [[ ${status_codes[*]} =~ [1-9] || -z $ABSTRACT ]]; then
|
||||
echo "$0: ERROR: in output_abstract: $JVAL_WRAPPER -b -q -- $ENTRY_JSON_PATH '$PATTERN' | $JSTRDECODE -d -q -N - failed," \
|
||||
"error codes: ${status_codes[*]}" 1>&2
|
||||
return 5
|
||||
fi
|
||||
if [[ ${#ABSTRACT} -ge 65 ]]; then
|
||||
echo "$0: ERROR: in output_abstract: abstract length ${#ABSTRACT} >= 65 in $ENTRY_JSON_PATH" 1>&2
|
||||
return 6
|
||||
fi
|
||||
if [[ $ABSTRACT =~ [\;$,] ]]; then
|
||||
echo "$0: ERROR: in output_abstract: abstract contains ; or & or , in $ENTRY_JSON_PATH" 1>&2
|
||||
return 7
|
||||
fi
|
||||
echo "${ABSTRACT//[;&,]/}"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# output_ordinal
|
||||
#
|
||||
# Write the numerical ordinal form of a non-negative integer to standard output (stdout)
|
||||
@@ -1011,6 +1075,17 @@ for YYYY in $("$TAC_TOOL" "$TOP_FILE"); do
|
||||
continue
|
||||
fi
|
||||
|
||||
# determine the abstract for this entry
|
||||
#
|
||||
ABSTRACT=$(output_abstract "$ENTRY_JSON")
|
||||
status="$?"
|
||||
if [[ $status -ne 0 || -z $ABSTRACT ]]; then
|
||||
echo "$0: ERROR: cannot find abstract in .entry.json: $ENTRY_JSON" 1>&2
|
||||
EXIT_CODE="7" # exit 7
|
||||
echo "$0: Warning: EXIT_CODE set to: $EXIT_CODE" 1>&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Verify $YYYY_DIR/README.md
|
||||
#
|
||||
if [[ ! -e $YYYY_DIR/README.md ]]; then
|
||||
@@ -1026,7 +1101,7 @@ for YYYY in $("$TAC_TOOL" "$TOP_FILE"); do
|
||||
|
||||
# output markdown for this entry
|
||||
#
|
||||
echo "* <div id=\"${YEAR_DIR}_${ENTRY_DIR}\"><a class=\"normal\" href=\"$YYYY_DIR/index.html\">$YYYY_DIR</a> - $AWARD</div>"
|
||||
echo "* <div id=\"${YEAR_DIR}_${ENTRY_DIR}\"><a class=\"normal\" href=\"$YYYY_DIR/index.html\">$YYYY_DIR</a> - $AWARD - <i>$ABSTRACT</i></div>"
|
||||
done | if [[ -z $NOOP ]]; then
|
||||
cat >> "$TMP_YEARS_MD"
|
||||
else
|
||||
|
||||
+3
-3
@@ -15282,7 +15282,7 @@
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.ioccc.org/bin/gen-years.sh</loc>
|
||||
<lastmod>2025-06-07T02:36:45+00:00</lastmod>
|
||||
<lastmod>2025-07-10T08:42:52+00:00</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.ioccc.org/bin/html.sed</loc>
|
||||
@@ -15602,7 +15602,7 @@
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.ioccc.org/status.html</loc>
|
||||
<lastmod>2025-07-08T23:40:18+00:00</lastmod>
|
||||
<lastmod>2025-07-10T08:46:27+00:00</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.ioccc.org/status.json</loc>
|
||||
@@ -15630,6 +15630,6 @@
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.ioccc.org/years.html</loc>
|
||||
<lastmod>2025-06-07T02:38:29+00:00</lastmod>
|
||||
<lastmod>2025-07-10T08:45:52+00:00</lastmod>
|
||||
</url>
|
||||
</urlset>
|
||||
+321
-321
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user