On 2015-06-23, Bram Geron wrote:
> [-- Type: text/plain, Encoding: quoted-printable --]
> Interesting! You seem have a grasp on how the two have diverged; can you
> shed some light on that?
In the beginning, there was just Docutils.
When Sphinx was created araound 2007, the latex builder and writer were
created as independent, Sphinx-specific modules, with inspiration from
the Docutils LaTeX writer Release 0.5 (2008-06-25). I don't know the
details that led to this decision, but imagine that problems with the
upstream writer and the different requirements for the PDF version of the
Python documentation were the main reason.
The Docutils LaTeX writer went through some major development and
improvement cycles since then (including the addition of a "xetex" writer
inheriting from the latex2e writer). See the Docutils' HISTORY__ file
and the repository at
http://sourceforge.net/p/docutils/code for details.
There is also a git mirror at
http://repo.or.cz/docutils.git
__
http://docutils.sourceforge.net/HISTORY.html
> Is it just details like what specific strings to put where?
No, it was a newinplementation from the beginning and independent
development for 8 years. Even with some "cross pollunation", there are
plenty of details differing.
OTOH, the main task: "take a Docutils document tree and convert it into LaTeX
code" is similar and the Sphinx writer imports and uses parts of Docutils:
from docutils import nodes, writers
from docutils.writers.latex2e import Babel
> Is the architecture for overriding strings ('latex_elements')
> different?
Yes.
> Is the Docutils LaTeX writer even based on walkabout?
Yes, the use of the "visitor pattern" is a core element of Docutils from the
very beginning (see `PEP 0258 -- Docutils Design Specification`__ from 2001)
walkabout() is provided by Docutils' nodes.py and used in both
systems.
__
https://www.python.org/dev/peps/pep-0258
Hope this helps,
Günter