Obsidian_to_Anki
Obsidian_to_Anki copied to clipboard
Renaming note-types breaks them
Hey, I'm using this project as the obsidian extension, and I really like it so far. Thank you!
I ran into an issue when using it today though. Namely, I wasn't able to create cards for a specific note type I'd renamed earlier.
After some debugging, I noticed that said type is broken in the Note Type Table too, and none of the fields are shown.
Regenerating the Note Type Table doesn't fix it and yields this error.
I noticed that, while the note type name now provided by anki is the new version, the one populating the dictionary plugin.fields_dict
was the old one, thus yielding this error.
I fixed it by manually going into .obsidian/plugins/obsidian-to-anki-plugin/data.json
, removing instances of the new name and renaming instances of the old name to the new one.
Oh, interesting! I’ll see what I can do to fix this
Have a similar issue.
As a temporary workaround you can do this - open the data.json
file located in .obsidian/plugins/obsidian-to-anki-plugin
and edit it manually, save the file, and restart obsidian.
Ran into this error... I found that I could get it to work be replacing const field_names = plugin.fields_dict[note_type];
by const field_names = await invoke('modelFieldNames', { modelName: note_type });
in main.js
. This is not an ideal fix but is one that works for the time being. Is the repo still being maintained?
In macOS, Obsidian plugin files reside within the hidden .obsidian
directory inside each vault. To navigate to this directory, you'll need to access it from the vault's root folder. Here's how you can find the .obsidian
directory:
- Open Finder on your Mac.
- Navigate to your Obsidian vault's location. If you're not sure where your vault is, you can open Obsidian, go to the vault picker (usually found at the bottom left corner), and right-click the vault name to open its folder in Finder.
- Once inside your vault's folder, you need to access the hidden
.obsidian
folder. Since macOS by default does not show hidden files and folders, you can reveal them by pressingShift + Command + .
(dot) on your keyboard. - After the hidden files become visible, you will see the
.obsidian
folder. Open it. - Inside the
.obsidian
folder, there are several subfolders. Plugin files are located in theplugins
folder.
Here's the structure you'll see:
VaultFolder/
└── .obsidian/
├── plugins/
│ ├── obsidian-to-anki-plugin/
│ │ ├── data.json
│ │ ├── main.js
│ │ ├── manifest.json
│ │ └── styles.css
│ └── another-plugin/
└── themes/
└── ...
Each plugin will have its own folder within the plugins
directory, containing all its files, including the data file (data.jason
) file, main JavaScript file (main.js
), a manifest file (manifest.json
), and often a CSS file for styles (styles.css
).
- Open data file (
data.jason
) file. - Manually type/add the missing field(s) that you have added in Anki note type but were not appearing automatically under Obsidian-to-Ankit plugin’s ‘Note Type Table’.
- Save the (
data.jason
) file by pressingCommand + S
on your keyboard. - Reopen the Obsidian application/program.
- Under Obsidian_to_Anki setting regenerate note type table.
Now you desired field(s) will surely appear in your desired note type.