Skip to content

Turn Quarto documents into Anki decks

License

Notifications You must be signed in to change notification settings

vangberg/quarto-ankivalenz

Repository files navigation

quarto-ankivalenz

A Quarto extension for rendering Quarto documents to HTML that can be used with Ankivalenz to generate Anki cards.

Installation

Install the extension to your Quarto project:

quarto add vangberg/quarto-ankivalenz

Create an Ankivalenz configuration file:

ankivalenz init .

Quarto Document

Set the format metadata to ankivalenz-html in your document's YAML header:

---
title: "My Document"
format:
  ankivalenz-html: default
---

Render your document as usual:

quarto render my-document.qmd

The file will be rendered as my-document.ahtml. Add "input_ext": "ahtml" to ankivalenz.json, and run Ankivalenz to generate an Anki deck:

ankivalenz run .

Quarto Book

Add the ankivalenz-html format to your book's format list in _quarto.yml:

format:
  ankivalenz-html: default

Add input_ext and input_dir to ankivalenz.json:

{
  "deck_id": 123456789,
  "deck_name": "My Deck",
  "input_ext": "ahtml",
  "input_dir": "_book"
}

Render your book as usual:

quarto render .

Generate the Anki deck:

ankivalenz run .