Skip to content

feat(reader): support deeplink and web link in annotation export#4067

Merged
chrox merged 1 commit into
readest:mainfrom
chrox:feat/export-annotation-link-variants
May 5, 2026
Merged

feat(reader): support deeplink and web link in annotation export#4067
chrox merged 1 commit into
readest:mainfrom
chrox:feat/export-annotation-link-variants

Conversation

@chrox
Copy link
Copy Markdown
Collaborator

@chrox chrox commented May 5, 2026

Summary

  • Expose annotation.appLink (readest://) and annotation.webLink (https://web.readest.com) in the custom export template, so users can pick which scheme they want for in-template links.
  • Switch the shipped default custom template to emit annotation.appLink so exported notes open the native app by default. The non-template export mode keeps the universal https link as before, and the legacy annotation.link variable still works as an alias for webLink.
  • Make the export preview's anchor tags open in a new tab (target="_blank" rel="noopener noreferrer") so clicking a [Page: N] link no longer replaces the dialog/page.

Test plan

  • pnpm test (unit tests, including new Annotation link variants suite in note.test.ts)
  • pnpm lint
  • Open the Export Annotations dialog with at least one annotation; confirm the default custom template renders [Page: N](readest://book/.../annotation/...)
  • In the preview, click a page link and confirm it opens in a new tab
  • Toggle off "Use Custom Template" and confirm default-mode export still uses the https://web.readest.com/... link
  • Edit the template to use {{ annotation.webLink }} and confirm the preview shows the https URL

🤖 Generated with Claude Code

Expose `annotation.appLink` (readest://) and `annotation.webLink`
(https://web.readest.com) as template variables for custom export
templates. The shipped default template now emits the readest:// app
deeplink for the page link so exported notes open the native app.
The non-template export mode keeps the universal https link.

Preview links also gain target="_blank" so they open in a new tab
instead of replacing the dialog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chrox chrox merged commit c27245e into readest:main May 5, 2026
4 checks passed
@chrox chrox deleted the feat/export-annotation-link-variants branch May 5, 2026 17:39
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