ExDocAnki

Hex.pmCI

Generate Anki flashcards from any Elixir project's documentation using ExDoc.

What it does

ExDocAnki transforms API documentation into Anki-compatible CSV flashcards for studying through spaced repetition.

For each function, type and callback, ExDocAnki generates a card with:

Usage

Add to your project's mix.exs as a dev dependency:

def deps do
  [
    {:ex_doc_anki, "~> 0.1.0", only: :dev, runtime: false}
  ]
end

Note: If you already have ex_doc as a dependency, remove only: :dev from it:

# Before
{:ex_doc, "~> 0.40", only: :dev, runtime: false}

# After
{:ex_doc, "~> 0.40", runtime: false}

ExDocAnki needs ExDoc at compile time, and Hex requires all dependencies to use the same :only option. Mix will warn you about this if needed.

Then run:

# Generate cards for your project
mix doc_anki

# Generate cards for a dependency (even transitive)
mix doc_anki ecto
mix doc_anki phoenix ecto ecto_sql

The CSV is generated at doc/anki_cards.csv (project) or doc/<package>/anki_cards.csv (dependency).

Importing into Anki

  1. Open Anki and create a new deck
  2. Go to File → Import and select the anki_cards.csv file
  3. Set Field separator to Semicolon
  4. Map the first column to Front and the second column to Back
  5. Select your deck and click Import

Options

How it works

ExDocAnki uses ExDoc.generate/4 under the hood, passing ExDocAnki.Formatter as the formatter module. It extracts:

License

MIT