While working on reproducible builds effort in Debian, we noticed that sometimes built .html
files in Docutils’ own documentation contain <span class="incremental">
on one build and <cite>
in the same place on another build.
See for example this diff.
The reason is that slide-shows.txt
includes s5defs.txt
which has this line:
.. default-role:: incremental
As the tools/buildhtml.py
script does not reset the default role between processing files, all files that are built after slide-shows.txt
will get incremental
as the default role.
A patch to fix (by explicitly resetting the default role) this is attached. Another possible fix would be modifying tools/buildhtml.py
to reset the state between processing files.
Looking at
reStructuredText Directives
__ I see:This indicates the scope of the role-change should be limited to the document.
My understanding of buildhtml.py is, that it generates separate documents out of the *.txt files in a directory. This means the correct fix would be to re-set the default role in buildhtml.py.
__ http://docutils.sourceforge.net/docs/ref/rst/directives.html#setting-the-default-interpreted-text-role
Will you fix it, or you want a patch?
There is also this comment in the
DefaultRole
code:However I don’t know how to fix it more generally (for projects that don’t use
buildhtml.py
).Last edit: Dmitry Shachnev 2019-03-12
Does the following patch help?
Yes, that helps. Thanks!
Applied in rev. 8257. Thank you for reporting.
Thanks! Small nitpick that I noticed only now: the
del roles._roles['']
line has too much indentation, +8 spaces instead of +4.