mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 17:32:52 +00:00
Collect footnotes in HTML export.
All footnotes are now collected and put into a separate <div> at the end of the HTML document, but before the footer.
This commit is contained in:
parent
15b4ae9038
commit
c9cd22e861
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
* org-exp.el (org-export-as-html): Fully process link descriptions.
|
* org-exp.el (org-export-as-html): Fully process link descriptions.
|
||||||
(org-export-html-format-desc): New function.
|
(org-export-html-format-desc): New function.
|
||||||
|
(org-export-as-html): Collect footnotes into the correct basket.
|
||||||
|
|
||||||
* org-agenda.el (org-agenda-remove-marked-text): Bind variable
|
* org-agenda.el (org-agenda-remove-marked-text): Bind variable
|
||||||
BEG.
|
BEG.
|
||||||
|
|
|
@ -2779,6 +2779,7 @@ in a window. A non-interactive call will only return the buffer."
|
||||||
rtn)))
|
rtn)))
|
||||||
|
|
||||||
(defvar html-table-tag nil) ; dynamically scoped into this.
|
(defvar html-table-tag nil) ; dynamically scoped into this.
|
||||||
|
(defvar org-par-open nil)
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-export-as-html (arg &optional hidden ext-plist
|
(defun org-export-as-html (arg &optional hidden ext-plist
|
||||||
to-buffer body-only pub-dir)
|
to-buffer body-only pub-dir)
|
||||||
|
@ -2930,6 +2931,7 @@ PUB-DIR is set, use this as the publishing directory."
|
||||||
ind item-type starter didclose
|
ind item-type starter didclose
|
||||||
rpl path attr desc descp desc1 desc2 link
|
rpl path attr desc descp desc1 desc2 link
|
||||||
snumber fnc item-tag
|
snumber fnc item-tag
|
||||||
|
footnotes
|
||||||
)
|
)
|
||||||
|
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
|
@ -3445,9 +3447,9 @@ lang=\"%s\" xml:lang=\"%s\">
|
||||||
(when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line)
|
(when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line)
|
||||||
(org-close-par-maybe)
|
(org-close-par-maybe)
|
||||||
(let ((n (match-string 1 line)))
|
(let ((n (match-string 1 line)))
|
||||||
(setq line (replace-match
|
(setq org-par-open t
|
||||||
(format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line))
|
line (replace-match
|
||||||
(setq line (concat line "</p>")))))
|
(format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line)))))
|
||||||
|
|
||||||
;; Check if the line break needs to be conserved
|
;; Check if the line break needs to be conserved
|
||||||
(cond
|
(cond
|
||||||
|
@ -3476,6 +3478,16 @@ lang=\"%s\" xml:lang=\"%s\">
|
||||||
;; the </div> to close the last text-... div.
|
;; the </div> to close the last text-... div.
|
||||||
(insert "</div>\n")
|
(insert "</div>\n")
|
||||||
|
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
|
(while (re-search-forward "<p class=\"footnote\">[^\000]*?\\(</p>\\|\\'\\)" nil t)
|
||||||
|
(push (match-string 0) footnotes)
|
||||||
|
(replace-match "" t t)))
|
||||||
|
(when footnotes
|
||||||
|
(insert "<div id=\"footnotes\">\n"
|
||||||
|
(mapconcat 'identity (nreverse footnotes) "\n")
|
||||||
|
"\n</div>\n"))
|
||||||
|
|
||||||
(unless body-only
|
(unless body-only
|
||||||
(when (plist-get opt-plist :auto-postamble)
|
(when (plist-get opt-plist :auto-postamble)
|
||||||
(insert "<div id=\"postamble\">")
|
(insert "<div id=\"postamble\">")
|
||||||
|
@ -4083,7 +4095,6 @@ stacked delimiters is N. Escaping delimiters is not possible."
|
||||||
(setq s (1+ s))))
|
(setq s (1+ s))))
|
||||||
string))
|
string))
|
||||||
|
|
||||||
(defvar org-par-open nil)
|
|
||||||
(defun org-open-par ()
|
(defun org-open-par ()
|
||||||
"Insert <p>, but first close previous paragraph if any."
|
"Insert <p>, but first close previous paragraph if any."
|
||||||
(org-close-par-maybe)
|
(org-close-par-maybe)
|
||||||
|
|
Loading…
Reference in a new issue