Skip to content

Commit

Permalink
elisp_manual: Support additional input files.
Browse files Browse the repository at this point in the history
Fixes #570.
  • Loading branch information
phst committed Aug 21, 2024
1 parent 8f74d48 commit 0810e14
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
7 changes: 6 additions & 1 deletion elisp/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def _elisp_manual_impl(ctx):
fail("Output filename {} doesn’t end in “.texi”".format(out.short_path))
ctx.actions.run(
outputs = [out],
inputs = [src],
inputs = [src] + ctx.files.additional_inputs,
executable = ctx.executable._export,
arguments = [ctx.actions.args().add(src).add(out)],
mnemonic = "Export",
Expand All @@ -759,6 +759,11 @@ elisp_manual = rule(
doc = "Texinfo manual file to write; must end in `.texi`.",
mandatory = True,
),
"additional_inputs": attr.label_list(
doc = "List of additional files made available during export",
allow_files = True,
cfg = "exec",
),
"_export": attr.label(
allow_single_file = True,
executable = True,
Expand Down
1 change: 1 addition & 0 deletions examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ elisp_manual(
name = "doc",
src = "doc.org",
out = "doc.texi",
additional_inputs = ["config.org"],
)

genrule(
Expand Down
16 changes: 16 additions & 0 deletions examples/config.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2021, 2022, 2024 Philipp Stephani
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#+LANGUAGE: en
#+OPTIONS: author:nil date:nil
5 changes: 2 additions & 3 deletions examples/doc.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021, 2022 Google LLC
# Copyright 2021, 2022, 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,8 +13,7 @@
# limitations under the License.

#+TITLE: Example documentation
#+LANGUAGE: en
#+OPTIONS: author:nil date:nil
#+SETUPFILE: examples/config.org

* Chapter

Expand Down

0 comments on commit 0810e14

Please sign in to comment.