On Wed, May 20, 2026 at 02:09:31PM +0200, Patrice Dumas wrote: > 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.
That does sound potentially useful. > 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. OK, I wasn't saying it wasn't a semantic use. I understand that @documentinfo may not produce output related to its location in the input file. > > > > 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. I would prefer this possibility. Do not output anything extra in <head> for EPUB output, only outputting to <metadata>. As there is already @ifepub it may make sense to add @epub as well, although I feel that the relationship between @html and @epub could be confusing for users, where one format implies the other. I feel if there are two commands, it makes the formats appear to be completely separate formats, so users could be surprised to see the contents of @html output as well as the contents of @epub for EPUB output. In nearly all usages (outside of @documentinfo), the two commands would be synonymous, as you propose, so it seems unwarranted to have them both. It is a similar situation to the @ifplaintext command (which is hardly used AFAIK), where Info and plaintext output are considered variants of each other. The manual has to go to the trouble of explaining that @ifinfo is true for plaintext output as well. (It is not exactly the same, though, as @info and @plaintext are not real commands.)
