Lots of duplicate code in docbook
Thibaut Cuvelier
tcuvelier at lyx.org
Mon Mar 28 16:49:00 UTC 2022
On Mon, 21 Mar 2022 at 13:11, Lorenzo Bertini <lorenzobertini97 at gmail.com>
wrote:
> Il 21/03/22 11:49, Daniel ha scritto:
> > On 2022-03-21 10:55, Lorenzo Bertini wrote:
> >> There is some degree of duplication between Docbook and LyXHTML code.
> >> I think its because the latter is much older and Thibaut had to write
> >> its own to produce Docbook. This has been brought up also when
> >> addressing MathML production. I agree LyX needs more standard XML
> >> generating functions.
> >>
> >> Its part of a larger theme about XML production, and there was a talk
> >> sometime ago about using a library for this.
> >
> > I might be misunderstanding your comment. But actually, I wanted to
> > point not to the way XML is generated but more to the actual content,
> > for example, the specific attributes of an element which seem to be
> > duplicated. But maybe that problem is somehow dependent on the general
> > generation of XML?
>
> Sorry, I meant that code duplication is probably due to the different
> maintainers for the two formats and the fact that one is much older and
> has been untouched for a long (LyXHTML). I remember Thibaut saying he
> branched from LyXHTML knowingly, even if it would have meant rewriting
> some stuff. Looking at your examples, this might be the case.
>
> I think a common interface to write XML elements like tables, tags, etc,
> would help reduce this, but it will be a lot of effort. I'll wait for
> Thibaut and Richard to chime in on this.
>
There is already a generic interface for XML tags (but not tree-oriented,
like almost all XML tools). However, it does not make sense to have a
generic function for a table: CALS and HTML are two quite different
formats; moreover, HTML tables in DocBook do not always exactly match what
HTML allows (mostly, HTML allows CSS, but DocBook forbids formatting).
I had planned to merge the code paths somehow, but never really got to it
for now: I was focusing on correctness rather than aesthetics (while
keeping good-quality code). Patches are welcome, of course, if you want to
make that happen sooner :)!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220328/a1cece69/attachment-0001.html>
More information about the lyx-devel
mailing list