Check-in by ben on 2025-05-01 04:12:36
Add About section with links
INSERTED DELETED
32 0 periodic.awk
32 0 TOTAL over 1 changed file
Index: periodic.awk
==================================================================
--- periodic.awk
+++ periodic.awk
@@ -147,10 +147,39 @@
function mkdir(dir) {
system("mkdir -p \"" dir "\"")
return
}
+
+function print_about( dir, f) {
+ dir = outdir "/about"
+ mkdir(dir)
+ f = dir "/index.gph"
+
+ print "# About Gopher Periodic Table of the Elements\n" >f
+ print "I wrote this AWK script as a fun and easy exercise." >>f
+ print "Generating a simple gopher interface from CSV data.\n" >>f
+ print "# See also\n" >>f
+
+ print "[1|A Visual Exploration (PDF)|/~bencollver/ia" \
+ "/details/the-elements-by-theodore-gray-and-nick-mann" \
+ "|tilde.pink|70]" >>f
+
+ print "[1|Periodic Table (DOS)|/~bencollver/ia" \
+ "/details/periodic-table-for-dos|tilde.pink|70]" >>f
+
+ print "[1|ATOMS (DOS)|/~bencollver/ia" \
+ "/details/atoms-periodic-table-for-dos|tilde.pink|70]" >>f
+
+ print "[0|ASCII Periodic Table|" \
+ "/users/amr66/b_scientific/periodic_table.txt" \
+ "|gopher.srcf.net|70]" >>f
+
+ close(f)
+ return
+}
+
function print_element_gph(element, cmd, count, dir, f, i, key, \
label, mass, name, path, source_list, source, str, symbol)
{
dir = outdir "/element/" element
@@ -849,10 +878,12 @@
printf " Periodic Table Of The Elements\n\n" >f
print_table(f)
printf "\n" >>f
printf "[1|List All|%s/list/atomic/|%s|%s]\n", gopher_dir,
gopher_host, gopher_port >>f
+ printf "[1|About|%s/about/|%s|%s]\n", gopher_dir, gopher_host, \
+ gopher_port >>f
printf "[h|Source Code|URL:%s|tilde.pink|70]\n", uri >>f
close(f)
return
}
@@ -942,10 +973,11 @@
csv_read("data/families.csv", families)
csv_read("data/shells.csv", shells)
csv_read("data/sources.csv", sources)
make_source_lookup()
make_table()
+ print_about()
print_elements()
print_families()
print_lists()
print_shells()
print_sources()