ObsidianToAnki / Obsidian_to_Anki

Script to add flashcards from text/markdown files to Anki
GNU General Public License v3.0
1.41k stars 125 forks source link

Add tags on per-header basis #549

Open oskarryn opened 3 months ago

oskarryn commented 3 months ago

I appreciate the options to add tags on a per-note and per-file basis, but I'm missing the per-header way. Right now, I have to repeat the same tag for each note in a section or split a file into several files and use file-level tags. Instead, it would be best to just do:

# Topic X #tagx
Q: What is A?
A: Something about A

# Topic Y #tagy
Q: What is B?
A: Something about B

and have the tags assigned to the corresponding notes automatically. Alternative implementations could be

# Topic
#tag1
Q: What is A?
A: Something about A

or

# Topic
HEADER TAGS: #tag1
Q: What is A?
A: Something about A

Additionally, it would be useful to have an option to attach a tag equal to the header implicitly, i.e.

# Topic
Q: What is A?
A: Something about A
Q: What is B?
A: Something about B

would give the notes the tag #Topic.

An extra would be adding tags for sub-headers (with inheritance from parent header).