Skip to content

Commit

Permalink
flake: mkOutputs: conditionally require asciidoctor-bibtext plugin
Browse files Browse the repository at this point in the history
Require the bibtex-file plugin only when its required bibtex-file
attribute is defined to prevent the following error:

    Error: bibtex-file is not set and automatic search failed

Fixes: a45884d ("flake: mkOutputs: support asciidoctor-bibtext plugin")
  • Loading branch information
trueNAHO committed Nov 14, 2024
1 parent cdf126c commit 1fdd2ae
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,6 @@
]
);

asciidoctorRequire =
map
(library: "asciidoctor-${library}")
["bibtex" "diagram" "mathematical"];

packageName = name: "asciidoctor-nix-${name}";

presentation = {revealJsDir, ...} @ args:
Expand Down Expand Up @@ -278,6 +273,23 @@
);
in
args: let
asciidoctorRequire =
map
(library: "asciidoctor-${library}")
(
["diagram" "mathematical"]
++ lib.optional
(
builtins.any
(
commandOption:
lib.hasPrefix "bibtex-file" commandOption
)
args.commandOptions.attribute or []
)
"bibtex"
);

nonDefaultPackages =
lib.filterAttrs
(name: _: !lib.hasPrefix "default" name)
Expand Down

0 comments on commit 1fdd2ae

Please sign in to comment.