MemoScript Docs

MemoScript Syntax

A YAML-based language for writing flashcards quickly and expressively.

MemoScript is a simple YAML syntax for creating flashcards. Each file is a YAML array of card objects. MemoScript supports four card types:

  • Basic — a front/back question-answer pair
  • Reversible — a basic card that also generates a flipped version
  • Cloze — fill-in-the-blank with {{markers}}
  • Multiple Choice (MCQ) — a question with selectable choices

Quick example

YAML Editor
Live Preview
basic

What is the capital of France?

Answer:

Paris

reversible

Bonjour

Answer:

Hello

cloze

The mitochondria is the powerhouse of the cell

Answer:

mitochondria

mcq

Which planet is largest?

Earth
Mars
Jupiter
Saturn

General rules

  1. A MemoScript file must be a YAML array (each item starts with -).
  2. Card type is detected automatically from the fields present.
  3. Detection priority: cloze field → choices field → front/back (with optional reversible).
  4. All string values are trimmed of leading/trailing whitespace.
  5. Unknown fields are ignored — only recognised fields affect card type.

Basic Cards

A Basic card is the simplest card type — a question on the front and an answer on the back.

Syntax

- front: Your question or prompt
  back: Your answer or response

Shorthand aliases

You can use Q/A (or lowercase q/a) instead of front/back:

- Q: What is the capital of France?
  A: Paris

- q: Define photosynthesis
  a: The process by which plants convert light into chemical energy

Fields

FieldTypeRequiredAliases
frontstringYesQ, q
backstringYesA, a

What it creates

A Basic card renders as a two-sided flashcard. During study, you see the front side first and reveal the back side to check your answer.

Validation rules

  • Both front and back must be present and non-empty after trimming.
  • If front is missing or empty → error: "Front side cannot be empty"
  • If back is missing or empty → error: "Back side cannot be empty"
  • If reversible: true is also set, the card becomes a Reversible card instead.

Try it

YAML Editor
Live Preview
basic

What is the capital of France?

Answer:

Paris

Examples

# Full syntax
- front: What year did World War II end?
  back: "1945"

# Shorthand
- Q: What is 2 + 2?
  A: "4"

# Multi-line values
- front: >
    Explain the difference between
    a stack and a queue.
  back: >
    A stack is LIFO (last in, first out).
    A queue is FIFO (first in, first out).

Reversible Cards

A Reversible card is like a Basic card, but it also creates a second card with front and back swapped. This is useful for vocabulary, translations, or any pair you want to study in both directions.

Syntax

- front: Term A
  back: Term B
  reversible: true

The Q/A shorthand works here too:

- Q: photosynthesis
  A: 6CO₂ + 6H₂O → C₆H₁₂O₆ + 6O₂
  reversible: true

Fields

FieldTypeRequiredAliases
frontstringYesQ, q
backstringYesA, a
reversiblebooleanYes

What it creates

One YAML entry produces two study cards:

  1. Forward — front → back (same as a Basic card)
  2. Flipped — back → front

This means writing one reversible card gives you twice the study material.

Validation rules

  • Same rules as Basic cards — both front and back must be non-empty.
  • The reversible field must be explicitly set to true.
  • If reversible is absent or false, the card is treated as a Basic card.

Try it

YAML Editor
Live Preview
reversible

Bonjour

Answer:

Hello

Examples

# Language vocabulary
- front: Bonjour
  back: Hello
  reversible: true

# Capitals
- front: Berlin
  back: Germany
  reversible: true

# Chemical symbols
- Q: Fe
  A: Iron
  reversible: true

Cloze Cards

A Cloze card hides one or more words inside {{double braces}}. During study you see the sentence with blanks and must recall the hidden text.

Syntax

- cloze: The {{mitochondria}} is the powerhouse of the cell

Multiple blanks

You can have as many blanks as you like in a single card:

- cloze: "{{Paris}} is the capital of {{France}}"

With options (multiple-choice cloze)

You can optionally provide answer choices for each blank. The first item in each array must match the blank exactly:

- cloze: The {{sun}} is a {{star}}
  options:
    - [sun, moon, planet]
    - [star, planet, asteroid]

Fields

FieldTypeRequiredDescription
clozestringYesText with {{markers}} for blanks
optionsstring[][]NoAnswer choices per blank

What it creates

A Cloze card renders the full sentence with the {{marked}} portions replaced by blanks. You must fill in each blank to complete the card.

When options are provided, each blank is presented as a multiple-choice selector instead of a free-text input.

Validation rules

  • The cloze text must be non-empty after trimming.
  • Must contain at least one {{marker}} — error: "Cloze card must have at least one {{hidden}} marker"
  • If options are provided:
    • Must be an array of arrays (string[][]).
    • The number of option arrays must exactly match the number of blanks — error if mismatched.
    • Each option array must have at least 2 items (the correct answer plus at least one distractor).
    • The first item in each array must match the corresponding blank text exactly.

Try it

YAML Editor
Live Preview
cloze

The mitochondria is the powerhouse of the cell

Answer:

mitochondria

Examples

# Single blank
- cloze: The {{mitochondria}} is the powerhouse of the cell

# Multiple blanks
- cloze: "{{Newton}} published the Principia in {{1687}}"

# With options for each blank
- cloze: The {{mitochondria}} is the {{powerhouse}} of the cell
  options:
    - [mitochondria, chloroplast, ribosome]
    - [powerhouse, factory, engine]

# Longer text
- cloze: >
    In {{1969}}, {{Neil Armstrong}} became the first
    person to walk on the {{Moon}}.

Multiple Choice Cards

An MCQ card presents a question with a list of choices. Correct answers are marked with [square brackets].

Syntax

- front: Which planet is largest?
  choices:
    - Earth
    - Mars
    - [Jupiter]
    - Saturn

Multiple correct answers

Wrap every correct choice in brackets:

- front: Select all prime numbers
  choices:
    - [2]
    - 4
    - [5]
    - 6
    - [7]

Fields

FieldTypeRequiredAliases
frontstringYesQ, q
choicesstring[]Yes

How correct answers work

  • A choice written as [Jupiter] is marked correct. The brackets are stripped from the displayed text — the student sees "Jupiter", not "[Jupiter]".
  • Any choice not wrapped in brackets is an incorrect distractor.
  • You can mark one or many choices as correct.

What it creates

An MCQ card shows the question on top and the choices as selectable options. The student picks one (or more) and the card reveals which answers are correct.

Validation rules

  • front (or Q/q) must be non-empty — error: "Front side cannot be empty"
  • choices must be an array with at least 2 items — error: "MCQ card must have at least 2 choices"
  • At least one choice must be wrapped in [brackets] — error: "MCQ card must have at least one correct answer marked with [brackets]"

Try it

YAML Editor
Live Preview
mcq

Which planet is largest?

Earth
Mars
Jupiter
Saturn

Examples

# Single correct answer
- front: What is the chemical symbol for water?
  choices:
    - CO2
    - [H2O]
    - NaCl
    - O2

# Multiple correct answers
- front: Which of these are programming languages?
  choices:
    - HTML
    - [Python]
    - [JavaScript]
    - CSS

# With Q shorthand
- Q: Who painted the Mona Lisa?
  choices:
    - Michelangelo
    - [Leonardo da Vinci]
    - Raphael
    - Donatello

On this page