aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/biblio-yml28
-rwxr-xr-xbin/compile-book6
-rwxr-xr-xbin/compile-notes6
3 files changed, 30 insertions, 10 deletions
diff --git a/bin/biblio-yml b/bin/biblio-yml
new file mode 100755
index 0000000..83355b4
--- /dev/null
+++ b/bin/biblio-yml
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+#
+# Markdown inclusion generator that can be easily symlinked/copied by
+# Pandoc-compatible works.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+DIRNAME="`dirname $0`"
+BASEDIR="$DIRNAME/.."
+PREFIX="${1:-biblio}"
+HEADER="${2:-true}"
+
+# Go to main folder
+cd $BASEDIR
+
+# Header
+if [ "$HEADER" != "false" ]; then
+ echo "# Bibliography sources"
+ echo "# Automatically generated by $BASENAME"
+ echo "bibliography:"
+fi
+
+# Compile
+#for file in *.bib; do
+find -name '*.bib' | sed -e 's|^./||' | while read file; do
+ echo " - $PREFIX/$file"
+done
diff --git a/bin/compile-book b/bin/compile-book
index 643bf78..c806189 100755
--- a/bin/compile-book
+++ b/bin/compile-book
@@ -33,11 +33,7 @@ cat _book.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
# Bibliography
-echo 'bibliography:' >> $OUTPUT.md
-find -name _biblio.yml | while read file; do
- #cat $file >> $OUTPUT.md ; echo "" >> $OUTPUT.md
- grep -v '^bibliography:' $file >> $OUTPUT.md ; echo "" >> $OUTPUT.md
-done
+$BASEDIR/bin/biblio-yml > _biblio.yml
# YAML headers
for file in $BASEDIR/$STRUCTURE/00*.yml; do
diff --git a/bin/compile-notes b/bin/compile-notes
index 910e180..6da65dd 100755
--- a/bin/compile-notes
+++ b/bin/compile-notes
@@ -33,11 +33,7 @@ cat _notes.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
# Bibliography
-echo 'bibliography:' >> $OUTPUT.md
-find -name _biblio.yml | while read file; do
- #cat $file >> $OUTPUT.md ; echo "" >> $OUTPUT.md
- grep -v '^bibliography:' $file >> $OUTPUT.md ; echo "" >> $OUTPUT.md
-done
+$BASEDIR/bin/biblio-yml > _biblio.yml
# YAML headers
for file in $BASEDIR/$STRUCTURE/00*.yml; do