summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylan Kammer <taylan.kammer@gmail.com>2025-03-29 11:10:24 +0100
committerTaylan Kammer <taylan.kammer@gmail.com>2025-03-29 11:10:24 +0100
commit451aa92846b5fd5c8a0739336de3aa26d741d750 (patch)
tree21e51213bf1d39c2a8677060c51d83a656873786
parent5025f9acf31cd880bbff62ff47ed03b69a0025ee (diff)
Relocate MD sources for HTML notes.
-rwxr-xr-xhtml/gen.sh31
-rw-r--r--notes/booleans.md (renamed from html/notes/booleans.md)0
-rw-r--r--notes/compile.md (renamed from html/notes/compile.md)0
-rw-r--r--notes/cons.md (renamed from html/notes/cons.md)0
-rw-r--r--notes/equal.md (renamed from html/notes/equal.md)0
-rw-r--r--notes/fastcons.md (renamed from html/notes/fastcons.md)0
-rw-r--r--notes/format.md (renamed from html/notes/format.md)0
-rw-r--r--notes/immutable.md (renamed from html/notes/immutable.md)0
-rw-r--r--notes/let.md (renamed from html/notes/let.md)0
-rw-r--r--notes/macros.md (renamed from html/notes/macros.md)0
-rw-r--r--notes/nan.md (renamed from html/notes/nan.md)0
-rw-r--r--notes/oop.md (renamed from html/notes/oop.md)0
-rw-r--r--notes/reader.md (renamed from html/notes/reader.md)0
-rw-r--r--notes/records.md (renamed from html/notes/records.md)0
-rw-r--r--notes/serialize.md (renamed from html/notes/serialize.md)0
-rw-r--r--notes/sr.md (renamed from html/notes/sr.md)0
-rw-r--r--notes/strict-mode.md (renamed from html/notes/strict-mode.md)0
-rw-r--r--notes/sugar.md (renamed from html/notes/sugar.md)0
-rw-r--r--notes/symbols.md (renamed from html/notes/symbols.md)0
-rw-r--r--notes/zero-values.md (renamed from html/notes/zero-values.md)0
20 files changed, 18 insertions, 13 deletions
diff --git a/html/gen.sh b/html/gen.sh
index 3ed9482..df78d25 100755
--- a/html/gen.sh
+++ b/html/gen.sh
@@ -2,24 +2,29 @@
set -euo pipefail
-if [ $# -eq 0 ]
-then
- exec find . -name \*.md -exec "$0" {} +
-fi
-
-for file
-do
- if ! [ -f "$file" ]
+md2ht() {
+ src=$1
+ dst=$2
+ if ! [ -f "$src" ]
then
- echo >&2 "File not found: $file"
+ echo >&2 "File not found: $src"
continue
fi
- echo "$file"
+ echo "$src -> $dst"
{
- title=$(sed '/^# / { s/# //; q }' "$file")
+ title=$(sed 's/# //; q' "$src")
sed "s/__TITLE__/$title/" prelude.html
echo "<body>"
- markdown2 "$file" -x fenced-code-blocks,highlightjs-lang,tables
+ markdown2 "$src" -x fenced-code-blocks,highlightjs-lang,tables
echo "</body>"
- } > "${file%.md}".html
+ } > "$dst"
+}
+
+md2ht index.md index.html
+
+for note in ../notes/*.md
+do
+ name=${note#../notes/}
+ name=${name%.md}
+ md2ht "$note" "notes/$name.html"
done
diff --git a/html/notes/booleans.md b/notes/booleans.md
index 61b9d7e..61b9d7e 100644
--- a/html/notes/booleans.md
+++ b/notes/booleans.md
diff --git a/html/notes/compile.md b/notes/compile.md
index 4d5fc6d..4d5fc6d 100644
--- a/html/notes/compile.md
+++ b/notes/compile.md
diff --git a/html/notes/cons.md b/notes/cons.md
index 29bb2d6..29bb2d6 100644
--- a/html/notes/cons.md
+++ b/notes/cons.md
diff --git a/html/notes/equal.md b/notes/equal.md
index 8c55faa..8c55faa 100644
--- a/html/notes/equal.md
+++ b/notes/equal.md
diff --git a/html/notes/fastcons.md b/notes/fastcons.md
index 3dd4c3a..3dd4c3a 100644
--- a/html/notes/fastcons.md
+++ b/notes/fastcons.md
diff --git a/html/notes/format.md b/notes/format.md
index f757736..f757736 100644
--- a/html/notes/format.md
+++ b/notes/format.md
diff --git a/html/notes/immutable.md b/notes/immutable.md
index 78652e9..78652e9 100644
--- a/html/notes/immutable.md
+++ b/notes/immutable.md
diff --git a/html/notes/let.md b/notes/let.md
index 4af41bd..4af41bd 100644
--- a/html/notes/let.md
+++ b/notes/let.md
diff --git a/html/notes/macros.md b/notes/macros.md
index 3169c49..3169c49 100644
--- a/html/notes/macros.md
+++ b/notes/macros.md
diff --git a/html/notes/nan.md b/notes/nan.md
index f8f3f80..f8f3f80 100644
--- a/html/notes/nan.md
+++ b/notes/nan.md
diff --git a/html/notes/oop.md b/notes/oop.md
index 0821b42..0821b42 100644
--- a/html/notes/oop.md
+++ b/notes/oop.md
diff --git a/html/notes/reader.md b/notes/reader.md
index ebbe1ea..ebbe1ea 100644
--- a/html/notes/reader.md
+++ b/notes/reader.md
diff --git a/html/notes/records.md b/notes/records.md
index b93e0c3..b93e0c3 100644
--- a/html/notes/records.md
+++ b/notes/records.md
diff --git a/html/notes/serialize.md b/notes/serialize.md
index 8e5d49b..8e5d49b 100644
--- a/html/notes/serialize.md
+++ b/notes/serialize.md
diff --git a/html/notes/sr.md b/notes/sr.md
index 0fa9e06..0fa9e06 100644
--- a/html/notes/sr.md
+++ b/notes/sr.md
diff --git a/html/notes/strict-mode.md b/notes/strict-mode.md
index 5b99386..5b99386 100644
--- a/html/notes/strict-mode.md
+++ b/notes/strict-mode.md
diff --git a/html/notes/sugar.md b/notes/sugar.md
index 217b0d3..217b0d3 100644
--- a/html/notes/sugar.md
+++ b/notes/sugar.md
diff --git a/html/notes/symbols.md b/notes/symbols.md
index 280fd9f..280fd9f 100644
--- a/html/notes/symbols.md
+++ b/notes/symbols.md
diff --git a/html/notes/zero-values.md b/notes/zero-values.md
index 3a1eecb..3a1eecb 100644
--- a/html/notes/zero-values.md
+++ b/notes/zero-values.md