diff options
| author | aristote <quentin.aristote@irif.fr> | 2025-07-29 09:33:08 +0200 |
|---|---|---|
| committer | aristote <quentin.aristote@irif.fr> | 2025-07-29 09:33:32 +0200 |
| commit | ebdf1d48c521ba0925c81453700dcd63a650eeab (patch) | |
| tree | 83f506b4d0ea93f62f36aa75bf3b99cd44893e38 /research/export.nix | |
| parent | 690663d487321edf797a0ee6bfffbee300e5ce35 (diff) | |
publications -> research
Diffstat (limited to 'research/export.nix')
| -rw-r--r-- | research/export.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/research/export.nix b/research/export.nix new file mode 100644 index 0000000..b119054 --- /dev/null +++ b/research/export.nix @@ -0,0 +1,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 +'' |
