Generate Anki flashcards in Emacs org-mode format for the org-anki plugin. Use when the user says "df-flashcard-org", "flashcard-org", "org-anki", "anki org-mode", "make org flashcards", or wants to create study cards in .org format.
Generate Anki flashcards in Emacs org-mode format for the org-anki plugin.
The user invokes this skill as /df-flashcard-org with arguments:
/df-flashcard-org <output-path> [source]
output-path (required): The .org file to append cards to (e.g., ~/org/cs-notes.org)source (optional): One of the following:
conversation or omitted — uses current conversation contexthttp:// or https://) — fetches the page via WebFetch"Python decorators") — generate cards from your own knowledgeIf output-path is missing, ask: "Where should I write the cards? (org file path)"
Determine the source type by process of elimination:
http:// or https:// → URLconversation or omitted → conversation context<path> — file not found or not a text file" and stop.<url>" and stop.From the source material, generate flashcards. Follow these rules strictly:
$...$ (inline) or \[...\] (display)#+begin_src <lang> ... #+end_src*bold*, /italic/, =verbatim=, ~code~) as appropriatestudy_card is always the first tag (compulsory).python, algorithms, linear_algebra).snake_case, lowercase.Always Basic. No cloze or reversed cards.
Each card MUST follow this exact org-mode structure. Do not deviate from this format:
* <title> :study_card:<tag_0>:<tag_1>:
:PROPERTIES:
:ANKI_NOTE_TYPE: Basic
:END:
** Front
<front content>
** Back
<back answer content>
Formatting rules:
:END:, two blank lines after front content (before ** Back), one blank line after back content (separates cards from each other).:study_card:python:decorators:<path>" and show a summary list of the card titles.No retries, no fallbacks. If an error occurs, fail clearly and stop.
Given /df-flashcard-org ~/org/python.org "Python decorators", generate cards like:
* Decorator Purpose :study_card:python:decorators:
:PROPERTIES:
:ANKI_NOTE_TYPE: Basic
:END:
** Front
What is the purpose of a decorator in Python?
** Back
A decorator is a function that takes another function as input and returns a modified version of it. It allows you to add behavior to functions without changing their source code.
* Decorator Syntax :study_card:python:decorators:
:PROPERTIES:
:ANKI_NOTE_TYPE: Basic
:END:
** Front
What does the =@= syntax do when placed above a function definition in Python?
** Back
It applies a decorator to the function. Writing:
#+begin_src python
@my_decorator
def my_func():
pass
#+end_src
is equivalent to:
#+begin_src python
def my_func():
pass
my_func = my_decorator(my_func)
#+end_src