Skip to content

Commit 69abb19

Browse files
committed
Merge branch 'tr/maint-roff-quote' into maint
* tr/maint-roff-quote: Quote ' as \(aq in manpages
2 parents f411c43 + 204d363 commit 69abb19

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

Documentation/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ ifdef DOCBOOK_SUPPRESS_SP
103103
XMLTO_EXTRA += -m manpage-suppress-sp.xsl
104104
endif
105105

106+
# If your target system uses GNU groff, it may try to render
107+
# apostrophes as a "pretty" apostrophe using unicode. This breaks
108+
# cut&paste, so you should set GNU_ROFF to force them to be ASCII
109+
# apostrophes. Unfortunately does not work with non-GNU roff.
110+
ifdef GNU_ROFF
111+
XMLTO_EXTRA += -m manpage-quote-apos.xsl
112+
endif
113+
106114
SHELL_PATH ?= $(SHELL)
107115
# Shell quote;
108116
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))

Documentation/manpage-quote-apos.xsl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2+
version="1.0">
3+
4+
<!-- work around newer groff/man setups using a prettier apostrophe
5+
that unfortunately does not quote anything when cut&pasting
6+
examples to the shell -->
7+
<xsl:template name="escape.apostrophe">
8+
<xsl:param name="content"/>
9+
<xsl:call-template name="string.subst">
10+
<xsl:with-param name="string" select="$content"/>
11+
<xsl:with-param name="target">'</xsl:with-param>
12+
<xsl:with-param name="replacement">\(aq</xsl:with-param>
13+
</xsl:call-template>
14+
</xsl:template>
15+
16+
</xsl:stylesheet>

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ all::
159159
# Define ASCIIDOC_NO_ROFF if your DocBook XSL escapes raw roff directives
160160
# (versions 1.72 and later and 1.68.1 and earlier).
161161
#
162+
# Define GNU_ROFF if your target system uses GNU groff. This forces
163+
# apostrophes to be ASCII so that cut&pasting examples to the shell
164+
# will work.
165+
#
162166
# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
163167
# MakeMaker (e.g. using ActiveState under Cygwin).
164168
#

0 commit comments

Comments
 (0)