Remove the custom smartypants code [rebased]#3666
Remove the custom smartypants code [rebased]#3666tk0miya merged 8 commits intosphinx-doc:1.6-releasefrom
Conversation
Instead rely on docutils’ ‘smart_quotes’ option which is available since docutils 0.10. This adds support for internationalization: our code supported only English quotes, while docutils code supports 27 different languages. Closes sphinx-doc#498, sphinx-doc#580, sphinx-doc#3345, sphinx-doc#3472.
|
LGTM! |
|
LGTM ! |
|
Merged. Thank you for great work! @jfbu good reviewing! |
|
@mitya57 thanks for all your efforts, we count upon you to continue backporting docutils fixes if needed ;-) |
|
Hi @mitya57 do you mind if we add your name at https://github.com/sphinx-doc/sphinx/blob/1.6-release/CHANGES#L28 in a "Thanks ... " notice for 1.6 release ? |
|
... and I will ask the same from G. M. at docutils |
|
@jfbu Of course I do not mind. |
|
@mitya57 ok, great! sometimes people prefer anonymity. I will add a thanks to G. M. too ! |
|
Just wanted to note that having Sphinx recommend users use a |
|
@ericholscher In #3562 (comment), I proposed two options: dropping the option completely or making it map to the docutils option. Then @tk0miya voted for removing it. A regular user would rarely need to use What is your use case? |
|
I think the main pain point here is that the warning seems to imply that we need a global config to have nice quotes. Maybe change the wording to “it’s on by default, if you need further configurability refer to…”? |
|
Good idea, done in #3795. |
|
Sphinx has supports docutils.conf from the past (maybe 1.2 or 1.3). It's not new feature. |
Closes: sphinx-doc#3788, sphinx-doc#3806 Trick Docutils into thinking the document is with language set to ``'en'`` else its smartquotes transform will refuse to apply, even if it knows the language, in case the language has no Docutils localisation available. Refs: sphinx-doc#3666
Closes: sphinx-doc#3788, sphinx-doc#3806 Trick Docutils into thinking the document is with language set to ``'en'`` else its smartquotes transform will refuse to apply, even if it knows the language, in case the language has no Docutils localisation available. Refs: sphinx-doc#3666
This incorporates fixes from 0.14rc1 which were not in the PR sphinx-doc#3666 merged in 1.6.1, and extra language configurations and fixes for quotes. Only active if Docutils is at 0.13.1 or earlier.
Remove the custom smartypants code, instead rely on docutils’ ‘smart_quotes’ option which is available since docutils 0.10. See #3345 for details.
This adds support for internationalization: our code supported only English quotes, while docutils code supports 27 different languages.
Add tests for English, French and Russian smart quotes.
Remove sphinxquotedblleft and sphinxquotedblright, should be no longer needed.