linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Zipeng Zhang <zhangzipeng0@foxmail.com>
Cc: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com,
	boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com,
	nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com,
	masahiroy@kernel.org, codeagain@codeagain.dev,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	rust-for-linux@vger.kernel.org, llvm@lists.linux.dev,
	Zipeng Zhang <zhangzipeng0@foxmail.com>
Subject: Re: [PATCH] Documentation/process/changes: Escape --options to fix Sphinx output
Date: Thu, 20 Apr 2023 09:40:39 -0600	[thread overview]
Message-ID: <87o7nitvd4.fsf@meer.lwn.net> (raw)
In-Reply-To: <87sfcuu0fm.fsf@meer.lwn.net>

Jonathan Corbet <corbet@lwn.net> writes:

> The right solution, if it is possible, is to convince Sphinx to stop
> messing with "--" altogether.  Substituting em-dashes is of limited
> cosmetic value and, I think, is something we could do without.

Ah ... I get it now.  We *did* disable this once by disabling the
"html_use_smartypants" option in conf.py.  The Sphinx folks changed the
name of that option in the 1.6.6 release, though, silently turning that
behavior back on.  It only took us five years to notice...  I think I'll
just drop the attached patch into docs-next.

Thanks for bringing this up!

jon

------------8<-----------------
From 995addeb4ab2a2c4beaf8b90a4dc8c1d64735d29 Mon Sep 17 00:00:00 2001
From: Jonathan Corbet <corbet@lwn.net>
Date: Thu, 20 Apr 2023 09:34:35 -0600
Subject: [PATCH] docs: turn off "smart quotes" in the HTML build

We have long disabled the "html_use_smartypants" option to prevent Sphinx
from mangling "--" sequences (among others).  Unfortunately, Sphinx changed
that option to "smartquotes" in the 1.6.6 release, and seemingly didn't see
fit to warn about the use of the obsolete option, resulting in the
aforementioned mangling returning.  Disable this behavior again and hope
that the option name stays stable for a while.

Reported-by: Zipeng Zhang <zhangzipeng0@foxmail.com>
Link: https://lore.kernel.org/lkml/tencent_CB1A298D31FD221496FF657CD7EF406E6605@qq.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
 Documentation/conf.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index db16814f182f..3d1f74f76e64 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -343,9 +343,10 @@ sys.stderr.write("Using %s theme\n" % html_theme)
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['sphinx-static']
 
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-html_use_smartypants = False
+# 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
 
 # Custom sidebar templates, maps document names to template names.
 # Note that the RTD theme ignores this
-- 
2.40.0


  reply	other threads:[~2023-04-20 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 10:21 [PATCH] Documentation/process/changes: Escape --options to fix Sphinx output Zipeng Zhang
2023-04-20 13:51 ` Jonathan Corbet
2023-04-20 15:40   ` Jonathan Corbet [this message]
2023-04-20 17:16     ` Miguel Ojeda
2023-04-22  3:39     ` Akira Yokosawa
2023-04-23 15:55       ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7nitvd4.fsf@meer.lwn.net \
    --to=corbet@lwn.net \
    --cc=alex.gaynor@gmail.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=codeagain@codeagain.dev \
    --cc=gary@garyguo.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=trix@redhat.com \
    --cc=wedsonaf@gmail.com \
    --cc=zhangzipeng0@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).