diff options
| author | aristote <quentin.aristote@irif.fr> | 2025-07-27 13:29:21 +0200 |
|---|---|---|
| committer | aristote <quentin.aristote@irif.fr> | 2025-07-27 13:29:21 +0200 |
| commit | f9d5943d2ba2cf8a756a7b2ed97f4d9327ec4025 (patch) | |
| tree | 2354efef2eb747677a073f4e1b0e8ff2842880f8 /publications | |
| parent | 2988cf33053b396985e49dd509a02675801b5d77 (diff) | |
publications: fix export
Diffstat (limited to 'publications')
| -rw-r--r-- | publications/default.nix | 2 | ||||
| -rw-r--r-- | publications/export.nix | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/publications/default.nix b/publications/default.nix index 553692c..1a15c87 100644 --- a/publications/default.nix +++ b/publications/default.nix @@ -16,5 +16,5 @@ in { reports = importPublications (lib.importJSON ./reports.json); talks = importPublications (lib.importJSON ./talks.json); misc = importPublications (lib.importJSON ./miscellaneous.json); - files = pkgs.callPackage ./export.nix {}; + files = pkgs.callPackage ./export.nix {refsJSON = lib.concatStringsSep " " [./conferences.json ./journals.json ./reports.json ./miscellaneous.json];}; } diff --git a/publications/export.nix b/publications/export.nix index 6a6c42d..93a51f2 100644 --- a/publications/export.nix +++ b/publications/export.nix @@ -1,20 +1,23 @@ { jq, pandoc, - refsJSON ? ./publications.json, + refsJSON, runCommand, }: runCommand "publications" {buildInputs = [jq pandoc];} '' mkdir -p "$out"/{biblatex,bibtex,csljson} cd "$out" - jq --compact-output ".[]" ${refsJSON} | while read 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 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 '' |
