diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-09-28 16:51:05 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-11-10 10:48:59 +0100 |
commit | 3381cd924d28e29abf318235e8827e4f71997b25 (patch) | |
tree | 62122790c17ef5559a3bbe4ed014ed538935430e | |
parent | fe008d9a8e24e043de00cecc2754908f57d0a00e (diff) | |
download | rules-typesetting-3381cd924d28e29abf318235e8827e4f71997b25.tar.gz |
pandoc: Add data field to standalone
-rw-r--r-- | pandoc/RULES | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/pandoc/RULES b/pandoc/RULES index 7ce5433..4a869c9 100644 --- a/pandoc/RULES +++ b/pandoc/RULES @@ -150,13 +150,14 @@ } , "standalone": { "doc": ["Create a standalone document from the given inputs"] - , "target_fields": ["srcs", "template"] + , "target_fields": ["srcs", "template", "data"] , "string_fields": ["out", "meta data"] , "field_doc": { "srcs": [ "The files to build the document from, in order." , "Honors the order within a [\"files\", \"ordered\"] target." ] + , "data": ["Additional files needed for building (e.g., images)"] , "out": ["The name of the output file.", "Must not conflict with input files."] , "template": ["The template definition to use"] @@ -211,12 +212,37 @@ , "$1": {"type": "var", "name": "srcs"} } ] - , [ "data" + , [ "extra" , { "type": "disjoint_map_union" , "msg": "Data files may not conflict" , "$1": { "type": "foreach" , "var": "x" + , "range": {"type": "FIELD", "name": "data"} + , "body": + { "type": "map_union" + , "$1": + [ {"type": "DEP_RUNFILES", "dep": {"type": "var", "name": "x"}} + , { "type": "DEP_ARTIFACTS" + , "dep": {"type": "var", "name": "x"} + } + ] + } + } + } + ] + , [ "extra" + , { "type": "to_subdir" + , "subdir": "data" + , "$1": {"type": "var", "name": "extra"} + } + ] + , [ "data" + , { "type": "disjoint_map_union" + , "msg": "Template files may not conflict" + , "$1": + { "type": "foreach" + , "var": "x" , "range": {"type": "FIELD", "name": "template"} , "body": { "type": "map_union" @@ -233,7 +259,14 @@ , [ "data" , { "type": "to_subdir" , "subdir": "data" - , "$1": {"type": "var", "name": "data"} + , "$1": + { "type": "disjoint_map_union" + , "msg": "Template may not contain a \"data\" directory" + , "$1": + [ {"type": "var", "name": "data"} + , {"type": "var", "name": "extra"} + ] + } } ] , [ "lua filters" |