* Allow specifying field values from org-mode properties
* Update documentation and fine-tune the diff
* Refactor, fix indentation, and other minor fixes
Renamed all-fields to named-fields since the heading and content
before first subheading can also be a field.
---------
Co-authored-by: Renat Galimov <renat@Renats-MacBook-Pro.local>
Co-authored-by: orgtre <orgtre@posteo.net>
Due to extra whitespace, the `** Back` heading in the example wasn't recognized
as an org heading. I noticed that when I copied the example from github into an
org buffer.
It is retrieved with inheritance and if set takes precedence
over the variable `anki-editor-prepend-heading`.
Also add a function to toggle it and change the behavior
of `anki-editor-toggle-format` to match it: Now every call
to the toggling functions will actually toggle the value in
effect and an entry property is only set if necessary.
It improves upon `anki-editor-delete-notes` when deleting note at
point, allowing aribtrary position in the note when calling it,
and also allowing deletion in Org. `anki-editor-delete-notes` is
removed.
Introduce the ANKI_DEFAULT_NOTE_TYPE property and custom option
`anki-editor-default-note-type` as a fallback. Note creation from
an existing org subtree (using `anki-editor-set-default-note-type`)
or from scratch (using `anki-editor-insert-default-note`) is now
slightly quicker. Also introduce `anki-editor-set-note-type`.
The inserted note can now make use of both the heading and the
content before the first subheading for fields. Also try to be
smarter about placement of point.
Like this, when exactly one field is missing and there is content
before the first (sub)heading, the heading is seen as part of that
content and one can avoid having to duplicate it there. The
content with the prepended heading will be mapped to the missing
field. Notes in Anki and Org can be made to look more similar
without always needing a separate field for the heading.