aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-06-09 12:18:06 +0100
committerSilvio Rhatto <rhatto@riseup.net>2024-06-09 12:18:06 +0100
commita45b39d7995e4c0b57272d4fc286eb54e02b9c70 (patch)
tree46f3a8bafc32df8b02d5c1906137c2881e9d8ce1 /bin
parentab90f9241d0867206858c306c8d7fb08ee7f0275 (diff)
downloadbookup-a45b39d7995e4c0b57272d4fc286eb54e02b9c70.tar.gz
bookup-a45b39d7995e4c0b57272d4fc286eb54e02b9c70.tar.bz2
Unified configuration for book and notes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/compile-book10
-rwxr-xr-xbin/compile-notes16
2 files changed, 22 insertions, 4 deletions
diff --git a/bin/compile-book b/bin/compile-book
index 75c417b..f452d4b 100755
--- a/bin/compile-book
+++ b/bin/compile-book
@@ -7,6 +7,7 @@
BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`"
DIRNAME="`dirname $0`"
BASEDIR="$DIRNAME/.."
+STRUCTURE="structure/book"
OUTPUT="${1:-book}"
REVISION="$2"
DATE="$3"
@@ -15,7 +16,8 @@ DATE="$3"
rm -f $OUTPUT.md $OUTPUT.Rmd
# Bookup config
-cat _bookup.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
+cat _book.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
+cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
# Bibliography
find -name _biblio.yml | while read file; do
@@ -23,13 +25,13 @@ find -name _biblio.yml | while read file; do
done
# YAML headers
-for file in $BASEDIR/structure/00*.yml; do
+for file in $BASEDIR/$STRUCTURE/00*.yml; do
cat $file >> $OUTPUT.md
echo "---" >> $OUTPUT.md
done
# Markdown headers
-for file in $BASEDIR/structure/00*.md; do
+for file in $BASEDIR/$STRUCTURE/00*.md; do
cat $file >> $OUTPUT.md
echo "" >> $OUTPUT.md
done
@@ -43,7 +45,7 @@ find content/sections -type f | grep '\.md$' | sort | while read file; do
done
# Footers
-for file in $BASEDIR/structure/99*.md; do
+for file in $BASEDIR/$STRUCTURE/99*.md; do
cat $file >> $OUTPUT.md
echo "" >> $OUTPUT.md
done
diff --git a/bin/compile-notes b/bin/compile-notes
index 1e55dcc..efeca68 100755
--- a/bin/compile-notes
+++ b/bin/compile-notes
@@ -7,6 +7,7 @@
BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`"
DIRNAME="`dirname $0`"
BASEDIR="$DIRNAME/.."
+STRUCTURE="structure/notes"
OUTPUT="${1:-notes}"
REVISION="$2"
DATE="$3"
@@ -14,6 +15,21 @@ DATE="$3"
# Remove any dangling output files
rm -f $OUTPUT.md
+# Notes config
+cat _notes.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
+cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
+
+# Bibliography
+find -name _biblio.yml | while read file; do
+ cat $file >> $OUTPUT.md ; echo "" >> $OUTPUT.md
+done
+
+# YAML headers
+for file in $BASEDIR/$STRUCTURE/00*.yml; do
+ cat $file >> $OUTPUT.md
+ echo "---" >> $OUTPUT.md
+done
+
# Content
find content/notes -type f | grep '\.md$' | sort | while read file; do
cat $file >> $OUTPUT.md