Closed eyeinsky closed 1 year ago
And if you have any ideas on how to make this more ergonomic, then ideas welcome. (I.e applying a function to the field content is the most powerful way to do this, but perhaps there is something more elegant?)
I did also try to have the lambda anaphoric (how the --
-prefixed functions work in dash), but couldn't make it work. Something like this:
(customize-set-variable
'org-anki-field-templates
'(("Basic"
("Back" . (-let [path (buffer-file-name)]
(concat it (format "<p><a href='%s'>%s</a></p>" path path)))))))
Attempting to solve adding backlinks issue: https://github.com/eyeinsky/org-anki/issues/18
One can now do:
to add a backlink or any other content to the field value. (The
it
in the lambda is the original string, and the backlink html is concatenated to the end of it.)@panmengguan, @hwiorn Please test if you feel like it :)