Skip to content

Add new LinkRelation for the readingOrder and EPUB landmarks #602

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
Jun 3, 2025

Conversation

mickael-menu
Copy link
Member

Added

Navigator

  • New link rels in the readingOrder and EPUB landmarks to mark:
    • cover: the title page
    • contents: the table of contents
    • start: the first actual chapter

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new EPUB landmark link relation for the reading order by introducing a new LinkRelation (.start) and updating namespace definition usage throughout the EPUB parser modules. Key changes include:

  • Replacing explicit namespace string definitions with centralized defineNamespace/defineNamespaces calls.
  • Refactoring OPF and EPUB parsers to use the new namespace APIs.
  • Adding a new LinkRelation+EPUB extension to map EPUB-specific link types.

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Sources/Streamer/Parser/EPUB/XMLNamespace.swift Added helper extensions for defining one or multiple XML namespaces.
Sources/Streamer/Parser/EPUB/OPFParser.swift Updated namespace calls to use defineNamespace.
Sources/Streamer/Parser/EPUB/OPFMeta.swift Replaced explicit namespace calls with defineNamespace(s).
Sources/Streamer/Parser/EPUB/NavigationDocumentParser.swift Updated namespace usage and passed the new LinkRelation (via epubType) to makeLink.
Sources/Streamer/Parser/EPUB/NCXParser.swift Refactored namespace initialization using defineNamespace.
Sources/Streamer/Parser/EPUB/Extensions/LinkRelation+EPUB.swift Added EPUB-specific initializer for LinkRelation based on epubType.
Sources/Streamer/Parser/EPUB/EPUBParser.swift Refactored publication parsing to use EPUBManifestParser and updated deobfuscator initialization.
Sources/Streamer/Parser/EPUB/EPUBMetadataParser.swift Updated namespace calls to use defineNamespace(s).
Sources/Streamer/Parser/EPUB/EPUBManifestParser.swift Introduced a new manifest parser that fills in readingOrder link relations based on landmarks.
Sources/Streamer/Parser/EPUB/EPUBEncryptionParser.swift Updated namespace usage with defineNamespace.
Sources/Streamer/Parser/EPUB/EPUBContainerParser.swift Updated namespace definition to use defineNamespace.
Sources/Shared/Toolkit/XML/XML.swift Refactored XMLNamespace into a structured type with predefined constants.
Various Sniffer files Updated inline XML namespace definitions to use the centralized XMLNamespace constants.
Sources/Shared/Publication/LinkRelation.swift Added the new .start link relation to support landmark entries.
Sources/OPDS/XMLNamespace.swift and Sources/OPDS/OPDS1Parser.swift Updated namespace definitions with defineNamespace calls.
CHANGELOG.md Documented the new link relations for readingOrder landmarks.

@mickael-menu mickael-menu merged commit 2c5a66f into develop Jun 3, 2025
5 checks passed
@mickael-menu mickael-menu deleted the rel-start branch June 3, 2025 15:41
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.

1 participant