diff --git a/README.md b/README.md index a7f2845..b03fba7 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ Every problem has one primary topic. The prefix is the first part of the file name; problems that span a few areas pick one primary topic and put the rest in their tags. + | Prefix | Topic | |--------|-------| - | `calc` | Calculus | | `linalg` | Linear Algebra | | `alg` | Abstract Algebra | diff --git a/docs/CONVENTIONS.md b/docs/CONVENTIONS.md index 80a87fe..e441b09 100644 --- a/docs/CONVENTIONS.md +++ b/docs/CONVENTIONS.md @@ -25,9 +25,9 @@ hook, and CI all read it from there, and the tables in the docs are filled in from it by `make topics`. So to add a topic, edit `topics.txt` and run `make topics` - don't edit the table below by hand (CI fails if it drifts). + | Prefix | Topic | |--------|-------| - | `calc` | Calculus | | `linalg` | Linear Algebra | | `alg` | Abstract Algebra | diff --git a/scripts/sync-topics.sh b/scripts/sync-topics.sh index 06a7e78..341ada7 100644 --- a/scripts/sync-topics.sh +++ b/scripts/sync-topics.sh @@ -27,7 +27,9 @@ TARGETS=( # Render the three block formats from topics.txt. parse() { awk 'NF && $1 !~ /^#/ { name=$0; sub(/^[ \t]*[^ \t]+[ \t]+/, "", name); print $1 "\t" name }' "$TOPICS"; } -table_block=""; dropdown_block=""; prefixes="" +table_block="| Prefix | Topic | +|--------|-------| +"; dropdown_block=""; prefixes="" while IFS=$'\t' read -r prefix name; do table_block="$table_block| \`$prefix\` | $name | "