Anki add-on: 🔗Anki Note Linker

English | 简体中文 View on Github You can easily connect your Anki notes together by this add-on, forming a web of interconnected information. By establishing links between relevant notes, you can create a comprehensive and organized knowledge base that reflects the relationships between various concepts, ideas, and topics. Link Format [Link Title|nidxxxxxxxxxxxxx] The link title is the content displayed in the card. If the title contains [ , it needs to be escaped with \[ x is the ID of the note, consisting of 13 digits You can customize the style of the links by using the CSS selector: .noteLink In the editor: Copy note ID Copy the ID of the current note in the editor by using the right-click menu or the configured shortcut key Copy note link Copy the link of the current note in the editor by using the right-click menu or the configured shortcut key Insert link with copied note ID Generate a link from the note ID in the clipboard and the currently selected text by either using the right-click menu or the configured shortcut key Insert new link Generate a new link from the currently selected text by either using the right-click menu or the configured shortcut key Double-clicking the generated link text allows adding a corresponding new note Insert link template Generate a link template from the currently selected text by either using the right-click menu or the configured shortcut key The generated link template looks like this: [selected text|nid] , you need to manually complete it Note: If no text is selected, using the above actions will generate a link without a title Open current note in new window Open current note in new window by using the right-click menu or the configured shortcut key Open the note corresponding to the link Double click link text to open the corresponding note in a new window In the "links panel / graph panel" attached to the editor: Left click link to open the corresponding note in the current editor window Right click link to open the corresponding note in a new editor window Middle click link to open the corresponding note in the browser (unsupported in graph panel) In the reviewer / previewer / global graph: Left click link to open the corresponding note in a previewer window Right click link to open the corresponding note in an editor window Global relationship graph Entrance: Menu -> Anki Note Linker -> Global Relationship Graph Please set the video driver in Anki preference to an option other than Software , as it can significantly decrease graphic performance. Not recommended to set it to Vulkan , as it may cause some issues in the current version Graph image previews, zoom behavior, and advanced zoom options can be adjusted in the add-on configuration. Customize shortcut keys You can customize the shortcut keys according to your preferences in add-on configuration Default shortcuts: Windows / Linux: Alt+Shift+... macOS: Command+Option+... If there is no response when using the shortcut key, it may be due to a shortcut key conflict. Please try changing the shortcut key How to display note links properly without this add-on (such as on AnkiDroid, AnkiWeb, or AnkiMobile clients) This add-on automatically renders note links as corresponding content on the desktop version of Anki. Without the add-on, the links will not be rendered properly, affecting use on mobile devices. However, you can still regain some functionality. If you have already generated note links and need to use them without the add-on, you can follow the steps below to get links working: In the card template, add a class attribute "linkRender" to each note field on the front and back sides. You can also customize the attribute's name. <div class="linkRender">{{Front}}</div> <div class="linkRender">{{Back}}</div> <!-- If the field already has a class attribute, you can use a space to separate the new attribute from the original one --> <div class="otherClassName linkRender">{{Addition}}</div> Copy the following code to the end of the card template on both sides. Rename the linkRender attribute in the code if you changed it. Set the disableLinks variable to true if you only want the text to render (removes the "[|nid]" marker). <script> var disableLinks = false; // Change to true if you want to disable all link rendering for clients without add-on if (!window.AnkiNoteLinkerIsActive) { const renderLinks = _ => { document.querySelectorAll('.linkRender').forEach(element => { // You can rename "linkRender" on this line, but leave the "." in front element.innerHTML = element.innerHTML.replace( /\[((?:[^\[]|\\\[)*)\|nid(\d{13})\]/g, (match, title, nid) => { title = title.replace(/\\\[/g, '['); let link; if (document.documentElement.classList.contains('iphone') || document.documentElement.classList.contains('ipad')) { link = `anki://x-callback-url/search?query=nid%3a${nid}`; } else try { window.jsAPI ||= new AnkiDroidJS({ version: "0.0.3", developer: "github.com/gugutu" }); link = `javascript:window.jsAPI.ankiSearchCard(\`nid:${nid}\`)`; } catch (e) { link = `https://ankiuser.net/edit/${nid}' target='_blank`; } return disableLinks ? `${title}` : `<a href='${link}' class='noteLink'>${title}</a>`; } ); }); }; document.readyState !== 'loading' ? renderLinks() : document.addEventListener('DOMContentLoaded', renderLinks, { once: true }); } </script> Save the card template and sync your deck to AnkiWeb. After completing these operations, Anki will automatically display the correct content. If you click a link on an AnkiDroid or AnkiMobile client, it will attempt to display the corresponding note's flashcard in the card browser; if you click a link on AnkiWeb, it will open the AnkiWeb edit page for the corresponding note. If you changed the disableLinks variable to true , then the original content of the card will be displayed without any links. ---------------------------------------- This add-on is inspired by Obsidian The following projects were used in this project: pixijs d3 KaTeX Force graph The implementation of this add-on is inspired by the following add-ons: link Cards Notes and Preview them in extra window hjp-linkmaster Editor Live Preview Changelog ( Download previous versions ) 2026-05-05 Improved graph image previews and zoom behavior; added optional advanced graph zoom settings; updated default macOS shortcuts for new installs. (by moo-dy ) 2026-03-31 Fixed the issue where the add-on fails to start in Python environments below version 3.10. 2026-03-21 Support adjusting the size of nodes in the global graph based on link count; support displaying link titles in the forward links panel. 2026-03-12 Added an optional graph panel in the review interface; fixed the rendering issue of the dropdown menu on the configuration page on macOS by replacing it with left/right radio button groups. 2025-09-20 Adds automatic centering in the Global Relationship Graph. (by BruceFooo ) 2025-04-27 Fixed the issue where double-clicking on links in the editor in the new version of Anki had no response. 2024-10-12 Fixed the crash when opening the add new note window. 2024-09-09 Fixed the conflict with the image occlusion cards. 2024-09-05 Fixed the issue where Anki's preferences behavior was being overridden on macOS. 2024-08-16 Fixed the error message that appeared when exiting reviewer with the automatic links panel display in reviewer disabled. 2024-07-26 Fixed the issue of link jump failure when the deck name contains spaces (by qappell ); Supports customizing which note field to display in the note summary. 2024-07-11 Fixed the issue where the automatic filling of the question field fails when opening an 'Add Note' window by double-clicking a new link; Fix some issues with the previewer. 2024-07-09 Support showing the links panel in the reviewer; Behavior change: Some link click actions have been modified to be more intuitive, which is inconsistent with the behavior in previous versions, please refer to the latest documentation. 2024-07-08 Global graph supports displaying tag nodes; Global graph supports changing the background color (thanks to qappell ); Optimize the configuration page. 2024-07-02 Support displaying Mathjax formulas in links panel and graphic labels; Optimize the line wrapping effect of links to improve readability; Fix incorrect display of \[ in note summary. 2024-06-26 Mask the display of [sound:xxx] in the note summary; Optimize the display when the size of the graph panel changes; Fixed the issue where occasionally no graphics would be displayed when switching the graph panel; Fixed the issue of graphics automatically reverting back to their initial size when modifying notes. 2024-06-12 Reconstruct the graphics rendering mechanism; Improve graphics performance; Fix inaccurate graphic click/drag recognition; Fix anomalies in graphics when a note contains a link to itself; Optimize the display effect of graphics and text; Optimize the adaptive size effect of graphics; Optimize graphic scaling effects; Added a configuration item for whether the global graph defaults to displaying single nodes. 2024-05-09 Optimize the performance of refreshing links/graph panel. 2024-05-08 Refactor link loading scheme to reduce lag; Fix Anki unresponsive when using AnkiConnect to batch operate notes. 2024-04-16 Using GUI configuration interface; Added configuration options for global graph node color; Change menu position; No longer supports old shortcut keys; Fix the error message box pop-up when closing Anki with auto-sync enabled. 2024-03-30 Enable the global graph to support highlighted specified notes; Use the previewer of hjp-linkmaster if it is installed; Added configuration options for default search text in the global graph; Added configuration option for whether to use hjp-linkmaster's previewer. 2024-03-22 Enable the global graph to support search and filtering; Fixed the issue of occasional incorrect links in global graph links. 2024-03-15 Fixed memory leaks in the QtWebEngineProcess; Optimize performance in certain situations. 2024-03-14 Optimize the performance of the global graph and fix the issue of not refreshing the global graph in certain situations. 2024-03-13 Optimize performance when adding note. More. . .

GitHub repository: gugutu/anki-note-linker
Repository description: Link Anki notes to build knowledge network
Languages: JavaScript, HTML, Python, CSS