Skip to content

Commit

Permalink
Add support for mp3 sound links on cards (#26)
Browse files Browse the repository at this point in the history
* Add support for mp3 sound links on cards

Per https://apps.ankiweb.net/docs/manual.html#importing-media the format for audio files is `[sound:myaudio.mp3]`. This allow anki-editor to export mp3 links such as `[[file:myaudio.mp3]]`in a form that they play nice with anki cards.
  • Loading branch information
alexhenning authored and louietan committed Aug 12, 2018
1 parent d5007ef commit b533c98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions anki-editor.el
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ The implementation is borrowed and simplified from ox-html."
link (plist-get info :html-inline-image-rules)))
(org-html--format-image path attributes-plist info))

;; Audio file.
((string-suffix-p ".mp3" path t)
(format "[sound:%s]" path))

;; External link with a description part.
((and path desc) (format "<a href=\"%s\"%s>%s</a>"
(org-html-encode-plain-text path)
Expand Down

0 comments on commit b533c98

Please sign in to comment.