From e5e7cb94b39b0eed0a78599cee9d0e9d6a5de03c Mon Sep 17 00:00:00 2001 From: Chayanon Somatanai Date: Sat, 20 Jun 2026 16:28:33 +0700 Subject: [PATCH] fix: move TOPICS:START marker before table header GitHub's markdown parser breaks table rendering when an HTML comment appears between the header separator and data rows. Moving the marker before the header keeps the full table inside the START/END block. Also update sync-topics.sh to include the header rows in table_block so regeneration doesn't strip them. --- README.md | 2 +- docs/CONVENTIONS.md | 2 +- scripts/sync-topics.sh | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) 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 | "