diff options
| author | aristote <quentin.aristote@irif.fr> | 2025-08-01 12:44:41 +0200 |
|---|---|---|
| committer | aristote <quentin.aristote@irif.fr> | 2025-08-01 12:44:41 +0200 |
| commit | 7132af9e3a7f84cebe287b3174f2d4a9c25252ca (patch) | |
| tree | 7d7ef9c12a37289725f0773049f50f2c3717c629 /research/export.nix | |
| parent | ac54a9c2e1f1dd6abd56be9f9a02c7741ab9b731 (diff) | |
| parent | 152a5c4697c257b7eeb91ad1a3dca74c44973f91 (diff) | |
Merge branch 'new-pub-format'
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 +'' |
