anki-editor icon indicating copy to clipboard operation
anki-editor copied to clipboard

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

Open marzipankaiser opened this issue 3 years ago • 1 comments

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

Reasons for this change:

  • Simplifies the code greatly
  • Respects global org settings, noweb references etc, especially fixes #28.
  • Is consistent with anki-editor-export-subtree-to-html, allowing this to be used as a "preview" of the card side to be exported.

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).

marzipankaiser avatar Nov 21 '20 10:11 marzipankaiser

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.

orgtre avatar Oct 31 '22 11:10 orgtre