### Install AnkiDAY using Pip (Python)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Installs AnkiDAY directly from the Python Package Index (PyPI). This is the standard method for installing released versions of the package. Ensure pip is up-to-date.
```bash
pip install ankiday
```
--------------------------------
### Install AnkiDAY from Source (Python)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Installs AnkiDAY by cloning the repository and installing it in editable mode. This method is recommended for development or if you want the latest changes. It requires Git and Python 3.10+.
```bash
git clone https://github.com/yourusername/ankiday.git
cd ankiday
pip install -e .
```
--------------------------------
### Anki Configuration File Example (YAML)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
An example of a YAML configuration file for AnkiDay, defining the AnkiConnect backend, server details, pruning options, models, decks, notes, and media.
```yaml
version: 1
backend: ankiConnect # or "ankiPython" (not yet implemented)
server:
url: http://127.0.0.1:8765
timeoutSeconds: 30
prune:
decks: false
models: false
notes: false # prune notes not in config within targeted decks/models
models:
- name: BasicExt
css: |
.card { font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 20px; }
fields: [Front, Back, Extra]
templates:
- name: Card 1
qfmt: "{{Front}}"
afmt: "{{Front}}
{{Back}}
{{Extra}}"
uniqueField: Front # used to upsert notes
# Decks can be nested with ::
decks:
- name: Languages::Spanish
config: {}
notes:
- model: BasicExt
deck: Languages::Spanish
fields:
Front: "hola"
Back: "hello"
Extra: "greeting"
tags: [spanish, greeting]
media: # Optional: list of media files to upload
- "audio/hola.mp3"
- "images/hola.jpg"
- model: BasicExt
deck: Languages::Spanish
fields:
Front: "adiós"
Back: "goodbye"
tags: [spanish]
```
--------------------------------
### Verify AnkiDAY Installation (Bash/Zsh)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Checks if the AnkiDAY command-line tool is accessible after installation. This command should display the help message if the installation was successful and the executable is in the system's PATH.
```bash
ankiday --help
```
--------------------------------
### AnkiDAY Basic YAML Configuration Example
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
A basic AnkiDAY configuration file demonstrating essential settings like version, backend, a simple model with fields and templates, a deck, and a single note.
```yaml
# yaml-language-server: $schema=../schema/ankiday-config.schema.json
version: 1
backend: ankiConnect
models:
- name: Basic
fields: [Front, Back]
templates:
- name: Card 1
qfmt: "{{Front}}"
afmt: "{{Back}}"
uniqueField: Front
decks:
- name: Study
config: {}
notes:
- model: Basic
deck: Study
fields:
Front: "Question"
Back: "Answer"
tags: [example]
```
--------------------------------
### Find AnkiDAY Installation Path (Python)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
A Python command to locate the installed AnkiDAY executable. This is useful for troubleshooting if the `ankiday` command is not found in the system's PATH.
```python
import sys
print(sys.executable.replace('/python3', '/ankiday'))
```
--------------------------------
### YAML Note with Media References
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Example demonstrating how to include media files (audio and image) within a YAML configuration for Anki notes. It shows referencing the media files for audio and image fields, and also lists the media files to be uploaded.
```yaml
notes:
- model: LanguageModel
deck: Spanish
fields:
Word: "hola"
Audio: "[sound:hola.mp3]" # Reference the uploaded audio
Image: "
" # Reference the uploaded image
media:
- "audio/hola.mp3" # Will be uploaded as "hola.mp3"
- "images/hola.jpg" # Will be uploaded as "hola.jpg"
tags: [spanish]
```
--------------------------------
### Complete AnkiDAY Cloze Model Example
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This comprehensive YAML example defines a complete AnkiDAY cloze model named 'StudyCloze'. It includes CSS for styling, defines fields ('Text', 'Extra'), sets up cloze templates for question and answer formatting, and provides a sample note with cloze deletions and an extra field.
```yaml
version: 1
backend: ankiConnect
models:
- name: StudyCloze
isCloze: true
css: |
.card {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-size: 20px;
line-height: 1.5;
color: #333;
background: #fff;
padding: 20px;
max-width: 600px;
margin: 0 auto;
}
.cloze {
font-weight: bold;
color: #007acc;
background-color: #e8f4f8;
padding: 2px 6px;
border-radius: 4px;
}
.extra {
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid #eee;
color: #666;
font-size: 16px;
}
fields: [Text, Extra]
templates:
- name: Cloze
qfmt: '{{cloze:Text}}'
afmt: '{{cloze:Text}}{{#Extra}}{{/Extra}}'
uniqueField: Text
decks:
- name: Geography
notes:
- model: StudyCloze
deck: Geography
fields:
Text: "The {{c1::Amazon River}} is the {{c2::longest}} river in {{c3::South America}} and flows into the {{c4::Atlantic Ocean}}."
Extra: "The Amazon River system is approximately 6,400 km (4,000 miles) long."
tags: [geography, rivers, south-america]
```
--------------------------------
### YAML for Meaningful Cloze Context
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML example demonstrates the best practice of using meaningful context for cloze deletions. It shows how to create focused cloze deletions that test specific concepts, contrasting it with an example of over-clozing.
```yaml
# Good
Text: "The {{c1::French Revolution}} began in {{c2::1789}} and led to major social changes."
# Avoid
Text: "{{c1::The}} {{c2::French}} {{c3::Revolution}} {{c4::began}} {{c5::in}} {{c6::1789}}."
```
--------------------------------
### YAML for Cloze Deletions with Hints
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML example demonstrates how to use hints for cloze deletions when the context alone might not be sufficient. It shows the syntax for adding a hint after the cloze text.
```yaml
Text: "The largest planet is {{c1::Jupiter::gas giant}}."
```
--------------------------------
### Get Anki Model Templates (JSON)
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
Retrieves the current templates for a specified Anki model. Requires the AnkiConnect API version and the model name.
```json
{
"action": "modelTemplates",
"version": 6,
"params": {
"modelName": "ModelName"
}
}
```
--------------------------------
### YAML for Using the Extra Field
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML example illustrates the use of the 'Extra' field in AnkiDAY. The 'Extra' field can be used to provide additional context, explanations, or examples related to the cloze deletion.
```yaml
Extra: "Jupiter is more than twice as massive as all other planets combined."
```
--------------------------------
### Sublime Text: Configure YAML Schema with LSP
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
Configure AnkiDAY YAML schema support in Sublime Text by installing the LSP package and LSP-yaml, then adding the 'yaml.schemas' configuration to your LSP settings.
```json
{
"yaml-language-server": {
"settings": {
"yaml.schemas": {
"./schema/ankiday-config.schema.json": ["*.ankiday.yaml"]
}
}
}
}
```
--------------------------------
### Get Anki Model Styling (JSON)
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
Retrieves the current CSS styling for a specified Anki model. Requires the AnkiConnect API version and the model name.
```json
{
"action": "modelStyling",
"version": 6,
"params": {
"modelName": "ModelName"
}
}
```
--------------------------------
### YAML for Logical Grouping of Cloze Deletions
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML example illustrates the principle of logical grouping for cloze deletions. It shows how to use the same cloze number for related information within a single sentence, improving learning structure.
```yaml
Text: "{{c1::DNA}} is made of {{c1::nucleotides}}, while {{c2::RNA}} is made of {{c2::ribonucleotides}}."
```
--------------------------------
### Advanced Cloze Model with Multiple Fields (YAML)
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
Defines an 'AdvancedCloze' model with enhanced styling and multiple fields (Text, Hint, Source, Extra). It demonstrates conditional display of fields and uses `{{cloze:FieldName}}` syntax in templates. An example note with cloze deletions and hints is also provided.
```yaml
models:
- name: AdvancedCloze
isCloze: true
css: |
.card {
font-family: Georgia, serif;
font-size: 18px;
padding: 20px;
max-width: 600px;
margin: 0 auto;
}
.cloze {
font-weight: bold;
color: #d73502;
background-color: #ffe6e1;
padding: 2px 4px;
border-radius: 3px;
}
.hint {
color: #888;
font-style: italic;
margin-bottom: 10px;
}
.source {
color: #666;
font-size: 14px;
margin-top: 15px;
border-top: 1px solid #ddd;
padding-top: 10px;
}
fields: [Text, Hint, Source, Extra]
templates:
- name: Cloze
qfmt: |
{{#Hint}}💡 {{Hint}}
{{/Hint}}
{{cloze:Text}}
afmt: |
{{#Hint}}💡 {{Hint}}
{{/Hint}}
{{cloze:Text}}
{{#Extra}}
{{Extra}}{{/Extra}}
{{#Source}}📖 Source: {{Source}}
{{/Source}}
uniqueField: Text
notes:
- model: AdvancedCloze
deck: Programming
fields:
Text: "In Python, {{c1::list comprehensions}} provide a {{c2::concise}} way to create lists. The syntax is {{c3::[expression for item in iterable]}}"
Hint: "A Pythonic way to create lists"
Source: "Python Documentation"
Extra: "More efficient than traditional for loops"
tags: [python, list-comprehensions]
```
--------------------------------
### Anki Configuration: Verbose Output
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Enables detailed output for AnkiDay commands, providing insights into backend operations, planning, and execution phases. Useful for debugging and monitoring.
```bash
# Show detailed output during operations ankiday diff -f config.yaml --verbose ankiday apply -f config.yaml --verbose ankiday list --decks --verbose
```
--------------------------------
### Preview Anki Configuration Changes (Dry-Run)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Shows a preview of the changes that would be applied to Anki based on the configuration file without making any actual modifications. This is useful for reviewing intended actions.
```bash
ankiday diff -f examples/config.example.yaml
```
--------------------------------
### Apply Anki Configuration
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Applies the configuration defined in the YAML file to Anki, creating or updating decks, models, and notes. This command modifies your Anki collection.
```bash
ankiday apply -f examples/config.example.yaml
```
--------------------------------
### Create Symlink for AnkiDAY (Bash)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Creates a symbolic link (symlink) for the AnkiDAY executable in a common binary directory (`/usr/local/bin`). This makes the `ankiday` command available system-wide without modifying the PATH directly.
```bash
# Replace with your actual path from step 1
```
```bash
sudo ln -sf /Library/Frameworks/Python.framework/Versions/3.12/bin/ankiday /usr/local/bin/ankiday
```
--------------------------------
### Run AnkiDAY Command with Full Path on Windows
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Executes the AnkiDAY command using its full path. This is a workaround if the command is not found in the system's PATH, useful for testing or specific script execution.
```cmd
C:\Python310\Scripts\ankiday.exe validate -f config.yaml
```
--------------------------------
### Anki Sound/Video Tag Reference
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Shows the specific syntax used within Anki notes to reference audio or video files. This format is used for embedding multimedia content, such as spoken pronunciations or video clips, into flashcards.
```html
[sound:filename.mp3]
[sound:pronunciation.wav]
```
--------------------------------
### Basic Cloze Model and Note Configuration (YAML)
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
Sets up a basic 'BasicCloze' model with cloze functionality and defines a sample note using it. The `isCloze: true` flag activates cloze features, and the note content utilizes `{{c1::...}}` syntax for cloze deletions.
```yaml
version: 1
backend: ankiConnect
models:
- name: BasicCloze
isCloze: true
fields: [Text, Extra]
templates:
- name: Cloze
qfmt: '{{cloze:Text}}'
afmt: '{{cloze:Text}}
{{Extra}}'
uniqueField: Text
decks:
- name: Study
notes:
- model: BasicCloze
deck: Study
fields:
Text: "The {{c1::mitochondria}} is the {{c2::powerhouse}} of the cell."
Extra: "Basic biology fact"
tags: [biology, cell]
```
--------------------------------
### List Anki Entities
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Lists various entities within your Anki collection, such as decks and models. You can specify limits for the number of notes to retrieve.
```bash
ankiday list --decks --models --notes-limit 20
```
--------------------------------
### Anki Configuration: Skip Model Validation
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Applies Anki configurations while skipping the validation of models. This is useful when models are defined externally or in separate files.
```bash
# Validate config without checking if models are defined in the same file ankiday validate -f notes.yaml --skip-model-validation
# Generate diff relying on models that exist in Anki ankiday diff -f notes.yaml --skip-model-validation
# Apply notes that reference externally defined models ankiday apply -f notes.yaml --skip-model-validation
```
--------------------------------
### Add AnkiDAY Scripts Directory to PATH on Windows (PowerShell)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Adds the directory containing AnkiDAY's scripts (like `ankiday.exe`) to the user's PATH environment variable in PowerShell. This allows running `ankiday` from any directory. For a permanent change, it should be added to the PowerShell profile.
```powershell
# Replace with your actual path from step 1
```
```powershell
$env:PATH += ";C:\Python310\Scripts"
```
--------------------------------
### Test AnkiConnect API Updates via cURL (Bash)
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
Provides cURL commands to test the AnkiConnect API for updating model styling and templates. These commands send POST requests to the local AnkiConnect endpoint.
```bash
# Test styling update
curl -X POST -d '{"action": "updateModelStyling", "version": 6, "params": {"model": {"name": "BasicExt", "css": ".card { color: red; }"}}}' http://127.0.0.1:8765
# Test template update
curl -X POST -d '{"action": "updateModelTemplates", "version": 6, "params": {"model": {"name": "BasicExt", "templates": {"Card 1": {"Front": "{{Front}}", "Back": "{{Back}}"}}}}}' http://127.0.0.1:8765
# Verify changes
curl -X POST -d '{"action": "modelStyling", "version": 6, "params": {"modelName": "BasicExt"}}' http://127.0.0.1:8765
curl -X POST -d '{"action": "modelTemplates", "version": 6, "params": {"modelName": "BasicExt"}}' http://127.0.0.1:8765
```
--------------------------------
### Validate Anki Configuration
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Validates the Anki configuration file to ensure it is correctly formatted and all references are valid. This command helps catch errors before applying changes.
```bash
ankiday validate -f examples/config.example.yaml
```
--------------------------------
### JetBrains IDEs: YAML Schema Mapping
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
Configure AnkiDAY YAML schema support in JetBrains IDEs (PyCharm, IntelliJ, WebStorm) via the IDE's settings. This allows for autocompletion and validation based on the schema file.
```text
Name: AnkiDAY Configuration
Schema file or URL: schema/ankiday-config.schema.json
File path pattern: *.ankiday.yaml or config*.yaml
```
--------------------------------
### VS Code: Associate YAML Schema in Global Settings
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
Set up AnkiDAY YAML schema association globally in your VS Code settings by adding a 'yaml.schemas' entry. This method applies the schema to files matching the specified pattern across all your projects.
```json
{
"yaml.schemas": {
"https://raw.githubusercontent.com/your-repo/ankiday/main/schema/ankiday-config.schema.json": ["*.ankiday.yaml"]
}
}
```
--------------------------------
### Find AnkiDAY Executable Path on Windows (Command Prompt)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
A Python command executed in the Windows Command Prompt to find the location of the AnkiDAY executable. This is helpful for troubleshooting when the `ankiday` command is not recognized.
```cmd
python -c "import sys; print(sys.executable.replace('python.exe', 'Scripts\ankiday.exe'))"
```
--------------------------------
### HTML Image Tag Reference
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Illustrates the standard HTML tag used to reference image files within Anki note fields. This syntax allows for embedding images directly into the content of a flashcard.
```html
```
--------------------------------
### Model Styling API
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
This section covers the AnkiConnect API endpoints for retrieving and updating model styling (CSS).
```APIDOC
## Get Model Styling (Read)
### Description
Retrieves the current CSS styling for a specified Anki model.
### Method
POST
### Endpoint
http://127.0.0.1:8765
### Parameters
#### Request Body
- **action** (string) - Required - The action to perform, should be "modelStyling".
- **version** (integer) - Required - The API version, should be 6.
- **params** (object) - Required - Parameters for the action.
- **modelName** (string) - Required - The name of the model to retrieve styling for.
### Request Example
```json
{
"action": "modelStyling",
"version": 6,
"params": {
"modelName": "ModelName"
}
}
```
### Response
#### Success Response (200)
- **result** (object) - An object containing the CSS styling.
- **css** (string) - The CSS rules for the model.
- **error** (null) - Should be null on success.
#### Response Example
```json
{
"result": {
"css": ".card { font-size: 20px; }"
},
"error": null
}
```
```
```APIDOC
## Update Model Styling (Write)
### Description
Updates the CSS styling for a specified Anki model.
### Method
POST
### Endpoint
http://127.0.0.1:8765
### Parameters
#### Request Body
- **action** (string) - Required - The action to perform, should be "updateModelStyling".
- **version** (integer) - Required - The API version, should be 6.
- **params** (object) - Required - Parameters for the action.
- **model** (object) - Required - An object containing the model details.
- **name** (string) - Required - The name of the model to update.
- **css** (string) - Required - The new CSS styling for the model.
### Request Example
```json
{
"action": "updateModelStyling",
"version": 6,
"params": {
"model": {
"name": "ModelName",
"css": ".card { font-size: 24px; }"
}
}
}
```
### Response
#### Success Response (200)
- **result** (null) - Should be null on successful update.
- **error** (null) - Should be null on success.
#### Response Example
```json
{
"result": null,
"error": null
}
```
```
--------------------------------
### Model Templates API
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
This section covers the AnkiConnect API endpoints for retrieving and updating model templates.
```APIDOC
## Get Model Templates (Read)
### Description
Retrieves the current templates for a specified Anki model.
### Method
POST
### Endpoint
http://127.0.0.1:8765
### Parameters
#### Request Body
- **action** (string) - Required - The action to perform, should be "modelTemplates".
- **version** (integer) - Required - The API version, should be 6.
- **params** (object) - Required - Parameters for the action.
- **modelName** (string) - Required - The name of the model to retrieve templates for.
### Request Example
```json
{
"action": "modelTemplates",
"version": 6,
"params": {
"modelName": "ModelName"
}
}
```
### Response
#### Success Response (200)
- **result** (object) - An object containing the templates for each card.
- **Card Name** (object) - Contains 'Front' and 'Back' template strings.
- **error** (null) - Should be null on success.
#### Response Example
```json
{
"result": {
"Card 1": {
"Front": "{{Front}}",
"Back": "{{Front}}
{{Back}}"
}
},
"error": null
}
```
```
```APIDOC
## Update Model Templates (Write)
### Description
Updates the templates for a specified Anki model.
### Method
POST
### Endpoint
http://127.0.0.1:8765
### Parameters
#### Request Body
- **action** (string) - Required - The action to perform, should be "updateModelTemplates".
- **version** (integer) - Required - The API version, should be 6.
- **params** (object) - Required - Parameters for the action.
- **model** (object) - Required - An object containing the model details.
- **name** (string) - Required - The name of the model to update.
- **templates** (object) - Required - An object where keys are card names and values are template objects with 'Front' and 'Back' properties.
### Request Example
```json
{
"action": "updateModelTemplates",
"version": 6,
"params": {
"model": {
"name": "ModelName",
"templates": {
"Card 1": {
"Front": "{{Front}}",
"Back": "{{Front}}
{{Back}}"
}
}
}
}
}
```
### Response
#### Success Response (200)
- **result** (null) - Should be null on successful update.
- **error** (null) - Should be null on success.
#### Response Example
```json
{
"result": null,
"error": null
}
```
```
--------------------------------
### VS Code: Associate YAML Schema in Workspace Settings
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
Configure AnkiDAY YAML schema association for your workspace by adding a 'yaml.schemas' entry to your `.vscode/settings.json` file. This applies the schema to files matching the specified patterns within the workspace.
```json
{
"yaml.schemas": {
"./schema/ankiday-config.schema.json": ["*.ankiday.yaml", "ankiday-*.yaml"]
}
}
```
--------------------------------
### Add AnkiDAY to PATH Permanently (Zsh)
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Modifies the Zsh shell configuration file (`.zshrc`) to permanently add the directory containing the AnkiDAY executable to the system's PATH. This allows running `ankiday` from any location.
```bash
# Replace with your actual path from step 1
```
```bash
echo 'export PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```
--------------------------------
### Neovim/Vim: Configure YAML Schema with coc.nvim
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
Configure AnkiDAY YAML schema association for Neovim or Vim using the coc.nvim plugin and coc-yaml. Add the 'yaml.schemas' configuration to your coc-settings.json file.
```vim
" In your coc-settings.json
{
"yaml.schemas": {
"./schema/ankiday-config.schema.json": ["*.ankiday.yaml", "config*.yaml"]
}
}
```
--------------------------------
### VS Code: Associate YAML Schema by File
Source: https://github.com/uncleis/ankiday/blob/main/docs/SCHEMA.md
Associate the AnkiDAY YAML schema with specific files directly within the YAML file using a special comment. This method is useful for project-specific configurations.
```yaml
# yaml-language-server: $schema=../schema/ankiday-config.schema.json
```
--------------------------------
### Anki Template Question Format (qfmt) for Cloze
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML snippet demonstrates the correct syntax for the question format (qfmt) in Anki templates when using Cloze deletions. It explicitly uses `{{cloze:FieldName}}` to render the cloze portion of the specified field.
```yaml
qfmt: '{{cloze:Text}}'
```
--------------------------------
### Anki Template Answer Format (afmt) with Conditional Fields
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
Illustrates an Anki template's answer format (afmt) using multi-line YAML. It includes Cloze deletions and conditionally displays 'Hint' and 'Extra' fields based on whether they contain content, using Anki's `{{#FieldName}}...{{/FieldName}}` syntax.
```yaml
afmt: |
{{cloze:Text}}
{{#Hint}}💡 {{Hint}}
{{/Hint}}
{{#Extra}}
{{Extra}}{{/Extra}}
```
--------------------------------
### YAML for Correct Anki Template Syntax
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML snippet shows the correct template syntax for Anki cloze cards. It highlights the use of `{{cloze:FieldName}}` which is essential for cloze deletions to function properly.
```yaml
# Correct
qfmt: '{{cloze:Text}}'
```
--------------------------------
### Update Anki Model Styling (JSON)
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
Updates the CSS styling for a specified Anki model. This operation requires the AnkiConnect API version, the model name, and the new CSS content.
```json
{
"action": "updateModelStyling",
"version": 6,
"params": {
"model": {
"name": "ModelName",
"css": ".card { font-size: 24px; }"
}
}
}
```
--------------------------------
### Delete Anki Entities
Source: https://github.com/uncleis/ankiday/blob/main/README.md
Explicitly deletes specified entities from Anki. This command is dangerous and should be used with caution, as deletions are permanent.
```bash
ankiday delete --deck "My::Deck" --model "MyModel" --note-query "deck:My::Deck tag:obsolete"
```
--------------------------------
### Update Anki Model Templates (JSON)
Source: https://github.com/uncleis/ankiday/blob/main/ANKICONNECT_API.md
Updates the templates for a specified Anki model. This operation requires the AnkiConnect API version, the model name, and the new template structure.
```json
{
"action": "updateModelTemplates",
"version": 6,
"params": {
"model": {
"name": "ModelName",
"templates": {
"Card 1": {
"Front": "{{Front}}",
"Back": "{{Front}}
{{Back}}"
}
}
}
}
}
```
--------------------------------
### Configure Cloze Model in AnkiDAY (YAML)
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This configuration enables Cloze deletion functionality for a model in AnkiDAY. The `isCloze: true` parameter is mandatory. It defines the model's name, CSS styling, fields, and templates for cloze cards.
```yaml
models:
- name: MyClozeModel
isCloze: true # This is REQUIRED for cloze models
css: |
.card {
font-family: arial;
font-size: 20px;
text-align: center;
}
.cloze {
font-weight: bold;
color: blue;
}
fields: [Text, Extra]
templates:
- name: Cloze
qfmt: '{{cloze:Text}}'
afmt: '{{cloze:Text}}
{{#Extra}}{{Extra}}{{/Extra}}'
uniqueField: Text
```
--------------------------------
### Default Cloze Styling (CSS)
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
Provides the default CSS styling for Cloze deletions in Anki. The `.cloze` class is automatically applied by Anki to highlighted cloze text, setting its font weight and color.
```css
.cloze {
font-weight: bold;
color: blue;
}
```
--------------------------------
### Anki Template Answer Format (afmt) with Extra Fields
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This YAML snippet shows the answer format (afmt) for Anki templates, including Cloze deletions and conditional display of an 'Extra' field. The `{{#Extra}}{{Extra}}{{/Extra}}` syntax ensures the 'Extra' field is only displayed if it contains content.
```yaml
afmt: '{{cloze:Text}}
{{#Extra}}{{Extra}}{{/Extra}}'
```
--------------------------------
### CSS for Highlighted Cloze Deletions
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This CSS snippet defines styling for highlighted cloze deletions, applying a yellow background, padding, rounded borders, and bold font weight. It targets elements with the class 'cloze'.
```css
/* Highlighted cloze */
.cloze {
background-color: yellow;
padding: 2px 4px;
border-radius: 3px;
font-weight: bold;
}
```
--------------------------------
### Night Mode Cloze Styling (CSS)
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
Defines CSS rules for Cloze deletions specifically for Anki's night mode. This ensures better readability by adjusting the text color when the dark theme is active.
```css
.nightMode .cloze {
color: lightblue;
}
```
--------------------------------
### CSS for Subtle Cloze Deletions
Source: https://github.com/uncleis/ankiday/blob/main/docs/CLOZE_MODELS.md
This CSS snippet provides a more subtle styling for cloze deletions, using a bottom border, bold font weight, and a specific blue color. It targets elements with the class 'cloze'.
```css
/* Subtle cloze */
.cloze {
border-bottom: 2px solid #007acc;
font-weight: bold;
color: #007acc;
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.