Skip to main content

Module schema

Module schema 

Source
Expand description

TOML schema types for deck definitions.

§Example TOML

[package]
name = "Spanish Vocabulary"
version = "1.0.0"
author = "Your Name"

[[models]]
name = "Basic Spanish"
fields = ["Spanish", "English", "Example"]
# Optional: specify which field to sort by (default: first field)
sort_field = "Spanish"

[[models.templates]]
name = "Spanish -> English"
front = "{{Spanish}}"
back = "{{FrontSide}}<hr>{{English}}<br><i>{{Example}}</i>"

[[models.templates]]
name = "English -> Spanish"
front = "{{English}}"
back = "{{FrontSide}}<hr>{{Spanish}}"

[[decks]]
name = "Spanish::Vocabulary"
description = "Core Spanish vocabulary"

[[notes]]
deck = "Spanish::Vocabulary"
model = "Basic Spanish"
tags = ["chapter1", "nouns"]

[notes.fields]
Spanish = "el gato"
English = "the cat"
Example = "El gato es negro."

Structs§

DeckDef
Deck definition.
DeckDefinition
Root structure for a deck definition file.
MediaDef
Media file definition.
ModelDef
Model (note type) definition.
NoteDef
Note definition.
PackageInfo
Package metadata.
TemplateDef
Card template definition.