[ol-conlang] Add conlang-md formating for dictionary links

This commit is contained in:
Lucien Cartier-Tilet 2022-06-22 11:07:13 +02:00
parent d319a68bde
commit c4e794498e
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 10 additions and 1 deletions

View File

@ -34,7 +34,7 @@
(require 'ol)
(require 'org-element)
(defun org-link-conlang-open (path arg)
(defun org-link-conlang-open (path _arg)
"Open a conlang dictionary link.
PATH is the path to a word or a language, as a string."
(let* ((destructured-path (split-string path ":"))
@ -86,6 +86,15 @@ containing the export paramenters."
(if (not desc)
(format "@uref{%s}" generic-uri)
(format "@urif{%s, %s}" generic-uri desc)))
(`conlang-md
(format "<Dictionary lang=\"%s\" %s%s/>"
language
(if word
(format "word=\"%s\" " word)
"")
(if desc
(format "desc=\"%s\" " desc)
"")))
(_ generic-uri))))
(org-link-set-parameters "conlang"