blob: b1190543557f8236d6b12e068d58bc8f356b54aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{
jq,
pandoc,
refsJSON,
runCommand,
}:
runCommand "publications" {buildInputs = [jq pandoc];} ''
mkdir -p "$out"/{biblatex,bibtex,csljson}
cd "$out"
for refs in ${refsJSON}
do
jq --compact-output ".[]" $refs | while read -r ref
do
id=$(echo "$ref" | jq --raw-output '.id')
echo $id
echo "$ref" > "csljson/$id"
cat csljson/$id
pandoc --from=csljson --to=biblatex --output "biblatex/$id" <<< "[ $ref ]"
pandoc --from=csljson --to=bibtex --output "bibtex/$id" <<< "[ $ref ]"
done
done
''
|