209 # If we got markdown files, ignore the troff files |
209 # If we got markdown files, ignore the troff files |
210 ifeq ($(PANDOC), ) |
210 ifeq ($(PANDOC), ) |
211 $(info Warning: pandoc not found. Not generating man pages) |
211 $(info Warning: pandoc not found. Not generating man pages) |
212 else |
212 else |
213 # Create dynamic man pages from markdown using pandoc. We need |
213 # Create dynamic man pages from markdown using pandoc. We need |
214 # PANDOC_FILTER, a wrapper around PANDOC_FILTER_JAVASCRIPT. This is |
214 # PANDOC_TROFF_MANPAGE_FILTER, a wrapper around |
215 # created by buildtools-jdk. |
215 # PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT. This is created by buildtools-jdk. |
216 |
216 |
217 # We should also depend on the source javascript filter |
217 # We should also depend on the source javascript filter |
218 PANDOC_FILTER_JAVASCRIPT := $(TOPDIR)/make/scripts/pandoc-manpage-filter.js |
218 PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT := \ |
|
219 $(TOPDIR)/make/scripts/pandoc-troff-manpage-filter.js |
219 |
220 |
220 # The norm in man pages is to display code literals as bold, but pandoc |
221 # The norm in man pages is to display code literals as bold, but pandoc |
221 # "correctly" converts these constructs (encoded in markdown using `...` |
222 # "correctly" converts these constructs (encoded in markdown using `...` |
222 # or ```...```) to \f[C]. Ideally, we should use the filter to encapsulate |
223 # or ```...```) to \f[C]. Ideally, we should use the filter to encapsulate |
223 # the Code/CodeBlock in Strong. While this works for Code, pandoc cannot |
224 # the Code/CodeBlock in Strong. While this works for Code, pandoc cannot |
236 # Now generate the man pages from markdown using pandoc |
237 # Now generate the man pages from markdown using pandoc |
237 $(eval $(call SetupProcessMarkdown, BUILD_MAN_PAGES, \ |
238 $(eval $(call SetupProcessMarkdown, BUILD_MAN_PAGES, \ |
238 DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \ |
239 DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \ |
239 FILES := $(MAN_FILES_MD), \ |
240 FILES := $(MAN_FILES_MD), \ |
240 FORMAT := man, \ |
241 FORMAT := man, \ |
241 FILTER := $(PANDOC_FILTER), \ |
242 FILTER := $(PANDOC_TROFF_MANPAGE_FILTER), \ |
242 POST_PROCESS := $(MAN_POST_PROCESS), \ |
243 POST_PROCESS := $(MAN_POST_PROCESS), \ |
243 REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \ |
244 REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \ |
244 EXTRA_DEPS := $(PANDOC_FILTER) $(PANDOC_FILTER_JAVASCRIPT), \ |
245 EXTRA_DEPS := $(PANDOC_TROFF_MANPAGE_FILTER) \ |
|
246 $(PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT), \ |
245 )) |
247 )) |
246 |
248 |
247 TARGETS += $(BUILD_MAN_PAGES) |
249 TARGETS += $(BUILD_MAN_PAGES) |
248 endif |
250 endif |
249 else |
251 else |