Hi,
I created an extension (https://github.com/sphinx-contrib/restbuilder) which recently gained some traction. It is typically used in this workflow:
While refining the extension, I bumbed into an issue with substitutions.
To create valid reStructuredText, I need to know the doctree before the `references.Substitutions` Transform is applied. In other words, I like to disable this Transform.
Is there a way my Builder can do so?
Unfortunately, SphinxBaseReader always seem to use all transforms
that are listed by readers.standalone.Reader, which includes this
references.Substitutions. Should I subclass SphinxBaseReader, and
if so, how can my builder specify the desired reader?
Any advice is much appreciated.
Regards,
Freek
Hi, I did a short test, and fear that the doctree caching is already broken. :( Given the following index.rst: This is a line with a quote, isn't it? The running `sphinx-build -b xml input output` the resulting index.xml is as expected: <paragraph>This is a line with a quote, isn’t it?</paragraph> However, when running this as `sphinx-build -b text input output ; sphinx-build -b xml input output`, the resulting index.xml is different:
<paragraph>This is a line with a quote, isn't it?</paragraph> In the first case, the straight quote (') is converted to a smart quote (’), as expected for XML files. However, the SmartQuotes tranform is disabled for text files (and man pages). So, the resulting doctree is different. Since the doctree is cached between runs, the XML builders is feeded the wrong doctree. This is of course a minor issue, but it does prove that the caching mechanism for doctree is already broken. Regards, Freek