blob: 6a6c42d3810b5d1e60b70cbd8588070cfbfc615c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{
jq,
pandoc,
refsJSON ? ./publications.json,
runCommand,
}:
runCommand "publications" {buildInputs = [jq pandoc];} ''
mkdir -p "$out"/{biblatex,bibtex,csljson}
cd "$out"
jq --compact-output ".[]" ${refsJSON} | while read 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
''
|