From c1b0d7de4859e969dfe29635d1cfabb7dd27a34c Mon Sep 17 00:00:00 2001
From: Landon Curt Noll buzzard.2.README.md this file Use demo1.1st prints Hello World! assuming ASCII Use demo1.th prints Hello World! regardless of character set
-demo2.th demonstrates a simple loop
-demo3.th demonstrates a simple if test
-demo4.th recursive factorial calculating on the way up
-demo5.th recursive factorial calculating on the way down
-demo6.th demonstrates switching from compiler to execution mode Use To include the primitive on-line help, use
- Use: To include the primitive on-line help, use:
Jump to authors starting with: [
A
@@ -2800,7 +2800,7 @@ Location: US - United States of America
-buzzard.2.design.md description of FIRST (design documentation of THIRD)
-third implementation of THIRD in FIRST
-help.th online listing of THIRD primitives
-Useful files to view
+
+
FIRST demos:
./first < <demo>.
+
THIRD demos:
cat third <demo> | ./first.Demo files:
-
+
Interactive THIRD:
-cat third - | ./first.cat third help.th - | ./first.
+cat third - | ./first
-
+
cat third help.th - | ./first
-
+
diff --git a/bin/README.md b/bin/README.md
index 89376990f..4f53f5ec2 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -19,13 +19,13 @@ Run a command on all winning entries.
For example:
```
-bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
```
Or for example:
```
-bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/readme2index.sh -v 1
```
@@ -36,19 +36,19 @@ Run a command on all IOCCC years.
For example:
```
-bin/all-years.sh -v 1 bin/gen-year-index.sh -v 1
+ bin/all-years.sh -v 1 bin/gen-year-index.sh -v 1
```
Or for example:
```
-bin/all-years.sh -v 1 bin/chk-entry.sh
+ bin/all-years.sh -v 1 bin/chk-entry.sh
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make verify_entry_files
+ make verify_entry_files
```
@@ -60,7 +60,7 @@ Check that files required by an entry match the entry's manifest as found in
For example:
```
-bin/chk-entry.sh 2020/ferguson1
+ bin/chk-entry.sh 2020/ferguson1
```
@@ -71,7 +71,7 @@ Generate the list of files in the entry's manifest, `.entry.json`.
For example:
```
-awk -f bin/filelist.entry.json.awk 2020/ferguson1/.entry.json
+ awk -f bin/filelist.entry.json.awk 2020/ferguson1/.entry.json
```
@@ -82,7 +82,7 @@ Generate the top level `/authors.html` page.
Usage:
```
-bin/gen-authors.sh -v 1
+ bin/gen-authors.sh -v 1
```
@@ -93,7 +93,7 @@ Generate the top level `/location.html` page.
Usage:
```
-bin/gen-location.sh -v 1
+ bin/gen-location.sh -v 1
```
@@ -105,7 +105,7 @@ files.
Usage:
```
-bin/gen-other-html.sh -v 1
+ bin/gen-other-html.sh -v 1
```
@@ -116,13 +116,13 @@ Generate an XML sitemap for the IOCCC web site.
Usage:
```
-bin/gen-sitemap.sh -v 1
+ bin/gen-sitemap.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make gen_sitemap
+ make gen_sitemap
```
@@ -136,31 +136,31 @@ Without argument, the `contest_status` is unchanged.
Usage:
```
-bin/gen-status.sh -v 1
+ bin/gen-status.sh -v 1
```
To force the `contest_status` to be closed:
```
-bin/gen-status.sh -v 1 closed
+ bin/gen-status.sh -v 1 closed
```
To force the `contest_status` to be open:
```
-bin/gen-status.sh -v 1 open
+ bin/gen-status.sh -v 1 open
```
To see other valid statuses:
```
-bin/gen-status -h
+ bin/gen-status -h
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make gen_status
+ make gen_status
```
@@ -171,7 +171,7 @@ Generate a number of top level HTML pages for the IOCCC web sites.
Usage:
```
-bin/gen-top-html.sh -v 1
+ bin/gen-top-html.sh -v 1
```
Examples of top level HTML pages built by this tool include:
@@ -192,7 +192,7 @@ Examples of top level HTML pages built by this tool include:
We recommend that this tool be invoked via the top level `Makefile`:
```
-make gen_top_html
+ make gen_top_html
```
@@ -203,13 +203,13 @@ Generate an `index.html` page for an given IOCCC year.
Usage:
```
-bin/gen-year-index.sh -v 1 2020
+ bin/gen-year-index.sh -v 1 2020
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make gen_year_index
+ make gen_year_index
```
@@ -220,13 +220,13 @@ Generate the top level `/years.html` page.
Usage:
```
-bin/gen-years.sh -v 1
+ bin/gen-years.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make gen_years
+ make gen_years
```
@@ -280,7 +280,7 @@ this command will only briefly pause while the
slightly longer [readme2index.sh](readme2index.sh) is run:
```
-bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
```
**NOTE**: This command assumes that the relative
@@ -290,7 +290,7 @@ and `index.html` are correct. If in doubt, use:
We recommend that this tool be invoked via the top level `Makefile`:
```
-make quick_entry_index
+ make quick_entry_index
```
@@ -299,19 +299,19 @@ make quick_entry_index
Convert an entry README.md into entry directory index.html.
```
-bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/readme2index.sh -v 1
```
To build `index.html` files for all entries:
```
-bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/readme2index.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make entry_index
+ make entry_index
```
@@ -342,19 +342,19 @@ Sort a .gitignore in a entry directory.
Usage:
```
-bin/sort.gitignore.sh -v 1 YYYY/dir
+ bin/sort.gitignore.sh -v 1 YYYY/dir
```
Suggested usage:
```
-bin/all-run.sh bin/sort.gitignore.sh -v 1
+ bin/all-run.sh bin/sort.gitignore.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make sort_gitignore
+ make sort_gitignore
```
@@ -430,19 +430,19 @@ Untar an entry's a compressed tarball.
Usage:
```
-bin/untar-entry.sh -v 1 YYYY/dir
+ bin/untar-entry.sh -v 1 YYYY/dir
```
Suggested usage:
```
-bin/all-run.sh -v 3 bin/untar-entry.sh -v 1
+ bin/all-run.sh -v 3 bin/untar-entry.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make untar_entry_tarball
+ make untar_entry_tarball
```
@@ -453,23 +453,25 @@ Untar an IOCCC year's compressed tarball.
Usage:
```
-bin/untar-year.sh -v 1 YYYY
+ bin/untar-year.sh -v 1 YYYY
```
Suggested usage:
```
-bin/all-years.sh -v 3 bin/untar-year.sh -v 1
+ bin/all-years.sh -v 3 bin/untar-year.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
```
-make untar_year_tarball
+ make untar_year_tarball
```
-#
Run a command on all winning entries.
For example:
-bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
Or for example:
-bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/readme2index.sh -v 1
Run a command on all IOCCC years.
For example:
-bin/all-years.sh -v 1 bin/gen-year-index.sh -v 1
+ bin/all-years.sh -v 1 bin/gen-year-index.sh -v 1
Or for example:
-bin/all-years.sh -v 1 bin/chk-entry.sh
+ bin/all-years.sh -v 1 bin/chk-entry.sh
We recommend that this tool be invoked via the top level Makefile:
make verify_entry_files
+ make verify_entry_files
Check that files required by an entry match the entry’s manifest as found in
.entry.json.
For example:
-bin/chk-entry.sh 2020/ferguson1
+ bin/chk-entry.sh 2020/ferguson1
Generate the list of files in the entry’s manifest, .entry.json.
For example:
-awk -f bin/filelist.entry.json.awk 2020/ferguson1/.entry.json
+ awk -f bin/filelist.entry.json.awk 2020/ferguson1/.entry.json
Generate the top level /authors.html page.
Usage:
-bin/gen-authors.sh -v 1
+ bin/gen-authors.sh -v 1
Generate the top level /location.html page.
Usage:
-bin/gen-location.sh -v 1
+ bin/gen-location.sh -v 1
Generate entry HTML files (other than README.md to index.html) from markdown files.
Usage:
-bin/gen-other-html.sh -v 1
+ bin/gen-other-html.sh -v 1
Generate an XML sitemap for the IOCCC web site.
Usage:
-bin/gen-sitemap.sh -v 1
+ bin/gen-sitemap.sh -v 1
We recommend that this tool be invoked via the top level Makefile:
make gen_sitemap
+ make gen_sitemap
Generate status.json according to the modification dates of status.json
and news.html.
Without argument, the contest_status is unchanged.
Usage:
-bin/gen-status.sh -v 1
+ bin/gen-status.sh -v 1
To force the contest_status to be closed:
bin/gen-status.sh -v 1 closed
+ bin/gen-status.sh -v 1 closed
To force the contest_status to be open:
bin/gen-status.sh -v 1 open
+ bin/gen-status.sh -v 1 open
To see other valid statuses:
-bin/gen-status -h
+ bin/gen-status -h
We recommend that this tool be invoked via the top level Makefile:
make gen_status
+ make gen_status
Generate a number of top level HTML pages for the IOCCC web sites.
Usage:
-bin/gen-top-html.sh -v 1
+ bin/gen-top-html.sh -v 1
Examples of top level HTML pages built by this tool include:
news.html.
We recommend that this tool be invoked via the top level Makefile:
make gen_top_html
+ make gen_top_html
Generate an index.html page for an given IOCCC year.
Usage:
-bin/gen-year-index.sh -v 1 2020
+ bin/gen-year-index.sh -v 1 2020
We recommend that this tool be invoked via the top level Makefile:
make gen_year_index
+ make gen_year_index
Generate the top level /years.html page.
Usage:
-bin/gen-years.sh -v 1
+ bin/gen-years.sh -v 1
We recommend that this tool be invoked via the top level Makefile:
make gen_years
+ make gen_years
This is the primary tool that forms IOCCC generated HTML content from markdown files (permanent markdown files or temporarily generated @@ -258,19 +258,19 @@ the extra time can add up.
If only a few index.hmtl files need updating, then
this command will only briefly pause while the
slightly longer readme2index.sh is run:
bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
NOTE: This command assumes that the relative
modification times for index.hmtl, .entry.json,
and index.html are correct. If in doubt, use:
We recommend that this tool be invoked via the top level Makefile:
make quick_entry_index
+ make quick_entry_index
Convert an entry README.md into entry directory index.html.
-bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/readme2index.sh -v 1
To build index.html files for all entries:
bin/all-run.sh -v 3 bin/readme2index.sh -v 1
+ bin/all-run.sh -v 3 bin/readme2index.sh -v 1
We recommend that this tool be invoked via the top level Makefile:
make entry_index
+ make entry_index
Convert status.json into HTML.
This tool is a ‘before tool’ (-b tool) that is intended
@@ -285,11 +285,11 @@ We sort with lines starting with ! fourth.
Sort a .gitignore in a entry directory.
Usage:
-bin/sort.gitignore.sh -v 1 YYYY/dir
+ bin/sort.gitignore.sh -v 1 YYYY/dir
Suggested usage:
-bin/all-run.sh bin/sort.gitignore.sh -v 1
+ bin/all-run.sh bin/sort.gitignore.sh -v 1
We recommend that this tool be invoked via the top level Makefile:
make sort_gitignore
+ make sort_gitignore
Print default substitutions.
! fourth.
Untar an entry’s a compressed tarball.
Usage:
-bin/untar-entry.sh -v 1 YYYY/dir
+ bin/untar-entry.sh -v 1 YYYY/dir
Suggested usage:
-bin/all-run.sh -v 3 bin/untar-entry.sh -v 1
+ bin/all-run.sh -v 3 bin/untar-entry.sh -v 1
We recommend that this tool be invoked via the top level Makefile:
make untar_entry_tarball
+ make untar_entry_tarball
Untar an IOCCC year’s compressed tarball.
Usage:
-bin/untar-year.sh -v 1 YYYY
+ bin/untar-year.sh -v 1 YYYY
Suggested usage:
-bin/all-years.sh -v 3 bin/untar-year.sh -v 1
+ bin/all-years.sh -v 3 bin/untar-year.sh -v 1
We recommend that this tool be invoked via the top level Makefile:
make untar_year_tarball
-#
+ make untar_year_tarball
The md2html.sh tool is the primary tool that is used to form all IOCCC related HTML pages for the official IOCCC web @@ -347,22 +346,21 @@ tools in the bin directory and exist only while the too
In addition to converting markdown to HTML, the canonical way that HTML content is built uses, by default, files from the inc directory, of the file name form:
-*.default.html
+ *.default.html
By using command line options of the form:
--H phase=name
+ -H phase=name
where phase is the name of an HTML phase,
a non-default file may be used. For example:
-H navbar=up2index
+ -H navbar=up2index
will cause inc/navbar.up2index.html instead of inc/navbar.default.html to be used during the navbar HTML phase.
If name is dot (i.e., .), then the given HTML phase is skipped.
For example:
-H footer=.
+ -H footer=.
will cause no HTML content to be produced during the footer HTML phase.
The following HTML phase files are used to build HTML content:
Phases 33-39 are reserved for future use.
-In the above HTML phase numbers, except during HTML phase numbers 20-29, symbols
-of the form %%TOKEN%% are substituted.
Any %%TOKEN%% printed by the ‘before tool’ (-b tool), the ‘pandoc wrapper
-tool’ (-p tool), and the ‘after tool’ (-a tool) are ignored (i.e., not
-substituted).
In all of the above HTML phase numbers, symbols of the form %%TOKEN%% are substituted.
+Substitutions of and %%TOKEN%% are performed on included HTML content,
+content generated by the ‘before tool’ (-b tool),
+content generated by the ‘after tool’ (-a tool),
+as well as the markdown content given to the pandoc wrapper tool (-p tool).
It is an error, unless -S is given, for any phase, except phases HTML
+20-29, to not substitute all %%TOKEN%%’s. For phases HTML 20-29, any
+%%TOKEN%% that is not substituted are passed thru without substitution.
See the tool readme2index.sh for an example of how HTML phases are implemented.
-##getopt phase processing of the command line
+The command options are evaluated in the following getopt phases:
getopt phase 0token only.
An “output tool” may be used to add certain additional command line options to be processed.
IMPORTANT: An “output tool” will print each command line option / argument on a separate line. So for example, if an “output tool” wishes to convey:
--s TITLE='IOCCC entry locations' -H navbar=top-of-site
+ -s TITLE='IOCCC entry locations' -H navbar=top-of-site
The “output tool” would output the following 4 lines:
--s
-TITLE='IOCCC entry locations'
--H
-navbar=top-of-site
+ -s
+ TITLE='IOCCC entry locations'
+ -H
+ navbar=top-of-site
The command line options printed by an “output tool” are processed
after all command line options, and all options from a matching
line from the md2html.cfg file, and before any filename arguments
on the command line.
For example:
-command [command_options ..] [cfg_options ..] [output_tool_options ..] [--] [filename_arg ..]
+ command [command_options ..] [cfg_options ..] [output_tool_options ..] [--] [filename_arg ..]
Here the command first processes any command line options, then it processes
cfg_options obtained from this file from a first match of a given file_glob,
then it processes output tool (i.e., -o tool) options found in
@@ -486,7 +486,7 @@ on the official IOCCC web site.
… and in particular files under inc that are of the form (called default HTML files) …:
-*.default.html
+ *.default.html
… contain default content used to form IOCCC HTML / IOCCC web pages.
Instead of editing the default HTML files in order to fix a special web page, consider making a copy of the default file and modifying the md2html config @@ -496,9 +496,8 @@ situation will not impact MOST of the HTML content.
You may wonder why we need these files in the first place. You may wonder why we even need the tools in the bin directory when there other solutions available to form web pages.
-##Here are some reasons why we are using these files and special tools to create HTML content / IOCCC web pages:
@@ -513,9 +512,8 @@ pages.We use static web pages, so use of a “back-end database” is not available to the IOCCC.
-##The GitHub pages have the distributed server capacity needed to handle the huge download volume or Slashdot effect @@ -563,9 +561,8 @@ disabled.
The IOCCC will NOT MANDATE USE OF JavaScript to view official IOCCC web site.
For this reason, we cannot use JavaScript include HTML content.
-#The following IOCCC terms apply to tools, JSON files, and the directory structure of this repo.
authorAn author_handle is string that refers to a given author and is unique to the
IOCCC. Each author has EXACTLY ONE author_handle.
For each author_handle, there will be a JSON file located at:
author/author_handle.json
+ author/author_handle.json
where author_handle is the author’s author_handle.
Because the author_handle is used to form a JSON filename, the string must be
a POSIX safe string with the addition of + (for technical reasons beyond this
document). In particular, the author_handle must be an ASCII
string that matches this regexp:
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
+ ^[0-9A-Za-z][0-9A-Za-z._+-]*$"
Default author_handle’s do not have multiple consecutive _ (underscore)
characters. Nevertheless, multiple consecutive _ (underscore) characters are
allowed. Contest submitters who wish to override the author_handle may do so.
author_handle so that new winning entries can be associated with the same
author.
For an anonymous author, their handle is one of these forms:
Anonymous_year
+ Anonymous_year
or:
-Anonymous_year.digits
+ Anonymous_year.digits
The latter form is in case there are more than one anonymous author in a given year.
NOTE: even if the directory name is not anonymous the above rules apply as in
in the case of 2005/anon.
Anonymous author_handle’s match this regexp:
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
+ Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
entryAn IOCCC entry that won an award for a given IOCCC.
An entry has one more more authors.
entrys that used them.
represent the year. Some special year strings are possible, such as mock.
Non-numeric year strings are lower case.
A year string matches this regexp:
[0-9a-z][0-9a-z][0-9a-z][0-9a-z]
+ [0-9a-z][0-9a-z][0-9a-z][0-9a-z]
The year directories reside directly below the top level directory.
.yearEach year directory will have a file under it named:
.year
+ .year
The contents of the .year file is the year string of the directory. For
instance, 2020/.year has the string: 2020.
dirA dir is a POSIX safe string that holds an entry.
A dir is a string that matches this regexp:
^[a-z][0-9a-z.-]*$
+ ^[a-z][0-9a-z.-]*$
Each entry is under its own individual directory. This directory
is directly under a year directory.
entry_idA string that identifies the winning entry. The string is of the form:
-year_dir
+ year_dir
" > "$TMP_STRIPPED_MD"
+ # perform the %%TOKEN%% substitutions markdown file AND
# strip commented language after markdown code block
#
# We do not want the sed extended regular expression to be expanded, so
@@ -1759,10 +1760,10 @@ if [[ -z $NOOP ]]; then
# SC2016 (info): Expressions don't expand in single quotes, use double quotes for that.
# https://www.shellcheck.net/wiki/SC2016
# shellcheck disable=SC2016
- sed -E -e 's/^```[[:space:]]/```/' "$INPUT_MD" >> "$TMP_STRIPPED_MD"
+ sed -E -e 's/^```[[:space:]]/```/' -f "$TMP_SED_SCRIPT" "$INPUT_MD" >> "$TMP_STRIPPED_MD"
status="$?"
if [[ $status -ne 0 ]]; then
- echo "$0: ERROR: strip commented language after markdown code block from $INPUT_MD into file:" \
+ echo "$0: ERROR: token substation and strip code block command language from $INPUT_MD into file:" \
"$TMP_INPUT_MD failed, error code: $status" 1>&2
exit 25
fi
diff --git a/bin/subst.default.sh b/bin/subst.default.sh
index 53b21d64d..7b42e91b5 100755
--- a/bin/subst.default.sh
+++ b/bin/subst.default.sh
@@ -92,7 +92,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
# set variables referenced in the usage message
#
-export VERSION="1.2.3 2024-04-13"
+export VERSION="1.3 2024-04-20"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -260,6 +260,16 @@ fi
echo "-s"
echo "HEADER_1=The International Obfuscated C Code Contest"
+# output REPO_URL substitution
+#
+echo "-s"
+echo "REPO_URL=$REPO_URL"
+
+# output SITE_URL substitution
+#
+echo "-s"
+echo "SITE_URL=$SITE_URL"
+
# output DOCROOT_SLASH substitution
#
echo "-s"
@@ -271,6 +281,7 @@ export VALIDATOR_ENCODED_URL
echo "-s"
echo "VALIDATOR_ENCODED_URL=$VALIDATOR_ENCODED_URL"
+
# All Done!!! -- Jessica Noll, Age 2
#
exit 0
diff --git a/location.html b/location.html
index 089718175..d6c4e2d2f 100644
--- a/location.html
+++ b/location.html
@@ -132,7 +132,7 @@
-
+
2020 | 2019 | 2018 | 2015 | 2014 | 2013 | 2012 | 2011
@@ -367,7 +367,7 @@
Download all 2004 IOCCC entry source
Jump to: top
- +