Explain better why we cannot use filter. ihse-manpages-branch
authorihse
Tue, 23 Oct 2018 14:50:12 +0200
branchihse-manpages-branch
changeset 57001 ffa0fd3138d7
parent 57000 03413eb7301f
child 57002 049469f295f1
Explain better why we cannot use filter.
make/Docs.gmk
--- a/make/Docs.gmk	Tue Oct 23 13:45:24 2018 +0200
+++ b/make/Docs.gmk	Tue Oct 23 14:50:12 2018 +0200
@@ -578,13 +578,15 @@
 	$(CHMOD) a+rx $(PANDOC_FILTER)
 	$(TOUCH) $@
 
-    # Pandoc's default behavior is to convert `code` to \f[C], which do not
-    # show up in normal man page rendering (but shows correctly when generating
-    # html). The norm for man pages is to show code as bold, so this should be
-    # transformed. However, even if we fix this in our pandoc filter, pandoc prior
-    # to version 2.0 cannot properly produced nested formatting in man pages
-    # (see https://github.com/jgm/pandoc/issues/3568).
-    # As a workaround, use post-processing with sed instead.
+    # The norm in man pages is to display code literals as bold, but pandoc
+    # "correctly" converts these constructs (encoded in markdown using `...`
+    # or ```...```) to \f[C]. Ideally, we should use the filter to encapsulate
+    # the Code/CodeBlock in Strong. While this works for Code, pandoc cannot
+    # correctly render man page output for CodeBlock wrapped in Strong. So we
+    # take the easy way out, and post-process the troff output, replacing
+    # \f[C] with \f[CB]. This has the added benefit of working correctly on
+    # pandoc prior to version 2.0, which cannot properly produced nested
+    # formatting in man pages (see https://github.com/jgm/pandoc/issues/3568).
     #
     # As of pandoc 2.3, the termination of formatting is still broken
     # (see https://github.com/jgm/pandoc/issues/4973). We need to replace
@@ -592,7 +594,6 @@
     MAN_POST_PROCESS := $(SED) -e 's/\\f\[C\]/\\f\[CB\]/g' \
         -e 's/\\f\[\]/\\f\[R\]/g'
 
-
     # We assume all man pages should reside in section 1
 
     # Generate man pages from markdown