Skip to content

🚀 功能建议:Anki 加卡时支持原句、文章标题和链接变量 #1381

Open

Description

@LiangSam

请先确认以下事项

  • 已仔细阅读了 README
  • 在 issues 页面搜索过(包括已关闭的 issue),未发现类似功能建议
  • Easydict 已升级到 最新版本
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

功能描述

在 #1241 的 Anki Connect 字段映射中,新增几个变量:

  • {Sentence}:选中单词所在的那句原文
  • {SourceTitle} / {SourceURL}:当前最前面浏览器标签页(Safari / Chrome)的标题和链接
  • 可选 {ClozeSentence}:把目标词标出(如 <b>word</b>)的句子

识别不到时变量留空即可。

使用场景

阅读英文网页文章时,我会把生词连同原句和出处一起做成 Anki 卡(Word、Sentence、Source-Name、Source-URL 字段)。现在 Easydict 加卡只带单词和释义,原句、标题、链接都得回网页手动复制再粘到 Anki。「单词 + 原句 + 出处」是很常见的背词方式,有了这些变量就能在阅读时一键带语境存词。

实现方案(可选)

原句可考虑复用取词时读取选中文本的辅助功能接口,取其所在句子;标题和链接可通过 AppleScript 读取前台浏览器当前标签页。

是否愿意提交 PR 实现该功能

  • 我愿意提交 PR 实现该功能

Activity

  1. Issues-translate-bot commented on Oct 29, 2026

    @Issues-translate-bot

    Bot automatically translated this content.


    Title: [Function Suggestion] Anki: Bring the original sentence, article title and link when adding a card

    Thanks to the Anki Connect integration added by #1241, adding dictionary results into Anki is very convenient.

    Question
    I usually read English web articles, and when I encounter new words, I will make Anki cards together with the context. Now there are only words and definitions in the cards, and the original sentences, article titles and links have to be returned to the web page and copied manually.

    Suggestion
    Add a few variables to the field mapping:

    • {Sentence}: The original sentence where the selected word is located, for example, use the same set of accessibility interfaces that read the selected text to get it
    • {SourceTitle} and {SourceURL}: the title and link of the front browser tab (Safari or Chrome)
    • Optional {ClozeSentence}: a sentence with the target word marked, such as <b>word</b>

    This can be mapped to fields such as Sentence, Source-Name, and Source-URL. If it is not recognized, just leave the variable blank.

    reason
    "Word + original sentence + source" is a common way to memorize words in Anki. With these variables, Easydict can save words and context with one click while reading.

    Environment: Easydict 2.25.0, macOS, AnkiConnect.

  2. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    Hello LiangSam, Thank you for your first issue contribution 🎉

  3. changed the title [-]【功能建议】Anki:加卡时带上原句、文章标题和链接[/-] [+]🚀 功能建议:Anki 加卡时支持原句、文章标题和链接变量[/+] on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions