X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=org-ref.org;h=b874625a3200d57284a3c1e94654ee8af78e33e4;hp=4b814f43499dfe4435fa1cf387f76ff8322feab6;hb=8e8e4ff73628902a00b8df3dbb8dea5503f66fde;hpb=09e5acadb48305e8df7969f279281014545a07bb diff --git a/org-ref.org b/org-ref.org index 4b814f4..b874625 100644 --- a/org-ref.org +++ b/org-ref.org @@ -1944,7 +1944,25 @@ We will want to generate formatting functions for each citation type. The reason ;; bibtex format (concat "\\" ,type (when desc (org-ref-format-citation-description desc)) "{" (mapconcat (lambda (key) key) (org-ref-split-and-strip-string keyword) ",") - "}")))))) + "}"))) + ;; for markdown we generate pandoc citations + ((eq format 'md) + (cond + (desc ;; pre and or post text + (let* ((text (split-string desc "::")) + (pre (car text)) + (post (cadr text))) + (concat + (format "[@%s," keyword) + (when pre (format " %s" pre)) + (when post (format ", %s" post)) + "]"))) + (t + (format "[%s]" + (mapconcat + (lambda (key) (concat "@" key)) + (org-ref-split-and-strip-string keyword) "," + "; ")))))))) #+END_SRC