Thread (9 messages) 9 messages, 5 authors, 2020-02-25

Re: [PATCH] docs: process: changes.rst: Escape --version to fix Sphinx output

From: Randy Dunlap <hidden>
Date: 2020-02-24 21:08:20
Also in: lkml

On 2/24/20 11:12 AM, Matthew Wilcox wrote:
On Mon, Feb 24, 2020 at 11:58:51AM -0700, Jonathan Corbet wrote:
quoted
On Mon, 24 Feb 2020 10:52:27 -0800
Matthew Wilcox [off-list ref] wrote:
quoted
On Mon, Feb 24, 2020 at 07:47:19PM +0100, Jonathan Neuschäfer wrote:
quoted
On Mon, Feb 24, 2020 at 11:08:15AM -0700, Jonathan Corbet wrote:  
quoted
On Sun, 23 Feb 2020 23:22:27 +0100
Jonathan Neuschäfer [off-list ref] wrote:
  
quoted
Without double-backticks, Sphinx wrongly turns "--version" into
"–version" with a Unicode EN DASH (U+2013), that is visually easy to
confuse with a single ASCII dash.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>  
This certainly seems worth addressing.  But I would *really* rather find
a way to tell Sphinx not to do that rather than making all of these
tweaks - which we will certainly find ourselves having to do over and
over again.  I can try to look into that in a bit, but if somebody were
to beat me to it ... :)  
This seems to do the trick:
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 3c7bdf4cd31f..8f2a7ae95184 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -587,6 +587,9 @@ pdf_documents = [
 kerneldoc_bin = '../scripts/kernel-doc'
 kerneldoc_srctree = '..'

+# Render -- as two dashes
+smartquotes = False  
I think what Jon was looking for was the ability to selectively turn
smartquotes off for a section and then reenable it?
No that's not what I was thinking, actually.  Unless somebody can come up
with a good reason to the contrary, just disabling that behavior globally
strikes me as the right thing to do.
Well, sometimes -- when the time is right -- I like to use en-dashes.
It's probably no great loss, though.

grep finds me these interesting examples:

Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst:Tree RCU's grace--period memory-ordering guarantees rely most heavily on
Documentation/accounting/psi.rst:scarcity aids users in sizing workloads to hardware--or provisioning
Documentation/admin-guide/acpi/cppc_sysfs.rst:  -r--r--r-- 1 root root 65536 Mar  5 19:38 feedback_ctrs
Documentation/admin-guide/mm/hugetlbpage.rst:task that modifies ``nr_hugepages``. The default for the allowed nodes--when the
Documentation/block/null_blk.rst:home_node=[0--nr_nodes]: Default: NUMA_NO_NODE
Documentation/admin-guide/svga.rst::Copyright: |copy| 1995--1999 Martin Mares, [off-list ref]
Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst:        G\ :sub:`0108high`\ (bits 1--0)

(in all, 368 lines, but they're not all in .rst files)
Not trying to be contrary, but I would prefer to keep .rst files as much
ASCII as possible.

-- 
~Randy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help