You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Place the script "obsidian_to_anki.py" in a convenient folder. You may wish to consider placing it in a Scripts folder, and adding the folder to your PATH
8
+
4. Start up Anki, and navigate to your desired profile
9
+
5. Ensure that you've installed [AnkiConnect](https://github.com/FooSoft/anki-connect).
10
+
6. From the command line, run the script once with no arguments - `{Path to script}/obsidian_to_anki.py`
11
+
This will make a configuration file in the same directory as the script, "obsidian_to_anki_config.ini".
12
12
13
13
## Usage
14
14
For simple documentation, run the script with the `-h` flag.
15
15
16
-
Note that you need to have Anki running when using the script.
16
+
To edit the config file, run `obsidian_to_anki.py -c`. This will attempt to open the config file for editing, but isn't guaranteed to work. If it doesn't work, you'll have to navigate to the config file and edit it manually. For more information, see [Config](#config)
17
+
18
+
**All other operations of the script require Anki to be running.**
19
+
20
+
To update the config file with new note types from Anki, run `obsidian_to_anki -u`
21
+
22
+
To add appropriately-formatted notes from a file, run `obsidian_to_anki -f {FILENAME}`
23
+
24
+
### Note formatting
17
25
18
26
In the markdown file, you must format your notes as follows:
19
27
20
-
START
21
-
{Note Type}
22
-
{Note Data}
23
-
END
28
+
> START
29
+
> {Note Type}
30
+
> {Note Data}
31
+
> END
32
+
33
+
24
34
25
35
Apart from the first field, each field must have a prefix to indicate to the program when to move on to the next field. For example:
26
36
27
-
START
28
-
Basic
29
-
This is a test.
30
-
Back: Test successful!
31
-
END
37
+
> START
38
+
> Basic
39
+
> This is a test.
40
+
> Back: Test successful!
41
+
> END
42
+
43
+
When the script successfully adds a note, it will append an ID to the Note Data. This allows you to update existing notes by running the script again.
44
+
45
+
Example output:
46
+
47
+
> START
48
+
> Basic
49
+
> This is a test.
50
+
> Back: Test successful!
51
+
> ID: 1566052191670
52
+
> END
53
+
54
+
### Default
55
+
By default, the script:
56
+
- Adds notes with the tag "Obsidian_to_Anki"
57
+
- Adds to the Default deck
58
+
- Adds to the current profile in Anki
32
59
60
+
## Config
33
61
The configuration file allows you to change two things:
34
62
1. The substitutions for field prefixes. For example, under the section ['Basic'], you'll see something like this:
35
63
36
-
Front = Front:
37
-
Back = Back:
64
+
> Front = Front:
65
+
> Back = Back:
38
66
39
67
If you edit and save this to say
40
68
41
-
Front = Front:
42
-
Back = A:
69
+
> Front = Front:
70
+
> Back = A:
43
71
44
72
Then you now format your notes like this:
45
73
46
-
START
47
-
Basic
48
-
This is a test.
49
-
A: Test successful!
50
-
END
74
+
> START
75
+
> Basic
76
+
> This is a test.
77
+
> A: Test successful!
78
+
> END
51
79
52
80
53
81
2. The substitutions for notes. These are under the section ['Note Substitutions']. Similar to the above, you'll see something like this:
0 commit comments