On Wed, May 20, 2026 at 07:34:03AM +0100, Gavin Smith wrote: > On Tue, May 19, 2026 at 11:47:27PM +0200, Patrice Dumas wrote: > > @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. > > Does it really matter that we don't have a way to access the EPUB metadata > section with raw formatting commands? I don't think anybody has been asking > for that functionality.
I do not know if somebody asked for that functionality, but when I implemented the EPUB format, it became clear to me that the metadata is important, and it is visible in the calibre raeder, for example, where the metadatais used to arrange collections and search for books. Beside EPUB, Texinfo metadata are rather limited, and the whole idea of using raw format in @documentinfo to generate metadata is a way to avoid adding more metadata directly in Texinfo. > It seems likely that there would be similar limitations for parts of other > output formats. It is a limitation of using raw formatting commands as the > structure of the Texinfo source doesn't exactly parallel the format of output > files. This is true in general, but in that specific case, it seems to be the opposite. The idea here is to use raw formatting in @documentinfo to setup metadata in output formats wherever these metadata appear in the output document, not where the @documentinfo appear. Even though it uses the raw formatting commands, it seems to me to be a rather semantic use of @documentinfo. > > > 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. > > Is it possible to override the processing of @html in the code for EPUB and > output to the separate <metadata> element as you describe? Yes, and it is what the code does right now, however the problem is that it is also used for HTML metadata and appears in HTML <head>, which is wrong. > There only appears to be a problem here if, in EPUB output, somebody wants > to output to both the <head> element and the <metadata> element. Not only, since in EPUB, both EPUB <metadata> and XHTML output files <head> metadata are output in any case. One possibility could be to consider that @html in @documentinfo is only for EPUB, but this seems less natural to me than adding an @epub raw format command. -- Pat
