[PATCH] doc: Disable SmartyPants in generated manual pages

classic Classic list List threaded Threaded
3 messages Options
Vladimir Panteleev Vladimir Panteleev
Reply | Threaded
Open this post in threaded view
|

[PATCH] doc: Disable SmartyPants in generated manual pages

By default, Sphinx tries to pre-process text through SmartyPants,
which attempts to convert ASCII quotes and dashes to Unicode
characters. Unfortunately, this mangles technical text such as command
lines. For instance, this excerpt from notmuch-tag.rst:

  **notmuch** **tag** **--batch** [--input=<*filename*>]

got turned into:

  notmuch tag –batch [–input=<filename>]

That's an en-dash and an em-dash respectively.

Not only are these characters visually confusing and could easily be
mistaken for a single dash, copying and pasting such command lines
into a terminal is doomed to result in incomprehensible error
messages.

* doc/conf.py: Disable SmartyPants.
---
 doc/conf.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/conf.py b/doc/conf.py
index aa864b3c..0e65413d 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -47,6 +47,10 @@ html_static_path = []
 # Output file base name for HTML help builder.
 htmlhelp_basename = 'notmuchdoc'
 
+# Disable SmartyPants, as it mangles command lines.
+# Despite the name, this actually affects manual pages as well.
+html_use_smartypants = False
+
 # -- Options for manual page output ---------------------------------------
 
 # One entry per manual page. List of tuples
--
2.13.3

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] doc: Disable SmartyPants in generated manual pages

On Mon, Aug 14 2017, Vladimir Panteleev wrote:

> By default, Sphinx tries to pre-process text through SmartyPants,
> which attempts to convert ASCII quotes and dashes to Unicode
> characters. Unfortunately, this mangles technical text such as command
> lines. For instance, this excerpt from notmuch-tag.rst:
>
>   **notmuch** **tag** **--batch** [--input=<*filename*>]
>
> got turned into:
>
>   notmuch tag –batch [–input=<filename>]
>
> That's an en-dash and an em-dash respectively.
>
> Not only are these characters visually confusing and could easily be
> mistaken for a single dash, copying and pasting such command lines
> into a terminal is doomed to result in incomprehensible error
> messages.

I agree. LGTM. works as advertised.

Tomi

>
> * doc/conf.py: Disable SmartyPants.
> ---
>  doc/conf.py | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/doc/conf.py b/doc/conf.py
> index aa864b3c..0e65413d 100644
> --- a/doc/conf.py
> +++ b/doc/conf.py
> @@ -47,6 +47,10 @@ html_static_path = []
>  # Output file base name for HTML help builder.
>  htmlhelp_basename = 'notmuchdoc'
>  
> +# Disable SmartyPants, as it mangles command lines.
> +# Despite the name, this actually affects manual pages as well.
> +html_use_smartypants = False
> +
>  # -- Options for manual page output ---------------------------------------
>  
>  # One entry per manual page. List of tuples
> --
> 2.13.3
>
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] doc: Disable SmartyPants in generated manual pages

In reply to this post by Vladimir Panteleev
Vladimir Panteleev <[hidden email]> writes:

> * doc/conf.py: Disable SmartyPants.

pushed.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch