louietan / anki-editor

Emacs minor mode for making Anki cards with Org
699 stars 87 forks source link

Use org-export-as with non-nil subtreep instead of manual substring #81

Open marzipankaiser opened 3 years ago

marzipankaiser commented 3 years ago

Change the code for exporting the content of a given card side.

Reasons for this change:

As far as I can tell, there is no reason to manually construct a substring here, as the current position is already at the correct node and the substring generated is for the current subtree anyway (Let me know if I am wrong with this assumption).

orgtre commented 1 year ago

This breaks the code allowing more flexible note types here and more work would be required to add this functionality into orgtre/anki-editor. E.g. if a note has no subheadings, with this code, the whole content of the next heading is included on the "Back" field of the note. Or if the "Back" field has a subheading, only the content of the subheading is included on the "Back" of the note.