diff mbox series

[RFC/NOPATCHv3,3/4] doc: use XML-style escapes only for HTML and XML

Message ID 20210618203057.790320-4-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show
Series doc: asciidoctor: direct man page creation and fixes (brian's version) | expand

Commit Message

Felipe Contreras June 18, 2021, 8:30 p.m. UTC
From: "brian m. carlson" <sandals@crustytoothpaste.net>

Additionally, we don't want to use XML-style escapes for the litdd and
plus macros, so let's only use the XML-style escapes in HTML and XML and
use something different for our man pages.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 Documentation/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Felipe Contreras June 18, 2021, 9:07 p.m. UTC | #1
Felipe Contreras wrote:
> From: "brian m. carlson" <sandals@crustytoothpaste.net>

> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -183,12 +183,15 @@ ASCIIDOC_HTML = xhtml5
>  ASCIIDOC_DOCBOOK = docbook5
>  ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
>  ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
> -ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
> +TXT_TO_HTML += -alitdd='&\#x2d;&\#x2d;'
> +TXT_TO_XML  += -alitdd='&\#x2d;&\#x2d;'
>  DBLATEX_COMMON =
>  XMLTO_EXTRA += --skip-validation
>  XMLTO_EXTRA += -x manpage.xsl
>  ifdef USE_ASCIIDOCTOR_MANPAGE
>  TXT_TO_MAN = $(ASCIIDOC_COMMON) -b manpage
> +TXT_TO_MAN += -aplus='+'
> +TXT_TO_MAN += -alitdd='\--'
>  endif
>  endif
>  

My version of the workaround [1] is much cleaner, and doesn't mess with
the build system:

  if doc.backend == 'manpage'
    doc.attributes.merge!({ 'litdd' => '\--', 'plus' => '+' })
  end

Once asciidoctor issue #4059 is fixed [2] and in widespread use the
above workaround can be removed.

[1] https://lore.kernel.org/git/20210521224452.530852-7-felipe.contreras@gmail.com/
[2] https://github.com/asciidoctor/asciidoctor/issues/4059
diff mbox series

Patch

diff --git a/Documentation/Makefile b/Documentation/Makefile
index d3103c3dde..53ef100a7a 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -183,12 +183,15 @@  ASCIIDOC_HTML = xhtml5
 ASCIIDOC_DOCBOOK = docbook5
 ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
 ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
-ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
+TXT_TO_HTML += -alitdd='&\#x2d;&\#x2d;'
+TXT_TO_XML  += -alitdd='&\#x2d;&\#x2d;'
 DBLATEX_COMMON =
 XMLTO_EXTRA += --skip-validation
 XMLTO_EXTRA += -x manpage.xsl
 ifdef USE_ASCIIDOCTOR_MANPAGE
 TXT_TO_MAN = $(ASCIIDOC_COMMON) -b manpage
+TXT_TO_MAN += -aplus='+'
+TXT_TO_MAN += -alitdd='\--'
 endif
 endif