sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.43k stars 2.1k forks source link

Move smart_quotes feature to post_transform #4371

Open tk0miya opened 6 years ago

tk0miya commented 6 years ago

Problem

Procedure to reproduce the problem

$ make html text
or
$ make text html

(with #4360)

Error logs / results

Expected results

Note:

CendioOssman commented 2 years ago

I'm not sure what the issue is here? The transform doesn't look like it is doing terribly complex things. So what is preventing it from just being changed to a post transform?

We got hit by this by doing both man pages and html output with a shared doctree cache. And suddenly the order of things became very important.

tk0miya commented 2 years ago

At present, some transforms are invoked after smart_quotes transform and are collecting contents from the "smart-quoted" doctree. For example, the standard domain collects section titles, titles of anchors, and so on. If we'll move the smart_quotes transform to post transforming phase, these collected contents will not be smart-quoted.

To change the order of processing, we need to create a new mechanism to do smart-quoting the collected contents.

CendioOssman commented 2 years ago

Ah, that does complicate things. Most cases would hopefully be handled if smart quotes is run sufficiently late in the process though? E.g. reference titles.

And I don't suppose anyone has considered moving those collections to somewhere later? I know I had some issues with the fact that adding certain nodes in the post transform stage didn't work as the standard domain didn't collect information from those.

tk0miya commented 2 years ago

We also have similar problems for i18n feature. And we've not been able to find the better way to do them on at the later step yet.