Add --rights <text> flag for stamping dc:rights (closes #21)#24
Merged
Conversation
Producers redistributing accessibility-exception copies routinely
need to assert the rights frame they're operating under (Marrakesh
Treaty, EU exception, copyright statement). DAISY 2.02 NCCs
sometimes carry that in dc:rights and sometimes don't (the
reference Belgian title in our memory tests does not).
* `PackageMetadata.rights: Option<String>` added in
`epub3-writer/src/model.rs`. Surfaced as `<dc:rights>` in the
OPF metadata block.
* `ConvertOptions.rights: Option<String>` added in
`dpub-convert/src/lib.rs`. CLI override applied after the
initial `convert(book)` call.
* `build_package_metadata` defaults `rights` from the source
NCC's `other.get("dc:rights")` so books that already carry
rights info don't lose it on conversion.
* CLI: `--rights "<text>"` flag on `dpub convert`. Override
semantics — explicit flag wins.
Plain text only for v1; structured rights statements (CC URIs,
Marrakesh statement libraries) are a future enhancement.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tiny feature implementing #21. `dpub convert --rights ""` stamps a free-text `dc:rights` element into the EPUB's OPF metadata.
Why
Producers redistributing accessibility-exception copies routinely need to assert the rights frame they're operating under — copyright statement, Marrakesh Treaty, Belgian / EU exception, etc. DAISY 2.02 NCCs sometimes carry that in `dc:rights` and sometimes don't (the reference Belgian title in this project's memory does not). Before this PR, dpub had no way to add it.
Behaviour
Implementation
Out of scope
Test plan