-
Notifications
You must be signed in to change notification settings - Fork 93
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
Conversation
…esults as landmarks in EPUB 3.x.
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
Show resolved
Hide resolved
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 3landmarks
, so it's not very useful. I suggest parsing it (+ test cases) using the link property keyhttp://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
(orfootnotes
?)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
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/ManifestAdapter.kt
Outdated
Show resolved
Hide resolved
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.
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParser.kt
Outdated
Show resolved
Hide resolved
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
Show resolved
Hide resolved
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
Outdated
Show resolved
Hide resolved
readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
Show resolved
Hide resolved
There was a problem hiding this 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.
There was a problem hiding this 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 🙏
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.