On Wed, Apr 08, 2026 at 09:47:43PM +0100, Gavin Smith wrote:
> On Wed, Apr 08, 2026 at 09:49:28PM +0200, Patrice Dumas wrote:
> > Hello,
> > 
> > I do not think that an additional raw format block command is needed,
> > @html can be used for that purpose.
> > 
> > The command line is --epub3, but I would propose @ifepub for the
> > conditional.
> 
> I'm okay with this.  Does that mean for raw output for EPUB only (e.g.
> in the metadata block) , you would use the following?
> 
> @ifepub
> @html
> ....
> @end html
> @end ifepub

It cannot work with a conditional, actually.  Indeed, the conditional is
removed when parsing, such that only @html remains after parsing and it
is not possible to output something different in HTML metadata and in
EPUB metadata.  For example, the following:

@ifepub
@html
EPUB
@end html
@end ifepub
@ifnotepub
@html
HTML
@end html
@end ifnotepub

rightly becomes

@html
EPUB
@end html

However, at that point, it is not possible to know that the @html was
within an @ifepub, and that it is not for the HTML metadata.

Therefore I think that it is not possible to avoid adding @epub, that
would actually be expanded only when calling a conversion function from
epub3.pm.

-- 
Pat

Reply via email to