Notes: Study and Revision Helpers¶
Engrapha ships several blocks specifically for preparation: question, qbox, mcq, revision card, and flashcard.
Questions and answers¶
en.question("Why is HashTable O(1) average-case?")
en.answer("Hashing distributes keys uniformly across buckets.")
Qbox (boxed question card)¶
qbox is a fully bordered question card (good for assignments and worksheets):
Multiple Choice Questions (MCQ)¶
en.mcq(
"Which sort is worst-case O(N log N)?",
options=["Bubble Sort", "Insertion Sort", "Merge Sort", "Quicksort"],
correct_index=2,
)
The correct answer (Merge Sort, at index 2) is highlighted in green.
Revision cards¶
en.revision_card(
title="Key Metrics",
points=[
"Average Latency",
"Tail Latency (p99)",
"Throughput",
"Resource Utilization",
]
)
Flashcards (with Anki export)¶
Each flashcard() call:
- Registers the card globally
- Adds a visible card to the story (so it appears in the PDF)
- On
build_doc(), exports a CSV, JSON, and.apkgAnki deck beside the PDF
The Anki cards support inline $$ math $$ and HTML formatting.
Question banks from markdown¶
Use the Markdown CLI compiler to build full question banks:
Mix and match¶
You can freely interleave callouts, theorems, questions, etc. in the same narrative flow:
en.section("Big-O Cheatsheet")
en.theorem("Big-O is defined in the limit, not locally.")
en.qbox("Order: O(1) < O(log N) < O(N) < O(N log N) < O(N^2).")
en.flashcard("Best Big-O space complexity for QuickSort",
"O(log N) - from recursion stack")