Re: Designations in docbook for conversion to ePub

Richard Hamilton <[email protected]> Wed, 24 Mar 2021 16:30:34 -0700
Newsgroups gmane.text.docbook.apps
Message-ID <[email protected]>
Hi Philo,

Regarding your first question, if you put a role attribute on a phrase (<phrase role=“red”>contents</phrase>), the value of that role will be carried to the HTML (e.g., <span class=“red”>contents</span>)

You can then apply css normally.

Regarding your second question, I’m not so sure what’s the best thing to do, but you might try the same approach, wrapping the inlinemediaobject in a phrase with a role, then key off whatever sequence of spans you get (probably something like span.XYZ>span.inlinemediaobject>img).

I hope that helps.

Dick Hamilton
-------
XML Press
XML for Technical Communicators
http://xmlpress.net
[email protected]



> On Mar 24, 2021, at 15:43, Philo Calhoun <[email protected]> wrote:
> 
> I have a well formed book in docbook XML format. I was wondering how to solve two issues:
> 
> First, what designation can I use for color attributes for text? I would like it to convert over to EPub3 with a CSS that has something like span.red {font-color: red;}
> 
> Second, I have several images with specified widths in the XML file, coded like:
> 
>  <para><inlinemediaobject>
>     <imageobject>
>      <imagedata fileref=“figures/TestImage.jpg" width="50%"/>
>     </imageobject>
>    </inlinemediaobject></para>
> 
> This is fine in docbook but when I convert this to ePub, it generates ePub errors - as XHTML cannot specify image width directly. To be error free, I need to specify with width  through a CSS designation like img.half where img.half is set to 50% width in the CSS. Is there a way in Oxygen XML to specify a designation in docbook that will at least tag these images so that I can add the CSS specification for width?