diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-06-10 16:21:34 +0100 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-06-10 16:21:34 +0100 |
commit | 6cf6f3fc219b210cb2a450dc69134fc0786f7e76 (patch) | |
tree | 34104aae45dadc1bfbe71b613a8383321d2d1b04 | |
parent | dd3c246fbc3d3dbb829e1a5e4b2dadfa87286d7f (diff) | |
download | bookup-6cf6f3fc219b210cb2a450dc69134fc0786f7e76.tar.gz bookup-6cf6f3fc219b210cb2a450dc69134fc0786f7e76.tar.bz2 |
Feat: improved bibliography handling
-rw-r--r-- | ChangeLog.md | 6 | ||||
-rw-r--r-- | _biblio.yml | 5 | ||||
-rwxr-xr-x | bin/biblio-yml | 28 | ||||
-rwxr-xr-x | bin/compile-book | 6 | ||||
-rwxr-xr-x | bin/compile-notes | 6 |
5 files changed, 38 insertions, 13 deletions
diff --git a/ChangeLog.md b/ChangeLog.md index 6c83cbb..22dd27d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,11 @@ # ChangeLog +## v0.1.2 - 2024-06-10 + +### Featues + +* [x] Improved BibTeX bibliography handling. + ## v0.1.1 - 2024-06-10 ### Fixes diff --git a/_biblio.yml b/_biblio.yml index f7de9f5..d5275b5 100644 --- a/_biblio.yml +++ b/_biblio.yml @@ -1,5 +1,4 @@ # Bibliography sources +# Automatically generated by biblio-yml bibliography: - # Custom entries - #- images/images.bib - - bookup.bib + - biblio/bookup.bib 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 |