docs/Makefile: Introduce GENERATE_PANDOC_RULE_RAW

We are going to want to format SUPPORT.md which does not match the
filename patterns in docs/.  So provide a way to make an ad-hoc rule
using pandoc with the standard options.

No functional change in this patch.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Lars Kurth <lars.kurth@citrix.com>
This commit is contained in:
Ian Jackson authored and Ian Jackson committed 2018-04-12 16:13:39 +01:00
1 parent 1e4a834a8f
commit 539f93945c
1 file changed
+6 -5
+6 -5
View File
@@ -237,17 +237,18 @@ txt/%.txt: %.markdown
$(INSTALL_DATA) $< $@
# Metarule for generating pandoc rules.
define GENERATE_PANDOC_RULE
# $(1) is the target documentation format. $(2) is the source format.
$(1)/%.$(1): %.$(2)
define GENERATE_PANDOC_RULE_RAW
$(1): $(2)
ifneq ($(PANDOC),)
@$(INSTALL_DIR) $$(@D)
$(PANDOC) --number-sections --toc --standalone $$< --output $$@
else
@echo "pandoc not installed; skipping $$@"
endif
endef
define GENERATE_PANDOC_RULE
# $(1) is the target documentation format. $(2) is the source format.
$(call GENERATE_PANDOC_RULE_RAW,$(1)/%.$(1),%.$(2))
endef
$(eval $(call GENERATE_PANDOC_RULE,pdf,pandoc)) # pdf/%.pdf: %.pandoc
$(eval $(call GENERATE_PANDOC_RULE,txt,pandoc)) # txt/%.txt: %.pandoc
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.