new bbbib and rrref
This commit is contained in:
parent
f94fd8e49c
commit
f8cbdc9aa5
42
bbbib.sh
Executable file
42
bbbib.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
WHERE=$( cd $(dirname $0) ; pwd -P )
|
||||
|
||||
# default configs
|
||||
if [[ -e "$WHERE/CONFIG" ]]; then
|
||||
source $WHERE/CONFIG
|
||||
fi
|
||||
|
||||
OPTIND=1 #reset getopts
|
||||
|
||||
while getopts :b: opts; do
|
||||
case $opts in
|
||||
b)
|
||||
BIB=$OPTARG
|
||||
;;
|
||||
?)
|
||||
echo "invalid option -$OPTARG";
|
||||
exit;
|
||||
;;
|
||||
:)
|
||||
echo "option -$OPTARG requires an argument";
|
||||
exit;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
|
||||
# bibliographe's path set?
|
||||
if [[ -z "$BIBLIOGRAPHE_PATH" ]]; then
|
||||
echo "No bibliographe";
|
||||
exit;
|
||||
fi
|
||||
|
||||
# bibliography exists?
|
||||
if [[ -z "$BIB" ]]; then
|
||||
echo "No bibliography"
|
||||
exit;
|
||||
fi
|
||||
|
||||
node $BIBLIOGRAPHE_PATH/refactorbib.js --data $BIB --index --print
|
||||
60
rrref.sh
Executable file
60
rrref.sh
Executable file
@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
WHERE=$( cd $(dirname $0) ; pwd -P )
|
||||
|
||||
# default configs
|
||||
if [[ -e "$WHERE/CONFIG" ]]; then
|
||||
source $WHERE/CONFIG
|
||||
fi
|
||||
|
||||
OPTIND=1 #reset getopts
|
||||
|
||||
OUT=txt # default output
|
||||
|
||||
while getopts :b:r:o: opts; do
|
||||
case $opts in
|
||||
b)
|
||||
BIB=$OPTARG
|
||||
;;
|
||||
r)
|
||||
REF=$OPTARG
|
||||
;;
|
||||
o)
|
||||
OUT=$OPTARG
|
||||
;;
|
||||
?)
|
||||
echo "invalid option -$OPTARG";
|
||||
exit;
|
||||
;;
|
||||
:)
|
||||
echo "option -$OPTARG requires an argument";
|
||||
exit;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
|
||||
# bibliographe's path set?
|
||||
if [[ -z "$BIBLIOGRAPHE_PATH" ]]; then
|
||||
echo "No bibliographe";
|
||||
exit;
|
||||
fi
|
||||
|
||||
# bibliography exists?
|
||||
if [[ -z "$BIB" ]]; then
|
||||
echo "No bibliography"
|
||||
exit;
|
||||
fi
|
||||
|
||||
# referebce exists?
|
||||
if [[ -z "$REF" ]]; then
|
||||
echo "No reference"
|
||||
exit;
|
||||
fi
|
||||
|
||||
node $BIBLIOGRAPHE_PATH/refactorbib.js --data $BIB > tmpbib.json
|
||||
REFERENCE=$(node $BIBLIOGRAPHE_PATH/generatebib.js --data tmpbib.json --items [\"$REF\"] --output $OUT)
|
||||
echo $REFERENCE
|
||||
rm tmpbib.json
|
||||
|
||||
@ -19,7 +19,7 @@ HTML := $(patsubst %.mmd,$(OUT)%.html,$(wildcard *.mmd))
|
||||
$(OUT)%.html : %.mmd
|
||||
pandoc $< -s --filter pandoc-citeproc --csl $(CSL) --bibliography $(BIB) -o $@
|
||||
|
||||
all : dir $(HTML)
|
||||
all : dir $(HTML) index
|
||||
|
||||
index :
|
||||
parse.py < $(wildcard *.mmd)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user