aboutsummaryrefslogtreecommitdiff
path: root/bin/biblio-yml
blob: 0cb9cd6eb5d8543aca717d8465347593cc9b9e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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:-false}"

# 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