Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Creating cards

Kirill Salnikov edited this page Nov 6, 2021 · 10 revisions

In order for the program to be able to separate cards from all the rest of the text in the file, you need to enclose them between two ---:

---

Deck: Life Questions

Tags: learning life-questions

1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?

> 42

2. If it {looks like a duck, swims like a duck, and quacks like a duck}, then it is a {duck}.

---

You can create any number of such sections in the file.

I want to use --- for other purposes

inka looks for cards in sections of text between two ---. Therefore, you are not advised to use them anywhere else in the same file. But if you want to use them, consider this simple rule:

  • Before and after the section with inka cards there must be an even number of ---.

Wrong:

## Topic

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse scelerisque est diam, sit amet sollicitudin sem iaculis nec. 

Vestibulum nec ligula feugiat, venenatis ligula et, mollis eros. Quisque condimentum pulvinar elit, id condimentum erat dignissim vitae. 

---

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse scelerisque est diam, sit amet sollicitudin sem iaculis nec. 

Vestibulum nec ligula feugiat, venenatis ligula et, mollis eros. Quisque condimentum pulvinar elit, id condimentum erat dignissim vitae. 

Quisque finibus posuere tincidunt. Vivamus auctor mollis lectus, eu rutrum nulla euismod at. Mauris finibus et nibh sed vehicula. Aliquam 


---

1. Card with {cloze}

2. Front

> Back

---

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse scelerisque est diam, sit amet sollicitudin sem iaculis nec. 

Vestibulum nec ligula feugiat, venenatis ligula et, mollis eros. Quisque condimentum pulvinar elit, id condimentum erat dignissim vitae. 

Quisque finibus posuere tincidunt. Vivamus auctor mollis lectus, eu rutrum nulla euismod at. Mauris finibus et nibh sed vehicula. Aliquam 

vehicula vitae velit vel egestas. Integer bibendum erat a tristique volutpat. Quisque id placerat massa. 

---

Right:

## Topic

---

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse scelerisque est diam, sit amet sollicitudin sem iaculis nec. 

Vestibulum nec ligula feugiat, venenatis ligula et, mollis eros. Quisque condimentum pulvinar elit, id condimentum erat dignissim vitae. 

---

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse scelerisque est diam, sit amet sollicitudin sem iaculis nec. 

Vestibulum nec ligula feugiat, venenatis ligula et, mollis eros. Quisque condimentum pulvinar elit, id condimentum erat dignissim vitae. 

Quisque finibus posuere tincidunt. Vivamus auctor mollis lectus, eu rutrum nulla euismod at. Mauris finibus et nibh sed vehicula.

---

1. Card with {cloze}

2. Front

> Back

---

For example, it is okay to use yaml metadata syntax in at beginning of the file:

---
title: YAML Metadata
description: A very simple way to add metadata to a file.
---

Front/Back notes

---

1. Question?

> Answer

2. The question can

span multiple lines.

> And answer
> too.

---

Every question starts with number followed by period (e.g. 1., 2. - Markdown ordered list syntax) and every line of the answer starts with > (Markdown quote syntax). Question and answer can span multiple lines.

Cloze notes

Same as Front/Back notes, Cloze notes start with number followed by period (Markdown ordered list syntax).

---

1. You can use short {cloze syntax}.

2. Or short {1::cloze syntax} with explicit index.
You can add optional 'c' before number: {c2::my cloze}.

3. Or Anki {{c1::cloze syntax}}.

4. All of them also support hints {short::my hint}, {2::short with index::my hint}, {{c3::Anki syntax::my hint}}.

5. Inside inline/block math and code only Anki syntax is supported to exclude possible false positives:

$$
{{c1:: F }} = {{c2:: G\frac{m_1 m_2}{R^2} }}
$$

---

Index of cloze deletions with implicit short syntax (e.g. {cloze deletion}) is calculated as serial number among all cloze deletions. Examples:

{Paris} is the capital and most populous city of {2::France} with a estimated population of {2,148,271} residents -> {{c1::Paris}} is the capital and most populous city of {{c2::France}}, with a estimated population of {{c3::2,148,271}} residents

{Paris} is the capital and most populous city of {3::France}, with a estimated population of {2,148,271} residents -> {{c1::Paris}} is the capital and most populous city of {{c3::France}}, with a estimated population of {{c3::2,148,271}} residents

{c3::Paris} is the capital and most populous city of {3::France}, with a {{c1::estimated}} population of {2,148,271} residents -> {{c3::Paris}} is the capital and most populous city of {{c3::France}}, with a {{c1::estimated}} population of {{c4::2,148,271}} residents

To avoid possible ordering problems after note was changed in file, inka will replace short syntax in the file with the Anki syntax after the card has been added/synced to/with Anki.

Deck and Tags

Inside the section, you can specify the name of the deck to which the cards will be added, and tags for the cards. If deck name isn't specified, then the one from the config is used (Default by default). The deck name is written after Deck:, and tags for all cards after Tags: with spaces between each tag.

---

Deck: Life Questions

Tags: learning life-questions

1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?

> 42

2. If it {looks like a duck, swims like a duck, and quacks like a duck}, then it is a {duck}.

---

Here the deck is Life Questions and the tags are learning and life-questions.

Images

---

1. If it looks like a duck, swims like a duck, and quacks like a duck, then what is it?

> It is a duck!
> ![duck](duck_image.png)

---

If you have Markdown links to images in your Front/Back or Cloze notes, inka will copy those images to Anki media folder and convert the link to the format suitable for Anki.

If another image with the same name already exists in Anki media folder, an error will occur.

Clone this wiki locally