[docbook-apps] Re: [docbook] audio epubs

2014-09-23 Thread Jirka Kosek
[Replying to docbook-apps where this belongs...]
On 18.9.2014 15:38, Peter Fleck wrote:
> Is it possible to do a lot of the work to make audio epubs using
> stylesheets?

Everything is possible, it depends on effort you can put into it :-)

> First, how to auto generate ids for each ? I'm sure that is
> straightforward. (Or if more granularity is needed then id's at the
> sentence or word level as needed).

Putting following into your customization layer should do the trick:





  
  
  

  


  

  

  

  


However if you change your DocBook source autogenerated IDs will change.

> Second, populate the smil file with the ids
> 
> http://www.w3.org/ns/SMIL";
> xmlns:epub="http://www.idpf.org/2007/ops"; version="3.0">
> 
> 
> 
> 
>  clipEnd="0:00:15.000"/>
> 
> 
> 
>  clipEnd="0:00:25.000"/>
> 
> 
> 
> 
> 
> 
> The smil file would need manually editing for the clipBegin and clipEnd
> for each but that's fine. The audio src could be passed as a parameter.
> Then add something like .-epub-media-overlay-active {background-color:
> #abc;} to the css.

Have you considered generating this SMIL file automatically? I can
imagine putting custom attributes into DocBook document, something like:


  Foo
  ...
  ...
  ...

From such markup you can quite easily generate SMIL file automatically.

> Finally modify the package.opf to add
> 
>  refines="#chapter1_overlay">0:04:30.000
>  refines="#chapter2_overlay">0:03:30.000
> 
> 0:08:00.000
> Narrator Name
> -epub-media-overlay-active
>   
>   
> 
>  media-type="application/xhtml+xml" href="ar01-toc.xhtml"/>
> 
>  media-type="application/xhtml+xml" media-overlay="chapter1_overlay"/>
>  media-type="application/smil+xml"/>
> 
> 
> Is something like this doable?

Yes, generation of OPF file is split into set of relative small
templates which you can easily override. Look into
epub3/epu3-element-mods.xsl file. For example metadata part is generated
by the following template:



  








  


You can generate this template manually, or put your custom elements
inside  elements and handle them in special opf.metadata mode.


  ...
  Narrator Name



  


HTH,

Jirka

-- 
--
  Jirka Kosek  e-mail: ji...@kosek.cz  http://xmlguru.cz
--
   Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
--
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
--
Bringing you XML Prague conferencehttp://xmlprague.cz
--



signature.asc
Description: OpenPGP digital signature


[docbook-apps] Re: [docbook] audio epubs

2014-09-23 Thread Peter Fleck

Thanks. I look forward to giving this a go.

Peter


On 23/09/2014 11:15, Jirka Kosek wrote:

[Replying to docbook-apps where this belongs...]
On 18.9.2014 15:38, Peter Fleck wrote:

Is it possible to do a lot of the work to make audio epubs using
stylesheets?

Everything is possible, it depends on effort you can put into it :-)


First, how to auto generate ids for each ? I'm sure that is
straightforward. (Or if more granularity is needed then id's at the
sentence or word level as needed).

Putting following into your customization layer should do the trick:





   
   
   
 
   
 
 
   
 
   
 
   
 
   


However if you change your DocBook source autogenerated IDs will change.


Second, populate the smil file with the ids

http://www.w3.org/ns/SMIL";
xmlns:epub="http://www.idpf.org/2007/ops"; version="3.0">
 
 
 
 
 
 
 
 
 
 
 
 
 


The smil file would need manually editing for the clipBegin and clipEnd
for each but that's fine. The audio src could be passed as a parameter.
Then add something like .-epub-media-overlay-active {background-color:
#abc;} to the css.

Have you considered generating this SMIL file automatically? I can
imagine putting custom attributes into DocBook document, something like:


   Foo
   ...
   ...
   ...

 From such markup you can quite easily generate SMIL file automatically.


Finally modify the package.opf to add

 0:04:30.000
 0:03:30.000
 
 0:08:00.000
 Narrator Name
 -epub-media-overlay-active
   
   
 
 
 
 
 
 

Is something like this doable?

Yes, generation of OPF file is split into set of relative small
templates which you can easily override. Look into
epub3/epu3-element-mods.xsl file. For example metadata part is generated
by the following template:



   

 
 
 
 
 
 

   


You can generate this template manually, or put your custom elements
inside  elements and handle them in special opf.metadata mode.


   ...
   Narrator Name



   


HTH,

Jirka