Skip to contentSkip to conversation

docs: Restore "smart quotes" for quotes

PATCH Applied Akira Yokosawa 2 participants 2 messages Feb 25, 2024 – Feb 28, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: Restore "smart quotes" for quotes

Commit eaae75754d81 ("docs: turn off "smart quotes" in the HTML build") disabled conversion of quote marks along with that of dashes. Despite the short summary, the change affects not only HTML build but also other build targets including PDF.

However, as "smart quotes" had been enabled for more than half a decade already, quite a few readers of HTML pages are likely expecting conversions of "foo" -> “foo” and 'bar' -> ‘bar’.

Furthermore, in LaTeX typesetting convention, it is common to use distinct marks for opening and closing quote marks.

To satisfy such readers' expectation, restore conversion of quotes only by setting smartquotes_action [1].

---
 Documentation/conf.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/conf.py +3 -3
index da64c9fb7e07..d148f3e8dd57 100644
@@ -346,9 +346,9 @@ sys.stderr.write("Using %s theme\n" % html_theme)
 html_static_path = ['sphinx-static']
 
 # If true, Docutils "smart quotes" will be used to convert quotes and dashes
-# to typographically correct entities.  This will convert "--" to "—",
-# which is not always what we want, so disable it.
-smartquotes = False
+# to typographically correct entities.  However, conversion of "--" to "—"
+# is not always what we want, so enable only quotes.
+smartquotes_action = 'q'
 
 # Custom sidebar templates, maps document names to template names.
 # Note that the RTD theme ignores this

base-commit: 32ed7930304ca7600a54c2e702098bd2ce7086af

Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 27 lines · Akira Yokosawa

Commit eaae75754d81 ("docs: turn off "smart quotes" in the HTML build") disabled conversion of quote marks along with that of dashes. Despite the short summary, the change affects not only HTML build but also other build targets including PDF.

However, as "smart quotes" had been enabled for more than half a decade already, quite a few readers of HTML pages are likely expecting conversions of "foo" -> “foo” and 'bar' -> ‘bar’.

Furthermore, in LaTeX typesetting convention, it is common to use distinct marks for opening and closing quote marks.

To satisfy such readers' expectation, restore conversion of quotes only by setting smartquotes_action [1].

---
 Documentation/conf.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/conf.py +0 -0
index da64c9fb7e07..d148f3e8dd57 100644

Documentation/conf.py sys.stderr.write("Using %s theme\n" % html_theme) · line 352

Quoted 10 lines
Documentation/conf.py +3 -3
@@ -346,9 +346,9 @@ sys.stderr.write("Using %s theme\n" % html_theme)
 html_static_path = ['sphinx-static']
 
 # If true, Docutils "smart quotes" will be used to convert quotes and dashes
-# to typographically correct entities.  This will convert "--" to "—",
-# which is not always what we want, so disable it.
-smartquotes = False
+# to typographically correct entities.  However, conversion of "--" to "—"
+# is not always what we want, so enable only quotes.
+smartquotes_action = 'q'
 

Applied, thanks.

jon