From f5c814c49c37637877bc518ba7c565bf3c057a19 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Tue, 12 Aug 2025 15:26:08 +0200 Subject: rename any last instances of 'publications' to 'research' --- research/export.nix | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'research/export.nix') diff --git a/research/export.nix b/research/export.nix index b119054..22c965d 100644 --- a/research/export.nix +++ b/research/export.nix @@ -4,20 +4,27 @@ refsJSON, runCommand, }: -runCommand "publications" {buildInputs = [jq pandoc];} '' - mkdir -p "$out"/{biblatex,bibtex,csljson} - cd "$out" +runCommand "export-research-bib" + { + buildInputs = [ + jq + pandoc + ]; + } + '' + mkdir -p "$out"/{biblatex,bibtex,csljson} + cd "$out" - for refs in ${refsJSON} - do - jq --compact-output ".[]" $refs | while read -r ref + for refs in ${refsJSON} 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 ]" + 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 - done -'' + '' -- cgit v1.2.3