[LyX/master] DocBook: allow KOMA-Script documents to be generated as DocBook

Thibaut Cuvelier tcuvelier at lyx.org
Tue Jul 28 03:20:44 UTC 2020


On Mon, 27 Jul 2020 at 17:44, Pavel Sanda <sanda at lyx.org> wrote:

> On Wed, Jul 22, 2020 at 07:28:35PM +0200, Thibaut Cuvelier wrote:
> > On Tue, 21 Jul 2020 at 09:09, Richard Kimberly Heck <rikiheck at lyx.org>
> > wrote:
> >
> > > On 7/20/20 8:35 PM, Thibaut Cuvelier wrote:
> > > > commit c9f8469c00da790f2a80cf55089a3c1a48b755c3
> > > > Author: Thibaut Cuvelier <tcuvelier at lyx.org>
> > > > Date:   Tue Jul 21 02:59:57 2020 +0200
> > > >
> > > >     DocBook: allow KOMA-Script documents to be generated as DocBook
> > >
> > > This is really excellent.
> > >
> > > Just out of curiosity: Is there an easy way to go from DocBook to EPub?
> > > We have been trying (well, more hoping) to get a good EPub export to
> > > work for a while.
> > >
> >
> > Yes, there are at least three (open source) ways:
> > - with the Java XSLT engine Saxon (
> > https://www.saxonica.com/welcome/welcome.xml): using the outdated
> version 6
> > (the last one that fully supports XSLT 1.0) and
> > https://github.com/docbook/xslt10-stylesheets, this is probably the
> > preferred way to get ePubs from DocBook
> > - Ubuntu has
> http://manpages.ubuntu.com/manpages/trusty/man1/dbtoepub.1.html
> > - RedHat/Fedora used to develop Publican, a tool that can also produce
> > ePub: https://sourceware.org/publican/en-US/Publican/4.2/ (abandoned
> since
> > RHEL 8)
>
> Maybe I am confused, but when I look on debian repository I see docbook-xsl
> package which likely stems from the "preferred" github repo.
> https://packages.debian.org/stretch/docbook-xsl
>
> However the description page does not list epub as its native output
> format
> and instead lists dbtoepub as suggested dependency (your 4th link) which
> is likely the real conversion mechanism(?).
>
> dbtoepub itself is there termed as an alpha-quality implementation
> https://packages.debian.org/stretch/dbtoepub
> so I wonder whether we actually have some reasonable conversion mechanism
> at hand?
>

Using the docbook-xsl package to do so is not exactly straightforward, it
seems, but it's doable. The main problem is that XSLT 1 does not allow to
generate multiple files nor ZIP archives, so you have to find workarounds…
https://github.com/docbook/xslt10-stylesheets/blob/master/xsl/epub3/README
gives the three steps to generating an ePub 3 (plus an extra step for
checking its validity). It's a thin customisation layer on top of the rest
of the XSLT package, meaning that it should work well out of the box.
The dependencies to use this are: either xsltproc or both Java and Saxon 6
(both toolchains are available for macOS, Linux, and Windows), plus a ZIP
utility.
I really think this is a reasonable way to get ePub 3 documents, but with
many dependencies that are probably not OK to ship with/require for LyX.

On the other hand, dbtoepub seems to be based on
https://github.com/docbook/xslt10-stylesheets/tree/master/xsl/epub, which
adds a ton of dependencies and code. It also seems not to get the same
level of maintenance as the rest of the XSLT code. Oxygen (a reference XML
editor) uses most of this code, but with a supplementary Ant layer (
https://ant.apache.org/); however, this code is not open source.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200728/0b9b6deb/attachment.html>


More information about the lyx-devel mailing list