From 63e1353e5f3f4a84fdab65f20ce9dd64fda55d45 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sun, 9 Jun 2024 15:19:12 +0200 Subject: [PATCH] adjust files to allow more auto-generation --- Makefile | 2 +- README.md | 2 +- Mechanics/parse.sh => parse.sh | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) rename Mechanics/parse.sh => parse.sh (62%) diff --git a/Makefile b/Makefile index bdcda7d..2d3c971 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ overview.pdf:| rubbish/overview.pdf rubbish/overview.pdf: overview.tex overview.tex: overview.md | rubbish/ - lowdown -stlatex overview.md > overview.tex + lowdown -stlatex -m shiftheadinglevelby=1 overview.md > overview.tex rubbish/overview.pdf: overview.tex pdflatex -output-directory rubbish/ overview.tex diff --git a/README.md b/README.md index 3579208..47ca1cc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Plan Read the overview. -PDF Dependencies +Dependencies ============ - `texlive` diff --git a/Mechanics/parse.sh b/parse.sh similarity index 62% rename from Mechanics/parse.sh rename to parse.sh index f424095..72ddf4d 100755 --- a/Mechanics/parse.sh +++ b/parse.sh @@ -2,6 +2,13 @@ target="$1" +cd "$(dirname "$target")" + +fileName="$(basename "$target")" +sectionName="$(basename -s .md "$target" | tr '_' ' ')" + +printf "\n\n# $sectionName\n" + while read -r line; do echo "$line" | grep -q '^.so ' && \ file="$(echo "$line" | grep '^.so ' | cut -d' ' -f2 )" && \ @@ -10,4 +17,5 @@ echo "$line" | grep -q '^.so ' && \ cat "$file" | graph-easy --boxart && \ echo '```' || \ echo "$line" -done < "$target" +done < "$fileName" +