eyeinsky / org-anki

Sync org notes to Anki via AnkiConnect
BSD 3-Clause "New" or "Revised" License
173 stars 28 forks source link

Creating cards with sub-tags #53

Open ghost opened 1 year ago

ghost commented 1 year ago

Is it possible to add cards with subtags? for example:

#+ANKI_DECK: Biology::Genetics  
#+ANKI_TAGS: Genetics::DNA_RNA

* Nucleic acids consist of {{c1::nitrogenous base, a pentose and at least one phosphate group::3}}  
:PROPERTIES:  
:ANKI_NOTE_ID: 1666361854696  
:END:  

Creates a card in the subdeck Genetics, but will add both Genetics and DNA_RNA tags, instead of 'Genetics' with subtag 'DNA_RNA'

eyeinsky commented 1 year ago

Hi -- no, this currently is not supported.

EDIT: Now see that hierarchical tags are built-in to Anki and the :: is card-coded.

~I see that hierarchical tags are supported via an add-on(?), but in an Anki app without that add-on do they appear as raw Genetics::DNA_RNA? If so, then a~ A way can be added to convert some other format to the double-colon format before they are sent to Anki. I say some other format because double-colon won't work in org-mode because colon is the tag separator, so I think we would need to invent something else for that.

ghost commented 1 year ago

Hello, First of all, you've done an amazing job with org-anki, I've recently found it and it has become my fav way to create anki cards, especially cloze type ones, fast and simple, bravo, I love it.

I haven't played with the source code, but something like

#+ANKI_TAGS: Genetics>DNA_RNA

might work? Nobody uses > in naming tags, so it won't cause any issues if it's going to be used as tag seperator.

eyeinsky commented 1 year ago

Thank you for the kind words!

As for >, I wonder if that also works for org-mode's regular tags, e.g

* Some heading        :some_parent_tag>some_subtag:

I think it would be good if the same syntax would work both as the file level property (ANKI_TAGS), but also as a regular tag.

On Sun, Oct 23, 2022 at 9:14 PM Thanos Apollo @.***> wrote:

Hello, First of all, you've done an amazing job with org-anki, I've recently found it and it has become my fav way to create anki cards, especially cloze type ones, fast and simple, bravo, I love it.

I haven't played with the source code, but something like

+ANKI_TAGS: Genetics>DNA_RNA

might work? Nobody uses > in naming tags, so it won't cause any issues if it's going to be used as tag seperator.

— Reply to this email directly, view it on GitHub https://github.com/eyeinsky/org-anki/issues/53#issuecomment-1288168396, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHHI5CGJNXSJCATSCPUYITWEV6BXANCNFSM6AAAAAARLGB3DA . You are receiving this because you commented.Message ID: @.***>

-- Markus Läll