Skip to content

Modify the parsing of the guide node in EPUB 2.0 to return the same results as landmarks in EPUB 3.x. #628

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

Merged
merged 6 commits into from
Mar 24, 2025

Conversation

erkasraim
Copy link
Contributor

In my app, we use EPUB files created with the EPUB 2.0 format, which require the guide node.
However, the library currently ignores the guide node.

So, I modified it to return the same results as landmarks in the EPUB 3.x specification.

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

I think that makes a lot of sense, as landmarks is the replacement of the deprecated guide.

To make it more useful for integrators, I suggest some changes:

  • epub:type is currently not parsed in EPUB 3 landmarks, so it's not very useful. I suggest parsing it (+ test cases) using the link property key http://www.idpf.org/2007/ops#type as it's an EPUB extension and not RWPM-native.

  • We should map the EPUB 2 types to the EPUB 3 ones, so that integrators can use the landmarks without checking for the EPUB types. Here's some mapping suggestions. I highlighted the ones that are different.

    EPUB 2 EPUB 3
    title-page titlepage
    text bodymatter
    acknowledgements acknowledgments (note diff orthography)
    notes endnotes (or footnotes?)
    cover cover
    toc toc
    index index
    glossary glossary
    bibliography bibliography
    colophon colophon
    copyright-page copyright-page
    dedication dedication
    epigraph epigraph
    foreword foreword
    loi loi
    lot lot
    preface preface

@mickael-menu
Copy link
Member

I opened a related discussion: readium/webpub-manifest#111

…nt and add it to the rels of the Link object for further use.
… files. Mapped types and used rels to return the same results as landmarks.
Copy link
Member

@qnga qnga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're good now.

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes @erkasraim 🙏

@mickael-menu mickael-menu merged commit 3eca18e into readium:develop Mar 24, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants