Function: org-html-footnote-section

org-html-footnote-section is a byte-compiled function defined in ox-html.el.gz.

Signature

(org-html-footnote-section INFO)

Documentation

Format the footnote section.

INFO is a plist used as a communication channel.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-html.el.gz
(defun org-html-footnote-section (info)
  "Format the footnote section.
INFO is a plist used as a communication channel."
  (pcase (org-export-collect-footnote-definitions info)
    (`nil nil)
    (definitions
     (format
      (plist-get info :html-footnotes-section)
      (org-html--translate "Footnotes" info)
      (format
       "\n%s\n"
       (mapconcat
	(lambda (definition)
	  (pcase definition
	    (`(,n ,label ,def)
             ;; Do not assign number labels as they appear in Org mode
             ;; - the footnotes are re-numbered by
             ;; `org-export-get-footnote-number'.  If the label is not
             ;; a number, keep it.
             (when (and (stringp label)
                        (equal label (number-to-string (string-to-number label))))
               (setq label nil))
	     ;; `org-export-collect-footnote-definitions' can return
	     ;; two kinds of footnote definitions: inline and blocks.
	     ;; Since this should not make any difference in the HTML
	     ;; output, we wrap the inline definitions within
	     ;; a "footpara" class paragraph.
	     (let ((inline? (not (org-element-map def org-element-all-elements
				 #'identity nil t)))
		   (anchor (org-html--anchor
                            (format "fn.%s" (or label n))
			    n
			    (format " class=\"footnum\" href=\"#fnr.%s\" role=\"doc-backlink\"" (or label n))
			    info))
		   (contents (org-trim (org-export-data def info))))
	       (format "<div class=\"footdef\">%s %s</div>\n"
		       (format (plist-get info :html-footnote-format) anchor)
		       (format "<div class=\"footpara\" role=\"doc-footnote\">%s</div>"
			       (if (not inline?) contents
				 (format "<p class=\"footpara\">%s</p>"
					 contents))))))))
	definitions
	"\n"))))))