Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nav.xhtml body need epub:type #6918

Closed
codelabor opened this issue Dec 3, 2020 · 3 comments
Closed

nav.xhtml body need epub:type #6918

codelabor opened this issue Dec 3, 2020 · 3 comments

Comments

@codelabor
Copy link
Contributor

The nav.xhtml created by Sigil has epub:type="frontmatter" in body tags.
It would be nice to include this information when Pandoc creates nav.xhtml.

  • as-is: <body>
  • to-be: <body epub:type="frontmatter">

nav.xhtml (Sigil)

<body epub:type="frontmatter">
  <nav epub:type="toc" id="toc">

nav.xhtml (Pandoc)

<body>
  <nav epub:type="toc" id="toc">
@jgm
Copy link
Owner

jgm commented Dec 3, 2020

Can you link to epub documentation that recommends this?
What difference in practice does this make?

I don't see this, e.g., in the samples I checked at https://github.com/IDPF/epub3-samples
which is maintained by the standards body itself.

@codelabor
Copy link
Contributor Author

I can't find best practice document to refer to yet.
But I know the toc is not a bodymatter, but frontmatter.

According to this post, toc is frontmatter.
https://www.oxygenxml.com/dita/1.3/specs/langRef/technicalContent/frontmatter.html

The <frontmatter> element contains the material that precedes the main body of a document. It might include items such as an abstract, a preface, and various types of book lists such as a <toc>, <tablelist>, or <figurelist>.

If you look at the epub created by Sigil, the toc is frontmatter, so why don't you follow it?

In Pandoc, titlepage are set as frontmatter, right? I wish toc would do the same.

title_page.xhtml

<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <title>example</title>
  <link rel="stylesheet" type="text/css" href="../styles/stylesheet1.css" />
</head>
<body epub:type="frontmatter">

nav.xhtml

<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <title>example</title>
  <link rel="stylesheet" type="text/css" href="styles/stylesheet1.css" />
</head>
<body>

@jgm
Copy link
Owner

jgm commented Dec 4, 2020

I think it probably does make sense to use the frontmatter annotation here, and I think I'll do that, but it's nice to follow guidance from an official spec. (dita, which you link to, is not epub.)

@jgm jgm closed this as completed in 9c6cc79 Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants