Subject: Feature Implementation & Bug Report: Per-Card Context Visibility Toggle (no-hierarchy)
Hi Axiome,
I am a PGY-3 Internal Medicine resident and incoming Cardiology Fellow with publications in JAMA, JASN, and JAHA. I am currently using Anki Papers as my primary note-taking and flashcard generation system while studying for ABIM Internal Medicine Board Certification.
I want to first say that Anki Papers is by far the most excellent anki add-on. The markdown-first, note-to-card workflow is exactly what a high-volume learner needs, and the folder/paper organization maps well to medical subspecialty content.
I am writing to report a bug and share a working fix that I believe would make a strong candidate for an official feature.
PROBLEM 1 — Template Overwrite on Generate
Every time Generate (Ctrl+G) is triggered, the add-on rewrites the card templates for all three note types (Basic, Reversible, Cloze) back to their defaults. This means any manual customization a user applies via Tools → Manage Note Types is silently overwritten. For power users who customize their card templates, this is a significant pain point.
PROBLEM 2 — No Per-Card Context Visibility Toggle
Anki Papers surfaces the parent heading hierarchy in the {{Context}} field via the ap-meta div on every card front. This is useful for orientation, but in many cases — particularly for high-yield board-style Q&A cards — the context functions as an answer hint and defeats the purpose of active recall. RemNote, a competing tool, addresses this with a “No Hierarchy” add-on that hides parent context per-card. Anki Papers has no equivalent.
SOLUTION — Tag-Based Per-Card Toggle via card_manager.py
Because the template is managed programmatically in card_manager.py, the fix needs to live there rather than in the Anki template editor. I implemented the following changes directly in card_manager.py, applied to every qfmt block across all three note types:
- Added id=“ctx” to the ap-meta div so it can be targeted by JavaScript.
- Added a script block after the ap-question (or ap-cloze) div that checks for the tag “ap-no-hierarchy” and hides the context div if present.
ORIGINAL qfmt (example from AnkiPapers Basic):
<div class="ankipapers-card">
<div class="ap-meta">{{Context}}</div>
<div class="ap-question">{{Front}}</div>
<div class="ap-footer">
<button class="ap-jump" onclick="pycmd('ankipapers_jump:'+'{{AnkiPapers_Source}}'); event.stopPropagation();">
...
</button>
</div>
</div>
MODIFIED qfmt:
<div class="ankipapers-card">
<div class="ap-meta" id="ctx">{{Context}}</div>
<div class="ap-question">{{Front}}</div>
<script>
(function() {
var tags = "{{Tags}}".split(" ");
if (tags.indexOf("ap-no-hierarchy") !== -1) {
document.getElementById("ctx").style.display = "none";
}
})();
</script>
<div class="ap-footer">
<button class="ap-jump" onclick="pycmd('ankipapers_jump:'+'{{AnkiPapers_Source}}'); event.stopPropagation();">
...
</button>
</div>
</div>
This change was applied to all 8 qfmt blocks across _ensure_basic_type, _ensure_cloze_type, and _ensure_reversible_type (both new-model and else/update branches).
USAGE: After generating cards, the user tags any card with “ap-no-hierarchy” in Anki’s card browser. The context heading is hidden on that card’s front only. Removing the tag restores it instantly. All other cards are unaffected.
FEATURE REQUEST
I would suggest considering this as a first-class feature — ideally exposable via a per-line syntax flag in the paper itself (e.g., a trailing modifier like [no-hierarchy] or a dedicated tag prefix), so users can set it at authoring time without touching the card browser post-generate. This would complete the parity with RemNote’s workflow for users migrating from that platform.
I am happy to share the full modified card_manager.py or submit a pull request if you have a public repository.
Thank you for building Anki Papers — it is already a meaningful part of my board prep workflow.
This is like the “no-hierarchy” power-up in RemNote!
Best regards!