mirror of
https://github.com/larstvei/ox-gfm.git
synced 2024-11-26 09:38:31 +00:00
org-gfm-footnote-section: Cosmetics
This commit is contained in:
parent
a971997f8f
commit
4f774f13d3
23
ox-gfm.el
23
ox-gfm.el
@ -239,31 +239,20 @@ contextual information."
|
|||||||
(defun org-gfm-footnote-section (info)
|
(defun org-gfm-footnote-section (info)
|
||||||
"Format the footnote section.
|
"Format the footnote section.
|
||||||
INFO is a plist used as a communication channel."
|
INFO is a plist used as a communication channel."
|
||||||
(let* ((fn-alist (org-export-collect-footnote-definitions info))
|
(and-let* ((fn-alist (org-export-collect-footnote-definitions info)))
|
||||||
(fn-alist
|
|
||||||
(cl-loop for (n _type raw) in fn-alist collect
|
|
||||||
(cons n (org-trim (org-export-data raw info))))))
|
|
||||||
(when fn-alist
|
|
||||||
(format
|
(format
|
||||||
"## %s\n%s"
|
"## Footnotes\n\n%s\n"
|
||||||
"Footnotes"
|
(mapconcat (pcase-lambda (`(,n ,_type ,def))
|
||||||
(format
|
|
||||||
"\n%s\n"
|
|
||||||
(mapconcat
|
|
||||||
(lambda (fn)
|
|
||||||
(let ((n (car fn)) (def (cdr fn)))
|
|
||||||
(format
|
(format
|
||||||
"%s %s\n"
|
"%s %s\n"
|
||||||
(format
|
(format (plist-get info :html-footnote-format)
|
||||||
(plist-get info :html-footnote-format)
|
|
||||||
(org-html--anchor
|
(org-html--anchor
|
||||||
(format "fn.%d" n)
|
(format "fn.%d" n)
|
||||||
n
|
n
|
||||||
(format " class=\"footnum\" href=\"#fnr.%d\"" n)
|
(format " class=\"footnum\" href=\"#fnr.%d\"" n)
|
||||||
info))
|
info))
|
||||||
def)))
|
(org-trim (org-export-data def info))))
|
||||||
fn-alist
|
fn-alist "\n"))))
|
||||||
"\n"))))))
|
|
||||||
|
|
||||||
;;;; Template
|
;;;; Template
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user