On Tue, May 19, 2026 at 09:34:03PM +0100, Gavin Smith wrote:
> On Tue, May 19, 2026 at 10:00:24PM +0200, Patrice Dumas wrote:
> > On Sun, May 10, 2026 at 10:39:38PM +0200, Patrice Dumas wrote:
> > > On Wed, Apr 08, 2026 at 09:47:43PM +0100, Gavin Smith wrote:
> > > > 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.
> > > 
> > > 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.
> > 
> > Should I proceed?
> 
> I did not actually understand the reason why nesting @html in @ifepub
> (or nesting @ifebub in @html) would not work.

@ifepub/@ifhtml are removed when parsing, therefore they cannot be used,
at conversion time, to select a different Texinfo code to convert when
converting from epub.pm or when converting from HTML.pm as they
have been removed already.  And we need to have separate code, as the
metadata are different, and both are output for EPUB, for EPUB there
is both EPUB specific metadata output in a separate file and the whole
manual in XHTML files with metadata too.

> When you say "metadata", does this mean something different for HTML ouput
> and EPUB output?

Yes.  For HTML, it is code appearing in <head>, like
<meta name="Generator" content="program">

For EPUB, it is XML appearing in a separate file, in the <metadata>
element, looking like
 <dc:creator>Me</dc:creator>

>  Is this for the case when @html is nested inside of
> @documentinfo for the purpose of outputing inside of <head>?

For HTML, yes.

-- 
Pat

Reply via email to