New DocBook support
Thibaut Cuvelier
dourouc05 at gmail.com
Fri Jun 26 16:56:04 UTC 2020
Dear list,
Here is the complete set of patches for the new DocBook implementation I've
been working on for the last few years. It is a complete overhaul of the
existing DocBook implementation, with a completely different mindset: the
goal is to be able to convert almost any LyX document into DocBook, not
only those that follow the DocBook templates. It works pretty well for now:
D-BookeR (https://www.d-booker.fr/) can use it to convert a 200-A4-page LyX
book into DocBook and use it in their toolchains (minus specificities for
D-BookeR's use of DocBook, with many tags disabled).
(This is a follow-up to https://www.lyx.org/trac/ticket/8444, cleanly
divided in several patches and reviewed by Guillaume.)
These patches apply cleanly on 4dc33e52f8c5b4a4c31e05da09ccb1dfb627e5cb
(you can have a look at
https://gitlab.com/gadmm/lyx-unstable/-/merge_requests/3). Guillaume
reviewed it all, except the Python parts (they are quite small). It relies
on the patches I recently submitted for XMLStream and MathML improvements.
This contribution also includes documentation for the new layout parts, and
a few test cases (both LyX documents and their reference DocBook
translation). The division in patches is designed so that the code base
remains compilable between patches.
There are still a few points to discuss. More specifically:
- documents are supposed to only contain one bibliography, at the very end.
Other cases will probably lead to invalid DockBook. In DocBook, a
bibliography is supposed to be either at the beginning or at the end of a
book/part/chapter/section; it is not always clear at which level the
bibliography should be output
- handling subfigures is currently implemented in a suboptimal way:
InsetFloat looks specifically for a given kind of pattern of insets in the
LyX document (https://wiki.lyx.org/FAQ/FiguresSideBySide). Guillaume would
have rather seen gathering information in OutputParams, but the
implementation would be far from straightforward...
- similarly, for floats, the DocBook tags for the floats and the captions
are hard-coded in the Floating class, and not in the layouts. It is
unlikely that this part should be overridden by other document
classes/modules. The only missing part is algorithms, which are not handled
by DocBook for now (but they may in the future:
https://github.com/docbook/docbook/issues/157). Or am I missing other kinds
of floats?
Only the "main" DocBook vocabulary is implemented (the one that is being
normalised by OASIS, the major standard body for XML-based things). The
output requires DocBook 5.2 (which is not yet released), due to support for
subfigures (other documents are compatible with 5.0): I had to ask the
DocBook committee to include it at some point for this project. There is no
option to output simplified DocBook (
https://docbook.org/schemas/5x-custom.html#simple); Beamer documents are
not translated to DocBook Slides (
https://docbook.org/schemas/5x-custom.html#slides). These two variants are
unofficial, and could be implemented in the future (I did not look at them
to see how complex it would be).
If anything could help you review this, let me know!
All the best,
Thibaut Cuvelier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-The-new-DocBook-output-has-no-prerequisite-on-the-do.patch
Type: application/octet-stream
Size: 1660 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0009.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Migrate-the-existing-layouts-to-the-new-DocBook-attr.patch
Type: application/octet-stream
Size: 23416 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0010.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Add-documentation-for-the-new-layout-attributes.patch
Type: application/octet-stream
Size: 35020 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0011.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Migrate-the-previous-DocBook-layouts-so-the-old-docu.patch
Type: application/octet-stream
Size: 20473 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0012.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-New-DocBook-support.patch
Type: application/octet-stream
Size: 222287 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0013.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Configure-script-update-names-for-new-DocBook-suppor.patch
Type: application/octet-stream
Size: 6459 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0014.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Remove-old-example-as-its-mechanisms-are-now-depreca.patch
Type: application/octet-stream
Size: 13961 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0015.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-required-elements-in-the-layouts-to-support-DocB.patch
Type: application/octet-stream
Size: 11562 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0016.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adding-DocBook-test-cases.patch
Type: application/octet-stream
Size: 86166 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200626/31d5f9cf/attachment-0017.obj>
More information about the lyx-devel
mailing list