Page 1 of 1

Two ePub issues

Posted: Tue Mar 23, 2021 10:50 pm
by IsleofGough
I have a document in docbook XML format. When I make an ePub target, there is no option for a cover page, so I need to add it in Sigil or some other program. Is there a way of specifying this in Oxygen directly?

When I add an inline image with code like:

<para><inlinemediaobject>
<imageobject>
<imagedata fileref="figures/TestImage.jpg" width="50%"/>
</imageobject>
</inlinemediaobject></para>

It creates a good looking ePub but generates errors in epubchecker due to the width designation. Is there another way of specifying a percentage width for ePubs? For what it is worth, the ePub, despite having errors, works well in Apple Books, Kindle, etc.

Re: Two ePub issues

Posted: Wed Mar 24, 2021 7:52 am
by Radu
Hi,

So you are using DocBook with Oxygen and producing EPUB, we have two predefined transformation scenarios for this, one named "DocBook EPUB" and one "DocBook EPUB3". Which one are you using? I could try to look more into this to see if I can find a configuration parameter for the cover page.
About the validation complaints caused by HTML content like this:

Code: Select all

<table width="490" frame="border" rules="all"><col width="80%"/>
We use the DocBook stylesheets we use and which come from the DocBook project:
https://cdn.docbook.org/

The stylesheets produce an HTML output which from what I remember adheres to the XHTML transitional specification which predates the HTML5 specification.
In HTML5 attributes like "width" were replaced by specifying the @style attribute on the element with equivalent CSS properties like:

Code: Select all

<col style="width:80%"/>
so there are a couple of variations between the older HTML version that DocBook uses for publishing and the HTML5 specification which is used by the EPUB checker to check the EPub HTML. As most EPUB readers are based on web browser engines they probably consume the HTMLs without any problem.

Regards,
Radu

Re: Two ePub issues

Posted: Wed Mar 24, 2021 8:54 am
by IsleofGough
Thank you for the reply. I am using the doc book to ePub3 converter. Should I try changing the width parameter to match the older html designation?

Re: Two ePub issues

Posted: Wed Mar 24, 2021 1:51 pm
by Radu
Hi,

About the cover image, from what I looked in the conversion stylesheets it seems that if you add an image reference inside a mediaobject with a certain @role attribute it should be taken into account by the publishing system, similar to this older discussion thread:

https://lists.oasis-open.org/archives/d ... 00091.html

About your remark:
Should I try changing the width parameter to match the older html designation?
I'm not sure what you mean, in the DocBook standard it's clear how the widths are specified on the table element. These DocBook table elements are converted to HTML tables and the conversion process, based on XSLT stylesheets is the one which would need to be probably modified to produce 100% valid HTML5 content.
There is a DocBook Apps users list on which maybe you can try to ask questions about this:
https://docbook.org/help
as there is a larger community and they might know things that I do not.

Also as another possible approach to conveting DocBook to EPUB, there is a free tool named Pandoc which can generate lots of possible outputs from lots of possible formats, among which DocBook. So maybe you can explore Pandoc as well:
https://pandoc.org/

Regards,
Radu

Re: Two ePub issues

Posted: Wed Mar 24, 2021 6:47 pm
by IsleofGough
The solution to add this within the info tag worked great:

<cover>
<mediaobject role="cover">
<imageobject>
<imagedata fileref="../pathtocovers/epub_cover.jpg" contentdepth="700" contentwidth="500" />
</imageobject>
</mediaobject>
</cover>

Problem solved. Thank you so much!!