2023-04-20 08:11:19 -04:00
|
|
|
|
;;; ox-html.el --- HTML Backend for Org Export Engine -*- lexical-binding: t; -*-
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2024-01-01 20:47:10 -05:00
|
|
|
|
;; Copyright (C) 2011-2024 Free Software Foundation, Inc.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2021-05-07 10:50:57 -04:00
|
|
|
|
;; Author: Carsten Dominik <carsten.dominik@gmail.com>
|
2013-04-18 13:32:07 -04:00
|
|
|
|
;; Jambunathan K <kjambunathan at gmail dot com>
|
2022-07-27 11:08:54 -04:00
|
|
|
|
;; Maintainer: TEC <orgmode@tec.tecosaur.net>
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, wp
|
|
|
|
|
|
Backport changes from Emacs revs 115081 and 115082
2013-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
Address some byte-compiler warnings.
* ob-abc.el (org-babel-expand-body:abc): Use dolist.
(org-babel-execute:abc): Fix regexp quoting.
* ob-calc.el (org--var-syms): Rename from `var-syms'.
* ob-lilypond.el (ly-compile-lilyfile): Remove redundant let-binding.
* ob-table.el (sbe): Move debug declaration.
* org-clock.el (org--msg-extra): Rename from `msg-extra'.
* org.el (org-version): Avoid var name starting with _.
(org-inhibit-startup, org-called-with-limited-levels)
(org-link-search-inhibit-query, org-time-was-given)
(org-end-time-was-given, org-def, org-defdecode, org-with-time):
* org-colview.el (org-agenda-overriding-columns-format):
* org-agenda.el (org-agenda-multi, org-depend-tag-blocked)
(org-agenda-show-log-scoped):
* ob-python.el (py-which-bufname, python-shell-buffer-name):
* ob-haskell.el (org-export-copy-to-kill-ring):
* ob-exp.el (org-link-search-inhibit-query):
* ob-R.el (ess-eval-visibly-p):
* ob-core.el (org-src-window-setup): Declare before use.
(org-babel-expand-noweb-references): Remove unused `blocks-in-buffer'.
* ox-odt.el (org-odt-hfy-face-to-css):
* org-src.el (org-src-associate-babel-session, org-src-get-lang-mode):
* org-bibtex.el (org-bibtex-get, org-bibtex-ask, org-bibtex)
(org-bibtex-check):
* ob-tangle.el (org-babel-tangle, org-babel-spec-to-string)
(org-babel-tangle-single-block, org-babel-tangle-comment-links):
* ob-table.el (sbe):
* ob-sqlite.el (org-babel-sqlite-expand-vars):
* ob-sql.el (org-babel-sql-expand-vars):
* ob-shen.el (org-babel-execute:shen):
* ob-sh.el (org-babel-execute:sh, org-babel-sh-evaluate):
* ob-scala.el (org-babel-scala-evaluate):
* ob-ruby.el (org-babel-ruby-table-or-string)
(org-babel-ruby-evaluate):
* ob-python.el (org-babel-python-table-or-string)
(org-babel-python-evaluate-external-process)
(org-babel-python-evaluate-session):
* ob-picolisp.el (org-babel-execute:picolisp):
* ob-perl.el (org-babel-perl-evaluate):
* ob-maxima.el (org-babel-execute:maxima):
* ob-lisp.el (org-babel-execute:lisp):
* ob-java.el (org-babel-execute:java):
* ob-io.el (org-babel-io-evaluate):
* ob-haskell.el (org-babel-execute:haskell):
* ob-fortran.el (org-babel-execute:fortran):
* ob-exp.el (org-babel-exp-code):
* ob-emacs-lisp.el (org-babel-execute:emacs-lisp):
* ob-ditaa.el (org-babel-execute:ditaa):
* ob-core.el (org-babel-execute-src-block, org-babel-sha1-hash)
(org-babel-parse-header-arguments, org-babel-reassemble-table)
(org-babel-goto-src-block-head, org-babel-mark-block)
(org-babel-expand-noweb-references, org-babel-script-escape)
(org-babel-process-file-name):
* ob-clojure.el (org-babel-execute:clojure):
* ob-calc.el (org-babel-execute:calc):
* ob-awk.el (org-babel-execute:awk):
* ob-abc.el (org-babel-execute:abc):
* ob-R.el (org-babel-expand-body:R):
* ob-C.el (org-babel-C-execute): Avoid deprecated ((lambda) ...).
2013-11-12 Glenn Morris <rgm@gnu.org>
* ox-html.el (org-html-scripts): Add 2013 to copyright years.
(org-html-infojs-template): Copyright holder to FSF.
2013-11-12 14:57:31 -05:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2013-02-23 03:56:24 -05:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
2013-02-23 03:56:24 -05:00
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 18:46:16 -04:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
2023-04-20 08:11:19 -04:00
|
|
|
|
;; This library implements a HTML backend for Org generic exporter.
|
2013-10-20 04:58:30 -04:00
|
|
|
|
;; See Org manual for more information.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;; Dependencies
|
|
|
|
|
|
2022-08-04 09:53:05 -04:00
|
|
|
|
(require 'org-macs)
|
|
|
|
|
(org-assert-version)
|
|
|
|
|
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(require 'cl-lib)
|
|
|
|
|
(require 'format-spec)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(require 'ox)
|
|
|
|
|
(require 'ox-publish)
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(require 'table)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Function Declarations
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(declare-function org-id-find-id-file "org-id" (id))
|
|
|
|
|
(declare-function htmlize-region "ext:htmlize" (beg end))
|
2013-03-15 11:10:07 -04:00
|
|
|
|
(declare-function mm-url-decode-entities "mm-url" ())
|
2022-06-16 01:10:38 -04:00
|
|
|
|
(declare-function org-at-heading-p "org" (&optional _))
|
|
|
|
|
(declare-function org-back-to-heading "org" (&optional invisible-ok))
|
|
|
|
|
(declare-function org-next-visible-heading "org" (arg))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defvar htmlize-css-name-prefix)
|
|
|
|
|
(defvar htmlize-output-type)
|
|
|
|
|
(defvar htmlize-output-type)
|
|
|
|
|
(defvar htmlize-css-name-prefix)
|
|
|
|
|
|
2023-04-20 08:11:19 -04:00
|
|
|
|
;;; Define Backend
|
2012-05-18 04:18:42 -04:00
|
|
|
|
|
2013-03-19 11:24:40 -04:00
|
|
|
|
(org-export-define-backend 'html
|
|
|
|
|
'((bold . org-html-bold)
|
|
|
|
|
(center-block . org-html-center-block)
|
|
|
|
|
(clock . org-html-clock)
|
|
|
|
|
(code . org-html-code)
|
|
|
|
|
(drawer . org-html-drawer)
|
|
|
|
|
(dynamic-block . org-html-dynamic-block)
|
|
|
|
|
(entity . org-html-entity)
|
|
|
|
|
(example-block . org-html-example-block)
|
2014-09-08 05:57:27 -04:00
|
|
|
|
(export-block . org-html-export-block)
|
2013-03-19 11:24:40 -04:00
|
|
|
|
(export-snippet . org-html-export-snippet)
|
|
|
|
|
(fixed-width . org-html-fixed-width)
|
|
|
|
|
(footnote-reference . org-html-footnote-reference)
|
|
|
|
|
(headline . org-html-headline)
|
|
|
|
|
(horizontal-rule . org-html-horizontal-rule)
|
|
|
|
|
(inline-src-block . org-html-inline-src-block)
|
|
|
|
|
(inlinetask . org-html-inlinetask)
|
|
|
|
|
(inner-template . org-html-inner-template)
|
|
|
|
|
(italic . org-html-italic)
|
|
|
|
|
(item . org-html-item)
|
|
|
|
|
(keyword . org-html-keyword)
|
|
|
|
|
(latex-environment . org-html-latex-environment)
|
|
|
|
|
(latex-fragment . org-html-latex-fragment)
|
|
|
|
|
(line-break . org-html-line-break)
|
|
|
|
|
(link . org-html-link)
|
2013-09-25 15:27:29 -04:00
|
|
|
|
(node-property . org-html-node-property)
|
2013-03-19 11:24:40 -04:00
|
|
|
|
(paragraph . org-html-paragraph)
|
|
|
|
|
(plain-list . org-html-plain-list)
|
|
|
|
|
(plain-text . org-html-plain-text)
|
|
|
|
|
(planning . org-html-planning)
|
|
|
|
|
(property-drawer . org-html-property-drawer)
|
|
|
|
|
(quote-block . org-html-quote-block)
|
|
|
|
|
(radio-target . org-html-radio-target)
|
|
|
|
|
(section . org-html-section)
|
|
|
|
|
(special-block . org-html-special-block)
|
|
|
|
|
(src-block . org-html-src-block)
|
|
|
|
|
(statistics-cookie . org-html-statistics-cookie)
|
|
|
|
|
(strike-through . org-html-strike-through)
|
|
|
|
|
(subscript . org-html-subscript)
|
|
|
|
|
(superscript . org-html-superscript)
|
|
|
|
|
(table . org-html-table)
|
|
|
|
|
(table-cell . org-html-table-cell)
|
|
|
|
|
(table-row . org-html-table-row)
|
|
|
|
|
(target . org-html-target)
|
|
|
|
|
(template . org-html-template)
|
|
|
|
|
(timestamp . org-html-timestamp)
|
|
|
|
|
(underline . org-html-underline)
|
|
|
|
|
(verbatim . org-html-verbatim)
|
|
|
|
|
(verse-block . org-html-verse-block))
|
|
|
|
|
:filters-alist '((:filter-options . org-html-infojs-install-script)
|
2016-12-17 05:36:49 -05:00
|
|
|
|
(:filter-parse-tree . org-html-image-link-filter)
|
2013-03-19 11:24:40 -04:00
|
|
|
|
(:filter-final-output . org-html-final-function))
|
2012-09-09 07:08:52 -04:00
|
|
|
|
:menu-entry
|
2013-03-19 11:24:40 -04:00
|
|
|
|
'(?h "Export to HTML"
|
|
|
|
|
((?H "As HTML buffer" org-html-export-as-html)
|
|
|
|
|
(?h "As HTML file" org-html-export-to-html)
|
|
|
|
|
(?o "As HTML file and open"
|
|
|
|
|
(lambda (a s v b)
|
|
|
|
|
(if a (org-html-export-to-html t s v b)
|
|
|
|
|
(org-open-file (org-html-export-to-html nil s v b)))))))
|
2012-07-23 08:06:13 -04:00
|
|
|
|
:options-alist
|
2014-05-21 03:06:59 -04:00
|
|
|
|
'((:html-doctype "HTML_DOCTYPE" nil org-html-doctype)
|
|
|
|
|
(:html-container "HTML_CONTAINER" nil org-html-container-element)
|
2021-02-08 17:46:51 -05:00
|
|
|
|
(:html-content-class "HTML_CONTENT_CLASS" nil org-html-content-class)
|
2015-03-13 16:38:26 -04:00
|
|
|
|
(:description "DESCRIPTION" nil nil newline)
|
|
|
|
|
(:keywords "KEYWORDS" nil nil space)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-html5-fancy nil "html5-fancy" org-html-html5-fancy)
|
|
|
|
|
(:html-link-use-abs-url nil "html-link-use-abs-url" org-html-link-use-abs-url)
|
2013-03-19 11:24:40 -04:00
|
|
|
|
(:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
|
|
|
|
|
(:html-link-up "HTML_LINK_UP" nil org-html-link-up)
|
|
|
|
|
(:html-mathjax "HTML_MATHJAX" nil "" space)
|
2020-04-20 15:49:12 -04:00
|
|
|
|
(:html-equation-reference-format "HTML_EQUATION_REFERENCE_FORMAT" nil org-html-equation-reference-format t)
|
2013-03-19 11:24:40 -04:00
|
|
|
|
(:html-postamble nil "html-postamble" org-html-postamble)
|
|
|
|
|
(:html-preamble nil "html-preamble" org-html-preamble)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-head "HTML_HEAD" nil org-html-head newline)
|
|
|
|
|
(:html-head-extra "HTML_HEAD_EXTRA" nil org-html-head-extra newline)
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
(:subtitle "SUBTITLE" nil nil parse)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-head-include-default-style
|
|
|
|
|
nil "html-style" org-html-head-include-default-style)
|
2013-06-20 15:14:57 -04:00
|
|
|
|
(:html-head-include-scripts nil "html-scripts" org-html-head-include-scripts)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-allow-name-attribute-in-anchors
|
|
|
|
|
nil nil org-html-allow-name-attribute-in-anchors)
|
|
|
|
|
(:html-divs nil nil org-html-divs)
|
2014-08-06 10:24:27 -04:00
|
|
|
|
(:html-checkbox-type nil nil org-html-checkbox-type)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-extension nil nil org-html-extension)
|
|
|
|
|
(:html-footnote-format nil nil org-html-footnote-format)
|
|
|
|
|
(:html-footnote-separator nil nil org-html-footnote-separator)
|
|
|
|
|
(:html-footnotes-section nil nil org-html-footnotes-section)
|
|
|
|
|
(:html-format-drawer-function nil nil org-html-format-drawer-function)
|
|
|
|
|
(:html-format-headline-function nil nil org-html-format-headline-function)
|
|
|
|
|
(:html-format-inlinetask-function
|
|
|
|
|
nil nil org-html-format-inlinetask-function)
|
|
|
|
|
(:html-home/up-format nil nil org-html-home/up-format)
|
|
|
|
|
(:html-indent nil nil org-html-indent)
|
|
|
|
|
(:html-infojs-options nil nil org-html-infojs-options)
|
|
|
|
|
(:html-infojs-template nil nil org-html-infojs-template)
|
|
|
|
|
(:html-inline-image-rules nil nil org-html-inline-image-rules)
|
2014-07-30 00:31:50 -04:00
|
|
|
|
(:html-link-org-files-as-html nil nil org-html-link-org-files-as-html)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-mathjax-options nil nil org-html-mathjax-options)
|
|
|
|
|
(:html-mathjax-template nil nil org-html-mathjax-template)
|
|
|
|
|
(:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format)
|
|
|
|
|
(:html-postamble-format nil nil org-html-postamble-format)
|
|
|
|
|
(:html-preamble-format nil nil org-html-preamble-format)
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(:html-prefer-user-labels nil nil org-html-prefer-user-labels)
|
2018-12-16 15:55:40 -05:00
|
|
|
|
(:html-self-link-headlines nil nil org-html-self-link-headlines)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-table-align-individual-fields
|
|
|
|
|
nil nil org-html-table-align-individual-fields)
|
|
|
|
|
(:html-table-caption-above nil nil org-html-table-caption-above)
|
|
|
|
|
(:html-table-data-tags nil nil org-html-table-data-tags)
|
|
|
|
|
(:html-table-header-tags nil nil org-html-table-header-tags)
|
|
|
|
|
(:html-table-use-header-tags-for-first-column
|
|
|
|
|
nil nil org-html-table-use-header-tags-for-first-column)
|
|
|
|
|
(:html-tag-class-prefix nil nil org-html-tag-class-prefix)
|
|
|
|
|
(:html-text-markup-alist nil nil org-html-text-markup-alist)
|
|
|
|
|
(:html-todo-kwd-class-prefix nil nil org-html-todo-kwd-class-prefix)
|
|
|
|
|
(:html-toplevel-hlevel nil nil org-html-toplevel-hlevel)
|
|
|
|
|
(:html-use-infojs nil nil org-html-use-infojs)
|
|
|
|
|
(:html-validation-link nil nil org-html-validation-link)
|
2015-04-01 09:39:28 -04:00
|
|
|
|
(:html-viewport nil nil org-html-viewport)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:html-inline-images nil nil org-html-inline-images)
|
2013-04-10 15:28:36 -04:00
|
|
|
|
(:html-table-attributes nil nil org-html-table-default-attributes)
|
2016-02-02 18:10:24 -05:00
|
|
|
|
(:html-table-row-open-tag nil nil org-html-table-row-open-tag)
|
|
|
|
|
(:html-table-row-close-tag nil nil org-html-table-row-close-tag)
|
2013-04-10 11:20:40 -04:00
|
|
|
|
(:html-xml-declaration nil nil org-html-xml-declaration)
|
2019-10-08 14:15:06 -04:00
|
|
|
|
(:html-wrap-src-lines nil nil org-html-wrap-src-lines)
|
2017-03-23 18:22:30 -04:00
|
|
|
|
(:html-klipsify-src nil nil org-html-klipsify-src)
|
|
|
|
|
(:html-klipse-css nil nil org-html-klipse-css)
|
|
|
|
|
(:html-klipse-js nil nil org-html-klipse-js)
|
|
|
|
|
(:html-klipse-selection-script nil nil org-html-klipse-selection-script)
|
2014-05-21 03:06:59 -04:00
|
|
|
|
(:infojs-opt "INFOJS_OPT" nil nil)
|
|
|
|
|
;; Redefine regular options.
|
|
|
|
|
(:creator "CREATOR" nil org-html-creator-string)
|
|
|
|
|
(:with-latex nil "tex" org-html-with-latex)
|
|
|
|
|
;; Retrieve LaTeX header for fragments.
|
|
|
|
|
(:latex-header "LATEX_HEADER" nil nil newline)))
|
2012-05-18 04:18:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Internal Variables
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defvar org-html-format-table-no-css)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(defvar htmlize-buffer-places) ; from htmlize.el
|
|
|
|
|
|
2013-03-16 15:10:53 -04:00
|
|
|
|
(defvar org-html--pre/postamble-class "status"
|
2021-09-16 06:32:43 -04:00
|
|
|
|
"CSS class used for pre/postamble.")
|
2013-03-16 15:10:53 -04:00
|
|
|
|
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(defconst org-html-doctype-alist
|
|
|
|
|
'(("html4-strict" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"
|
|
|
|
|
\"http://www.w3.org/TR/html4/strict.dtd\">")
|
|
|
|
|
("html4-transitional" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
|
|
|
|
|
\"http://www.w3.org/TR/html4/loose.dtd\">")
|
|
|
|
|
("html4-frameset" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\"
|
|
|
|
|
\"http://www.w3.org/TR/html4/frameset.dtd\">")
|
|
|
|
|
|
|
|
|
|
("xhtml-strict" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
|
|
|
|
|
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
|
|
|
|
|
("xhtml-transitional" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
|
|
|
|
|
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
|
2013-11-17 03:12:41 -05:00
|
|
|
|
("xhtml-frameset" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"
|
2013-05-02 17:07:38 -04:00
|
|
|
|
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">")
|
|
|
|
|
("xhtml-11" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"
|
2022-09-25 04:47:47 -04:00
|
|
|
|
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">")
|
2013-05-02 17:07:38 -04:00
|
|
|
|
|
|
|
|
|
("html5" . "<!DOCTYPE html>")
|
|
|
|
|
("xhtml5" . "<!DOCTYPE html>"))
|
|
|
|
|
"An alist mapping (x)html flavors to specific doctypes.")
|
|
|
|
|
|
|
|
|
|
(defconst org-html-html5-elements
|
|
|
|
|
'("article" "aside" "audio" "canvas" "details" "figcaption"
|
|
|
|
|
"figure" "footer" "header" "menu" "meter" "nav" "output"
|
2018-05-27 11:59:15 -04:00
|
|
|
|
"progress" "section" "summary" "video")
|
2013-05-02 17:07:38 -04:00
|
|
|
|
"New elements in html5.
|
|
|
|
|
|
2014-03-15 19:36:21 -04:00
|
|
|
|
For blocks that should contain headlines, use the HTML_CONTAINER
|
|
|
|
|
property on the headline itself.")
|
2013-05-02 17:07:38 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defconst org-html-special-string-regexps
|
2013-03-02 00:30:46 -05:00
|
|
|
|
'(("\\\\-" . "­") ; shy
|
|
|
|
|
("---\\([^-]\\)" . "—\\1") ; mdash
|
|
|
|
|
("--\\([^-]\\)" . "–\\1") ; ndash
|
|
|
|
|
("\\.\\.\\." . "…")) ; hellip
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Regular expressions for special string conversion.")
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2022-10-22 06:49:24 -04:00
|
|
|
|
(defvar org-html--id-attr-prefix "ID-"
|
|
|
|
|
"Prefix to use in ID attributes.
|
|
|
|
|
This affects IDs that are determined from the ID property.")
|
|
|
|
|
|
2021-04-28 02:25:28 -04:00
|
|
|
|
(defcustom org-html-scripts
|
2021-04-30 04:19:21 -04:00
|
|
|
|
"<script>
|
2021-04-26 08:23:43 -04:00
|
|
|
|
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
2020-02-11 03:45:48 -05:00
|
|
|
|
function CodeHighlightOn(elem, id)
|
|
|
|
|
{
|
|
|
|
|
var target = document.getElementById(id);
|
|
|
|
|
if(null != target) {
|
2021-05-01 05:10:17 -04:00
|
|
|
|
elem.classList.add(\"code-highlighted\");
|
|
|
|
|
target.classList.add(\"code-highlighted\");
|
2020-02-11 03:45:48 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function CodeHighlightOff(elem, id)
|
|
|
|
|
{
|
|
|
|
|
var target = document.getElementById(id);
|
2021-05-01 05:10:17 -04:00
|
|
|
|
if(null != target) {
|
|
|
|
|
elem.classList.remove(\"code-highlighted\");
|
|
|
|
|
target.classList.remove(\"code-highlighted\");
|
2021-05-08 03:37:11 -04:00
|
|
|
|
}
|
2020-02-11 03:45:48 -05:00
|
|
|
|
}
|
|
|
|
|
// @license-end
|
2012-07-24 14:48:41 -04:00
|
|
|
|
</script>"
|
2021-05-01 05:25:51 -04:00
|
|
|
|
"Basic JavaScript to allow highlighting references in code blocks."
|
2021-04-28 02:25:28 -04:00
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.5")
|
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2021-04-28 02:25:28 -04:00
|
|
|
|
(defcustom org-html-style-default
|
2024-03-25 06:53:10 -04:00
|
|
|
|
"<style type=\"text/css\">
|
2021-04-28 02:17:13 -04:00
|
|
|
|
#content { max-width: 60em; margin: auto; }
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
.title { text-align: center;
|
|
|
|
|
margin-bottom: .2em; }
|
|
|
|
|
.subtitle { text-align: center;
|
|
|
|
|
font-size: medium;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin-top:0; }
|
2013-03-05 11:06:01 -05:00
|
|
|
|
.todo { font-family: monospace; color: red; }
|
2015-01-08 22:26:43 -05:00
|
|
|
|
.done { font-family: monospace; color: green; }
|
2015-01-10 04:21:54 -05:00
|
|
|
|
.priority { font-family: monospace; color: orange; }
|
2013-03-05 11:06:01 -05:00
|
|
|
|
.tag { background-color: #eee; font-family: monospace;
|
|
|
|
|
padding: 2px; font-size: 80%; font-weight: normal; }
|
|
|
|
|
.timestamp { color: #bebebe; }
|
|
|
|
|
.timestamp-kwd { color: #5f9ea0; }
|
2015-05-06 10:08:44 -04:00
|
|
|
|
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
|
|
|
|
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
|
|
|
|
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
2013-03-12 02:41:38 -04:00
|
|
|
|
.underline { text-decoration: underline; }
|
2013-03-15 18:07:13 -04:00
|
|
|
|
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
2013-03-05 09:28:43 -05:00
|
|
|
|
p.verse { margin-left: 3%; }
|
2012-02-18 01:52:31 -05:00
|
|
|
|
pre {
|
2021-04-28 02:21:04 -04:00
|
|
|
|
border: 1px solid #e6e6e6;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
background-color: #f2f2f2;
|
2013-03-05 11:06:01 -05:00
|
|
|
|
padding: 8pt;
|
|
|
|
|
font-family: monospace;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
margin: 1.2em;
|
|
|
|
|
}
|
|
|
|
|
pre.src {
|
|
|
|
|
position: relative;
|
2020-09-04 06:41:21 -04:00
|
|
|
|
overflow: auto;
|
2013-03-05 11:06:01 -05:00
|
|
|
|
}
|
|
|
|
|
pre.src:before {
|
|
|
|
|
display: none;
|
|
|
|
|
position: absolute;
|
2021-04-28 02:21:04 -04:00
|
|
|
|
top: -8px;
|
|
|
|
|
right: 12px;
|
2013-03-05 11:06:01 -05:00
|
|
|
|
padding: 3px;
|
2021-04-28 02:21:04 -04:00
|
|
|
|
color: #555;
|
|
|
|
|
background-color: #f2f2f299;
|
2013-03-05 11:06:01 -05:00
|
|
|
|
}
|
2020-12-06 03:27:32 -05:00
|
|
|
|
pre.src:hover:before { display: inline; margin-top: 14px;}
|
2016-03-14 09:43:46 -04:00
|
|
|
|
/* Languages per Org manual */
|
|
|
|
|
pre.src-asymptote:before { content: 'Asymptote'; }
|
|
|
|
|
pre.src-awk:before { content: 'Awk'; }
|
2021-01-20 05:22:58 -05:00
|
|
|
|
pre.src-authinfo::before { content: 'Authinfo'; }
|
2016-03-14 09:43:46 -04:00
|
|
|
|
pre.src-C:before { content: 'C'; }
|
|
|
|
|
/* pre.src-C++ doesn't work in CSS */
|
|
|
|
|
pre.src-clojure:before { content: 'Clojure'; }
|
|
|
|
|
pre.src-css:before { content: 'CSS'; }
|
|
|
|
|
pre.src-D:before { content: 'D'; }
|
|
|
|
|
pre.src-ditaa:before { content: 'ditaa'; }
|
|
|
|
|
pre.src-dot:before { content: 'Graphviz'; }
|
|
|
|
|
pre.src-calc:before { content: 'Emacs Calc'; }
|
2013-03-05 11:06:01 -05:00
|
|
|
|
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
2016-03-14 09:43:46 -04:00
|
|
|
|
pre.src-fortran:before { content: 'Fortran'; }
|
|
|
|
|
pre.src-gnuplot:before { content: 'gnuplot'; }
|
|
|
|
|
pre.src-haskell:before { content: 'Haskell'; }
|
2017-02-23 20:55:02 -05:00
|
|
|
|
pre.src-hledger:before { content: 'hledger'; }
|
2016-03-14 09:43:46 -04:00
|
|
|
|
pre.src-java:before { content: 'Java'; }
|
|
|
|
|
pre.src-js:before { content: 'Javascript'; }
|
|
|
|
|
pre.src-latex:before { content: 'LaTeX'; }
|
|
|
|
|
pre.src-ledger:before { content: 'Ledger'; }
|
|
|
|
|
pre.src-lisp:before { content: 'Lisp'; }
|
|
|
|
|
pre.src-lilypond:before { content: 'Lilypond'; }
|
2016-08-29 03:03:27 -04:00
|
|
|
|
pre.src-lua:before { content: 'Lua'; }
|
2016-03-14 09:43:46 -04:00
|
|
|
|
pre.src-matlab:before { content: 'MATLAB'; }
|
|
|
|
|
pre.src-mscgen:before { content: 'Mscgen'; }
|
|
|
|
|
pre.src-ocaml:before { content: 'Objective Caml'; }
|
|
|
|
|
pre.src-octave:before { content: 'Octave'; }
|
|
|
|
|
pre.src-org:before { content: 'Org mode'; }
|
|
|
|
|
pre.src-oz:before { content: 'OZ'; }
|
|
|
|
|
pre.src-plantuml:before { content: 'Plantuml'; }
|
|
|
|
|
pre.src-processing:before { content: 'Processing.js'; }
|
|
|
|
|
pre.src-python:before { content: 'Python'; }
|
|
|
|
|
pre.src-R:before { content: 'R'; }
|
|
|
|
|
pre.src-ruby:before { content: 'Ruby'; }
|
|
|
|
|
pre.src-sass:before { content: 'Sass'; }
|
|
|
|
|
pre.src-scheme:before { content: 'Scheme'; }
|
|
|
|
|
pre.src-screen:before { content: 'Gnu Screen'; }
|
|
|
|
|
pre.src-sed:before { content: 'Sed'; }
|
|
|
|
|
pre.src-sh:before { content: 'shell'; }
|
|
|
|
|
pre.src-sql:before { content: 'SQL'; }
|
|
|
|
|
pre.src-sqlite:before { content: 'SQLite'; }
|
|
|
|
|
/* additional languages in org.el's org-babel-load-languages alist */
|
|
|
|
|
pre.src-forth:before { content: 'Forth'; }
|
|
|
|
|
pre.src-io:before { content: 'IO'; }
|
|
|
|
|
pre.src-J:before { content: 'J'; }
|
|
|
|
|
pre.src-makefile:before { content: 'Makefile'; }
|
|
|
|
|
pre.src-maxima:before { content: 'Maxima'; }
|
|
|
|
|
pre.src-perl:before { content: 'Perl'; }
|
|
|
|
|
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
|
|
|
|
pre.src-scala:before { content: 'Scala'; }
|
|
|
|
|
pre.src-shell:before { content: 'Shell Script'; }
|
|
|
|
|
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
|
|
|
|
/* additional language identifiers per \"defun org-babel-execute\"
|
|
|
|
|
in ob-*.el */
|
|
|
|
|
pre.src-cpp:before { content: 'C++'; }
|
|
|
|
|
pre.src-abc:before { content: 'ABC'; }
|
|
|
|
|
pre.src-coq:before { content: 'Coq'; }
|
|
|
|
|
pre.src-groovy:before { content: 'Groovy'; }
|
|
|
|
|
/* additional language identifiers from org-babel-shell-names in
|
|
|
|
|
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
|
|
|
|
the execution function name together. */
|
|
|
|
|
pre.src-bash:before { content: 'bash'; }
|
|
|
|
|
pre.src-csh:before { content: 'csh'; }
|
|
|
|
|
pre.src-ash:before { content: 'ash'; }
|
|
|
|
|
pre.src-dash:before { content: 'dash'; }
|
|
|
|
|
pre.src-ksh:before { content: 'ksh'; }
|
|
|
|
|
pre.src-mksh:before { content: 'mksh'; }
|
|
|
|
|
pre.src-posh:before { content: 'posh'; }
|
|
|
|
|
/* Additional Emacs modes also supported by the LaTeX listings package */
|
|
|
|
|
pre.src-ada:before { content: 'Ada'; }
|
|
|
|
|
pre.src-asm:before { content: 'Assembler'; }
|
|
|
|
|
pre.src-caml:before { content: 'Caml'; }
|
|
|
|
|
pre.src-delphi:before { content: 'Delphi'; }
|
|
|
|
|
pre.src-html:before { content: 'HTML'; }
|
|
|
|
|
pre.src-idl:before { content: 'IDL'; }
|
|
|
|
|
pre.src-mercury:before { content: 'Mercury'; }
|
|
|
|
|
pre.src-metapost:before { content: 'MetaPost'; }
|
|
|
|
|
pre.src-modula-2:before { content: 'Modula-2'; }
|
|
|
|
|
pre.src-pascal:before { content: 'Pascal'; }
|
|
|
|
|
pre.src-ps:before { content: 'PostScript'; }
|
|
|
|
|
pre.src-prolog:before { content: 'Prolog'; }
|
|
|
|
|
pre.src-simula:before { content: 'Simula'; }
|
|
|
|
|
pre.src-tcl:before { content: 'tcl'; }
|
|
|
|
|
pre.src-tex:before { content: 'TeX'; }
|
|
|
|
|
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
|
|
|
|
pre.src-verilog:before { content: 'Verilog'; }
|
|
|
|
|
pre.src-vhdl:before { content: 'VHDL'; }
|
|
|
|
|
pre.src-xml:before { content: 'XML'; }
|
|
|
|
|
pre.src-nxml:before { content: 'XML'; }
|
|
|
|
|
/* add a generic configuration mode; LaTeX export needs an additional
|
|
|
|
|
(add-to-list 'org-latex-listings-langs '(conf \" \")) in .emacs */
|
|
|
|
|
pre.src-conf:before { content: 'Configuration File'; }
|
2013-03-05 11:06:01 -05:00
|
|
|
|
|
2013-03-05 09:28:43 -05:00
|
|
|
|
table { border-collapse:collapse; }
|
2013-12-28 17:33:59 -05:00
|
|
|
|
caption.t-above { caption-side: top; }
|
|
|
|
|
caption.t-bottom { caption-side: bottom; }
|
2013-03-05 09:28:43 -05:00
|
|
|
|
td, th { vertical-align:top; }
|
2015-05-06 10:08:44 -04:00
|
|
|
|
th.org-right { text-align: center; }
|
|
|
|
|
th.org-left { text-align: center; }
|
|
|
|
|
th.org-center { text-align: center; }
|
|
|
|
|
td.org-right { text-align: right; }
|
|
|
|
|
td.org-left { text-align: left; }
|
|
|
|
|
td.org-center { text-align: center; }
|
2012-02-18 01:52:31 -05:00
|
|
|
|
dt { font-weight: bold; }
|
2015-07-13 05:10:57 -04:00
|
|
|
|
.footpara { display: inline; }
|
2013-03-12 10:17:15 -04:00
|
|
|
|
.footdef { margin-bottom: 1em; }
|
2013-03-12 02:41:38 -04:00
|
|
|
|
.figure { padding: 1em; }
|
|
|
|
|
.figure p { text-align: center; }
|
2018-01-07 04:04:39 -05:00
|
|
|
|
.equation-container {
|
|
|
|
|
display: table;
|
|
|
|
|
text-align: center;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
.equation {
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
|
|
|
|
.equation-label {
|
|
|
|
|
display: table-cell;
|
|
|
|
|
text-align: right;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
2013-03-12 02:41:38 -04:00
|
|
|
|
.inlinetask {
|
|
|
|
|
padding: 10px;
|
|
|
|
|
border: 2px solid gray;
|
|
|
|
|
margin: 10px;
|
2012-02-18 01:52:31 -05:00
|
|
|
|
background: #ffffcc;
|
|
|
|
|
}
|
2013-03-12 02:41:38 -04:00
|
|
|
|
#org-div-home-and-up
|
|
|
|
|
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
2013-03-12 10:17:15 -04:00
|
|
|
|
textarea { overflow-x: auto; }
|
|
|
|
|
.linenr { font-size: smaller }
|
|
|
|
|
.code-highlighted { background-color: #ffff00; }
|
|
|
|
|
.org-info-js_info-navigation { border-style: none; }
|
2013-03-05 09:28:43 -05:00
|
|
|
|
#org-info-js_console-label
|
2013-03-12 10:17:15 -04:00
|
|
|
|
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
2013-03-05 09:28:43 -05:00
|
|
|
|
.org-info-js_search-highlight
|
2013-03-12 10:17:15 -04:00
|
|
|
|
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
2022-03-28 08:34:11 -04:00
|
|
|
|
.org-svg { }
|
2012-02-18 01:52:31 -05:00
|
|
|
|
</style>"
|
|
|
|
|
"The default style specification for exported HTML files.
|
2013-03-02 12:05:16 -05:00
|
|
|
|
You can use `org-html-head' and `org-html-head-extra' to add to
|
|
|
|
|
this style. If you don't want to include this default style,
|
2021-04-28 02:25:28 -04:00
|
|
|
|
customize `org-html-head-include-default-style'."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.5")
|
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
|
|
|
|
;;; User Configuration Variables
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defgroup org-export-html nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Options for exporting Org mode files to HTML."
|
|
|
|
|
:tag "Org Export HTML"
|
|
|
|
|
:group 'org-export)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-01 08:26:55 -05:00
|
|
|
|
;;;; Handle infojs
|
|
|
|
|
|
|
|
|
|
(defvar org-html-infojs-opts-table
|
2018-01-16 11:22:00 -05:00
|
|
|
|
'((path PATH "https://orgmode.org/org-info.js")
|
2013-03-01 08:26:55 -05:00
|
|
|
|
(view VIEW "info")
|
|
|
|
|
(toc TOC :with-toc)
|
|
|
|
|
(ftoc FIXED_TOC "0")
|
|
|
|
|
(tdepth TOC_DEPTH "max")
|
|
|
|
|
(sdepth SECTION_DEPTH "max")
|
|
|
|
|
(mouse MOUSE_HINT "underline")
|
|
|
|
|
(buttons VIEW_BUTTONS "0")
|
|
|
|
|
(ltoc LOCAL_TOC "1")
|
|
|
|
|
(up LINK_UP :html-link-up)
|
|
|
|
|
(home LINK_HOME :html-link-home))
|
|
|
|
|
"JavaScript options, long form for script, default values.")
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-use-infojs 'when-configured
|
|
|
|
|
"Non-nil when Sebastian Rose's Java Script org-info.js should be active.
|
|
|
|
|
This option can be nil or t to never or always use the script.
|
|
|
|
|
It can also be the symbol `when-configured', meaning that the
|
|
|
|
|
script will be linked into the export file if and only if there
|
|
|
|
|
is a \"#+INFOJS_OPT:\" line in the buffer. See also the variable
|
|
|
|
|
`org-html-infojs-options'."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Never" nil)
|
|
|
|
|
(const :tag "When configured in buffer" when-configured)
|
|
|
|
|
(const :tag "Always" t)))
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-infojs-options
|
|
|
|
|
(mapcar (lambda (x) (cons (car x) (nth 2 x))) org-html-infojs-opts-table)
|
|
|
|
|
"Options settings for the INFOJS JavaScript.
|
|
|
|
|
Each of the options must have an entry in `org-html-infojs-opts-table'.
|
|
|
|
|
The value can either be a string that will be passed to the script, or
|
|
|
|
|
a property. This property is then assumed to be a property that is defined
|
|
|
|
|
by the Export/Publishing setup of Org.
|
|
|
|
|
The `sdepth' and `tdepth' parameters can also be set to \"max\", which
|
|
|
|
|
means to use the maximum value consistent with other options."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type
|
|
|
|
|
`(set :greedy t :inline t
|
|
|
|
|
,@(mapcar
|
|
|
|
|
(lambda (x)
|
|
|
|
|
(list 'cons (list 'const (car x))
|
|
|
|
|
'(choice
|
|
|
|
|
(symbol :tag "Publishing/Export property")
|
|
|
|
|
(string :tag "Value"))))
|
|
|
|
|
org-html-infojs-opts-table)))
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-infojs-template
|
2021-04-30 04:19:21 -04:00
|
|
|
|
"<script src=\"%SCRIPT_PATH\">
|
2020-03-15 18:42:19 -04:00
|
|
|
|
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
2020-02-11 03:45:48 -05:00
|
|
|
|
// @license-end
|
2013-03-01 08:26:55 -05:00
|
|
|
|
</script>
|
|
|
|
|
|
2021-04-30 04:19:21 -04:00
|
|
|
|
<script>
|
2020-03-15 18:42:19 -04:00
|
|
|
|
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
2013-03-01 08:26:55 -05:00
|
|
|
|
%MANAGER_OPTIONS
|
|
|
|
|
org_html_manager.setup(); // activate after the parameters are set
|
2020-02-11 03:45:48 -05:00
|
|
|
|
// @license-end
|
2013-03-01 08:26:55 -05:00
|
|
|
|
</script>"
|
|
|
|
|
"The template for the export style additions when org-info.js is used.
|
|
|
|
|
Option settings will replace the %MANAGER-OPTIONS cookie."
|
|
|
|
|
:group 'org-export-html
|
2020-03-15 22:07:52 -04:00
|
|
|
|
:package-version '(Org . "9.4")
|
2013-03-01 08:26:55 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-infojs-install-script (exp-plist _backend)
|
2013-03-01 08:26:55 -05:00
|
|
|
|
"Install script in export options when appropriate.
|
|
|
|
|
EXP-PLIST is a plist containing export options. BACKEND is the
|
2023-04-20 08:11:19 -04:00
|
|
|
|
export backend currently used."
|
2013-03-04 06:16:37 -05:00
|
|
|
|
(unless (or (memq 'body-only (plist-get exp-plist :export-options))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(not (plist-get exp-plist :html-use-infojs))
|
|
|
|
|
(and (eq (plist-get exp-plist :html-use-infojs) 'when-configured)
|
|
|
|
|
(let ((opt (plist-get exp-plist :infojs-opt)))
|
|
|
|
|
(or (not opt)
|
|
|
|
|
(string= "" opt)
|
|
|
|
|
(string-match "\\<view:nil\\>" opt)))))
|
|
|
|
|
(let* ((template (plist-get exp-plist :html-infojs-template))
|
2013-03-01 08:26:55 -05:00
|
|
|
|
(ptoc (plist-get exp-plist :with-toc))
|
|
|
|
|
(hlevels (plist-get exp-plist :headline-levels))
|
|
|
|
|
(sdepth hlevels)
|
|
|
|
|
(tdepth (if (integerp ptoc) (min ptoc hlevels) hlevels))
|
|
|
|
|
(options (plist-get exp-plist :infojs-opt))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(infojs-opt (plist-get exp-plist :html-infojs-options))
|
2013-03-01 08:26:55 -05:00
|
|
|
|
(table org-html-infojs-opts-table)
|
|
|
|
|
style)
|
|
|
|
|
(dolist (entry table)
|
|
|
|
|
(let* ((opt (car entry))
|
|
|
|
|
(var (nth 1 entry))
|
|
|
|
|
;; Compute default values for script option OPT from
|
|
|
|
|
;; `org-html-infojs-options' variable.
|
|
|
|
|
(default
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((default (cdr (assq opt infojs-opt))))
|
2013-03-01 08:26:55 -05:00
|
|
|
|
(if (and (symbolp default) (not (memq default '(t nil))))
|
|
|
|
|
(plist-get exp-plist default)
|
|
|
|
|
default)))
|
|
|
|
|
;; Value set through INFOJS_OPT keyword has precedence
|
|
|
|
|
;; over the default one.
|
|
|
|
|
(val (if (and options
|
|
|
|
|
(string-match (format "\\<%s:\\(\\S-+\\)" opt)
|
|
|
|
|
options))
|
|
|
|
|
(match-string 1 options)
|
|
|
|
|
default)))
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(pcase opt
|
|
|
|
|
(`path (setq template
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"%SCRIPT_PATH" val template t t)))
|
|
|
|
|
(`sdepth (when (integerp (read val))
|
|
|
|
|
(setq sdepth (min (read val) sdepth))))
|
|
|
|
|
(`tdepth (when (integerp (read val))
|
|
|
|
|
(setq tdepth (min (read val) tdepth))))
|
|
|
|
|
(_ (setq val
|
|
|
|
|
(cond
|
|
|
|
|
((or (eq val t) (equal val "t")) "1")
|
|
|
|
|
((or (eq val nil) (equal val "nil")) "0")
|
|
|
|
|
((stringp val) val)
|
|
|
|
|
(t (format "%s" val))))
|
|
|
|
|
(push (cons var val) style)))))
|
2013-03-01 08:26:55 -05:00
|
|
|
|
;; Now we set the depth of the *generated* TOC to SDEPTH,
|
|
|
|
|
;; because the toc will actually determine the splitting. How
|
|
|
|
|
;; much of the toc will actually be displayed is governed by the
|
|
|
|
|
;; TDEPTH option.
|
|
|
|
|
(setq exp-plist (plist-put exp-plist :with-toc sdepth))
|
|
|
|
|
;; The table of contents should not show more sections than we
|
|
|
|
|
;; generate.
|
|
|
|
|
(setq tdepth (min tdepth sdepth))
|
|
|
|
|
(push (cons "TOC_DEPTH" tdepth) style)
|
|
|
|
|
;; Build style string.
|
|
|
|
|
(setq style (mapconcat
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(lambda (x)
|
|
|
|
|
(format "org_html_manager.set(\"%s\", \"%s\");"
|
|
|
|
|
(car x) (cdr x)))
|
2013-03-01 08:26:55 -05:00
|
|
|
|
style "\n"))
|
|
|
|
|
(when (and style (> (length style) 0))
|
|
|
|
|
(and (string-match "%MANAGER_OPTIONS" template)
|
|
|
|
|
(setq style (replace-match style t t template))
|
|
|
|
|
(setq exp-plist
|
|
|
|
|
(plist-put
|
2013-03-02 12:05:16 -05:00
|
|
|
|
exp-plist :html-head-extra
|
|
|
|
|
(concat (or (plist-get exp-plist :html-head-extra) "")
|
2013-03-01 08:26:55 -05:00
|
|
|
|
"\n"
|
|
|
|
|
style)))))
|
|
|
|
|
;; This script absolutely needs the table of contents, so we
|
|
|
|
|
;; change that setting.
|
|
|
|
|
(unless (plist-get exp-plist :with-toc)
|
|
|
|
|
(setq exp-plist (plist-put exp-plist :with-toc t)))
|
|
|
|
|
;; Return the modified property list.
|
|
|
|
|
exp-plist)))
|
|
|
|
|
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
;;;; Bold, etc.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-text-markup-alist
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'((bold . "<b>%s</b>")
|
|
|
|
|
(code . "<code>%s</code>")
|
|
|
|
|
(italic . "<i>%s</i>")
|
|
|
|
|
(strike-through . "<del>%s</del>")
|
2013-03-12 02:41:38 -04:00
|
|
|
|
(underline . "<span class=\"underline\">%s</span>")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
(verbatim . "<code>%s</code>"))
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
"Alist of HTML expressions to convert text markup.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The key must be a symbol among `bold', `code', `italic',
|
|
|
|
|
`strike-through', `underline' and `verbatim'. The value is
|
|
|
|
|
a formatting string to wrap fontified text with.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
If no association can be found for a given markup, text will be
|
|
|
|
|
returned as-is."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-11-12 15:24:32 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(alist :key-type (symbol :tag "Markup type")
|
|
|
|
|
:value-type (string :tag "Format string"))
|
|
|
|
|
:options '(bold code italic strike-through underline verbatim))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-21 09:25:18 -04:00
|
|
|
|
(defcustom org-html-indent nil
|
|
|
|
|
"Non-nil means to indent the generated HTML.
|
|
|
|
|
Warning: non-nil may break indentation of source code blocks."
|
2013-03-15 10:02:18 -04:00
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Drawers
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defcustom org-html-format-drawer-function (lambda (_name contents) contents)
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Function called to format a drawer in HTML code.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The function must accept two parameters:
|
|
|
|
|
NAME the drawer name, like \"LOGBOOK\"
|
|
|
|
|
CONTENTS the contents of the drawer.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The function should return the string to be exported.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-11-14 08:05:18 -05:00
|
|
|
|
The default value simply returns the value of CONTENTS."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-11-13 02:46:01 -05:00
|
|
|
|
:version "24.4"
|
2013-11-13 01:27:10 -05:00
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'function)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Footnotes
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-footnotes-section "<div id=\"footnotes\">
|
2012-07-24 14:48:41 -04:00
|
|
|
|
<h2 class=\"footnotes\">%s: </h2>
|
|
|
|
|
<div id=\"text-footnotes\">
|
|
|
|
|
%s
|
|
|
|
|
</div>
|
|
|
|
|
</div>"
|
|
|
|
|
"Format for the footnotes section.
|
|
|
|
|
Should contain a two instances of %s. The first will be replaced with the
|
|
|
|
|
language-specific word for \"Footnotes\", the second one will be replaced
|
|
|
|
|
by the footnotes themselves."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-footnote-format "<sup>%s</sup>"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The format for the footnote reference.
|
|
|
|
|
%s will be replaced by the footnote reference itself."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-05-27 07:23:58 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-footnote-separator "<sup>, </sup>"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Text used to separate footnotes."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-05-27 07:23:58 -04:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Headline
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-toplevel-hlevel 2
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The <H> level for level 1 headings in HTML export.
|
|
|
|
|
This is also important for the classes that will be wrapped around headlines
|
|
|
|
|
and outline structure. If this variable is 1, the top-level headlines will
|
|
|
|
|
be <h1>, and the corresponding classes will be outline-1, section-number-1,
|
|
|
|
|
and outline-text-1. If this is 2, all of these will get a 2 instead.
|
|
|
|
|
The default for this variable is 2, because we use <h1> for formatting the
|
|
|
|
|
document title."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-09-25 16:17:54 -04:00
|
|
|
|
:type 'integer)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defcustom org-html-format-headline-function
|
|
|
|
|
'org-html-format-headline-default-function
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Function to format headline text.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
This function will be called with six arguments:
|
2012-07-24 14:48:41 -04:00
|
|
|
|
TODO the todo keyword (string or nil).
|
|
|
|
|
TODO-TYPE the type of todo (symbol: `todo', `done', nil)
|
|
|
|
|
PRIORITY the priority of the headline (integer or nil)
|
|
|
|
|
TEXT the main headline text (string).
|
|
|
|
|
TAGS the tags (string or nil).
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
INFO the export options (plist).
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-24 04:01:39 -05:00
|
|
|
|
The function result will be used in the section format string."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2017-01-25 23:39:18 -05:00
|
|
|
|
:version "26.1"
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
:package-version '(Org . "8.3")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'function)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; HTML-specific
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2014-01-09 18:00:52 -05:00
|
|
|
|
(defcustom org-html-allow-name-attribute-in-anchors nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"When nil, do not set \"name\" attribute in anchors.
|
2014-01-10 04:07:22 -05:00
|
|
|
|
By default, when appropriate, anchors are formatted with \"id\"
|
|
|
|
|
but without \"name\" attribute."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
Add :version and :package-version
* ox.el (org-export-snippet-translation-alist)
(org-export-coding-system, org-export-in-background)
(org-export-async-init-file, org-export-invisible-backends)
(org-export-dispatch-use-expert-ui):
* ox-texinfo.el (org-texinfo-filename, org-texinfo-classes)
(org-texinfo-format-headline-function)
(org-texinfo-node-description-column)
(org-texinfo-active-timestamp-format)
(org-texinfo-link-with-unknown-path-format)
(org-texinfo-tables-verbatim)
(org-texinfo-table-scientific-notation)
(org-texinfo-text-markup-alist)
(org-texinfo-format-drawer-function)
(org-texinfo-format-inlinetask-function)
(org-texinfo-info-process):
* ox-man.el (org-man-tables-centered)
(org-man-table-scientific-notation)
(org-man-source-highlight, org-man-source-highlight-langs)
(org-man-pdf-process, org-man-logfiles-extensions):
* ox-html.el (org-html-allow-name-attribute-in-anchors)
(org-html-coding-system, org-html-divs):
* ox-ascii.el (org-ascii-text-width)
(org-ascii-headline-spacing, org-ascii-indented-line-width)
(org-ascii-paragraph-spacing, org-ascii-charset)
(org-ascii-underline, org-ascii-bullets)
(org-ascii-links-to-notes)
(org-ascii-table-keep-all-vertical-lines)
(org-ascii-table-widen-columns)
(org-ascii-table-use-ascii-art)
(org-ascii-format-drawer-function)
(org-ascii-format-inlinetask-function):
* org.el (org-modules, org-export-backends)
(org-highlight-latex-and-related, orgstruct-setup-hook):
* org-attach.el (org-attach-git-annex-cutoff):
* org-archive.el (org-archive-file-header-format):
* org-agenda.el (org-agenda-todo-ignore-time-comparison-use-seconds):
* ob-python.el (org-babel-python-hline-to)
(org-babel-python-None-to):
* ob-ditaa.el (org-ditaa-eps-jar-path):
* ob-core.el (org-babel-results-keyword): Add :version and
:package-version.
* ox-ascii.el: Use utf-8-emacs as the file coding system.
2013-03-05 10:34:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2018-12-16 15:55:40 -05:00
|
|
|
|
(defcustom org-html-self-link-headlines nil
|
|
|
|
|
"When non-nil, the headlines contain a hyperlink to themselves."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.3")
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:safe #'booleanp)
|
|
|
|
|
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(defcustom org-html-prefer-user-labels nil
|
|
|
|
|
"When non-nil use user-defined names and ID over internal ones.
|
|
|
|
|
|
|
|
|
|
By default, Org generates its own internal ID values during HTML
|
|
|
|
|
export. This process ensures that these values are unique and
|
|
|
|
|
valid, but the keys are not available in advance of the export
|
|
|
|
|
process, and not so readable.
|
|
|
|
|
|
|
|
|
|
When this variable is non-nil, Org will use NAME keyword, or the
|
|
|
|
|
real name of the target to create the ID attribute.
|
|
|
|
|
|
|
|
|
|
Independently of this variable, however, CUSTOM_ID are always
|
|
|
|
|
used as a reference."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.4")
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:safe #'booleanp)
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Inlinetasks
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defcustom org-html-format-inlinetask-function
|
|
|
|
|
'org-html-format-inlinetask-default-function
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Function called to format an inlinetask in HTML code.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
The function must accept seven parameters:
|
2012-07-24 14:48:41 -04:00
|
|
|
|
TODO the todo keyword, as a string
|
|
|
|
|
TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
|
|
|
|
|
PRIORITY the inlinetask priority, as a string
|
|
|
|
|
NAME the inlinetask name, as a string.
|
|
|
|
|
TAGS the inlinetask tags, as a list of strings.
|
|
|
|
|
CONTENTS the contents of the inlinetask, as a string.
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
INFO the export options, as a plist
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-03-01 07:57:54 -05:00
|
|
|
|
The function should return the string to be exported."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2017-01-25 23:39:18 -05:00
|
|
|
|
:version "26.1"
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
:package-version '(Org . "8.3")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'function)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;;;; LaTeX
|
|
|
|
|
|
2020-04-20 15:49:12 -04:00
|
|
|
|
(defcustom org-html-equation-reference-format "\\eqref{%s}"
|
|
|
|
|
"The MathJax command to use when referencing equations.
|
|
|
|
|
|
|
|
|
|
This is a format control string that expects a single string argument
|
2021-09-16 06:32:43 -04:00
|
|
|
|
specifying the label that is being referenced. The argument is
|
2020-04-20 15:49:12 -04:00
|
|
|
|
generated automatically on export.
|
|
|
|
|
|
|
|
|
|
The default is to wrap equations in parentheses (using \"\\eqref{%s}\)\".
|
|
|
|
|
|
|
|
|
|
Most common values are:
|
|
|
|
|
|
|
|
|
|
\\eqref{%s} Wrap the equation in parentheses
|
|
|
|
|
\\ref{%s} Do not wrap the equation in parentheses"
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.4")
|
|
|
|
|
:type 'string
|
2021-10-02 13:37:42 -04:00
|
|
|
|
:safe #'stringp)
|
2020-04-20 15:49:12 -04:00
|
|
|
|
|
2013-11-15 00:22:36 -05:00
|
|
|
|
(defcustom org-html-with-latex org-export-with-latex
|
2013-01-27 17:11:34 -05:00
|
|
|
|
"Non-nil means process LaTeX math snippets.
|
|
|
|
|
|
|
|
|
|
When set, the exporter will process LaTeX environments and
|
|
|
|
|
fragments.
|
|
|
|
|
|
|
|
|
|
This option can also be set with the +OPTIONS line,
|
|
|
|
|
e.g. \"tex:mathjax\". Allowed values are:
|
|
|
|
|
|
2016-05-19 10:01:24 -04:00
|
|
|
|
nil Ignore math snippets.
|
|
|
|
|
`verbatim' Keep everything in verbatim
|
|
|
|
|
`mathjax', t Do MathJax preprocessing and arrange for MathJax.js to
|
|
|
|
|
be loaded.
|
2020-02-16 19:52:02 -05:00
|
|
|
|
`html' Use `org-latex-to-html-convert-command' to convert
|
|
|
|
|
LaTeX fragments to HTML.
|
2016-05-19 10:01:24 -04:00
|
|
|
|
SYMBOL Any symbol defined in `org-preview-latex-process-alist',
|
|
|
|
|
e.g., `dvipng'."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
Export framework: Add :version and :package-version informations to defcustoms
* lisp/ox-beamer.el (org-beamer-column-view-format, org-beamer-theme,
org-beamer-environments-extra): Add :version and :package-version.
* lisp/ox-html.el (org-html-with-latex, org-html-inline-image-rules):
Add :version and :package-version.
* lisp/ox-latex.el (org-latex-inline-image-rules,
org-latex-default-table-environment, org-latex-default-table-mode,
org-latex-tables-booktabs, org-latex-table-scientific-notation,
org-latex-known-errors): Add :version and :package-version.
* lisp/ox-md.el (org-md-headline-style): Add :version
and :package-version.
* lisp/ox-odt.el (org-odt-with-latex): Add :version
and :package-version.
* lisp/ox.el (org-export-with-drawers, org-export-with-latex,
org-export-with-inlinetasks, org-export-with-planning,
org-export-with-smart-quotes, org-export-with-statistics-cookies,
org-export-allow-bind-keywords, org-export-async-init-file):
Add :version and :package-version.
2013-03-06 08:45:12 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Do not process math in any way" nil)
|
2016-05-19 10:01:24 -04:00
|
|
|
|
(const :tag "Leave math verbatim" verbatim)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(const :tag "Use MathJax to display math" mathjax)
|
2016-05-19 10:01:24 -04:00
|
|
|
|
(symbol :tag "Convert to image to display math" :value dvipng)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Links :: Generic
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-link-org-files-as-html t
|
2021-05-15 10:45:23 -04:00
|
|
|
|
"Non-nil means make file links to \"file.org\" point to \"file.html\".
|
|
|
|
|
|
|
|
|
|
When Org mode is exporting an Org file to HTML, links to non-HTML files
|
|
|
|
|
are directly put into a \"href\" tag in HTML. However, links to other Org files
|
2023-11-02 04:22:23 -04:00
|
|
|
|
\(recognized by the extension \".org\") should become links to the corresponding
|
2021-05-15 10:45:23 -04:00
|
|
|
|
HTML file, assuming that the linked Org file will also be converted to HTML.
|
|
|
|
|
|
2022-09-05 07:40:13 -04:00
|
|
|
|
Links to \"file.org.gpg\" are also converted.
|
|
|
|
|
|
2016-08-23 16:13:56 -04:00
|
|
|
|
When nil, the links still point to the plain \".org\" file."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Links :: Inline images
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(defcustom org-html-inline-images t
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Non-nil means inline images into exported HTML pages.
|
|
|
|
|
This is done using an <img> tag. When nil, an anchor with href is used to
|
2013-07-01 16:51:26 -04:00
|
|
|
|
link to the image."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-07-01 16:51:26 -04:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.1")
|
|
|
|
|
:type 'boolean)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-inline-image-rules
|
2024-03-26 17:19:47 -04:00
|
|
|
|
`(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp" ".avif")))
|
|
|
|
|
("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp" ".avif")))
|
|
|
|
|
("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp" ".avif"))))
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Rules characterizing image files that can be inlined into HTML.
|
|
|
|
|
A rule consists in an association whose key is the type of link
|
|
|
|
|
to consider, and value is a regexp that will be matched against
|
2013-04-10 13:19:21 -04:00
|
|
|
|
link's path."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2024-03-26 17:19:47 -04:00
|
|
|
|
:package-version '(Org . "9.7")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(alist :key-type (string :tag "Type")
|
|
|
|
|
:value-type (regexp :tag "Path")))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Plain Text
|
|
|
|
|
|
2014-07-27 13:55:49 -04:00
|
|
|
|
(defvar org-html-protect-char-alist
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("&" . "&")
|
|
|
|
|
("<" . "<")
|
|
|
|
|
(">" . ">"))
|
2014-12-06 16:28:19 -05:00
|
|
|
|
"Alist of characters to be converted by `org-html-encode-plain-text'.")
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
;;;; Src Block
|
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defcustom org-html-htmlize-output-type 'inline-css
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Output type to be used by htmlize when formatting code snippets.
|
2014-03-25 11:27:07 -04:00
|
|
|
|
Choices are `css' to export the CSS selectors only,`inline-css'
|
2021-09-16 06:32:43 -04:00
|
|
|
|
to export the CSS attribute values inline in the HTML or nil to
|
2014-03-25 11:27:07 -04:00
|
|
|
|
export plain text. We use as default `inline-css', in order to
|
|
|
|
|
make the resulting HTML self-containing.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
However, this will fail when using Emacs in batch mode for export, because
|
|
|
|
|
then no rich font definitions are in place. It will also not be good if
|
|
|
|
|
people with different Emacs setup contribute HTML files to a website,
|
|
|
|
|
because the fonts will represent the individual setups. In these cases,
|
|
|
|
|
it is much better to let Org/Htmlize assign classes only, and to use
|
|
|
|
|
a style file to define the look of these classes.
|
|
|
|
|
To get a start for your css file, start Emacs session and make sure that
|
|
|
|
|
all the faces you are interested in are defined, for example by loading files
|
|
|
|
|
in all modes you want. Then, use the command
|
2016-10-15 11:36:47 -04:00
|
|
|
|
`\\[org-html-htmlize-generate-css]' to extract class definitions."
|
2013-02-19 13:03:59 -05:00
|
|
|
|
:group 'org-export-html
|
2022-10-17 08:43:59 -04:00
|
|
|
|
:type '(choice (const css) (const inline-css) (const nil))
|
|
|
|
|
:safe #'symbolp)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defcustom org-html-htmlize-font-prefix "org-"
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"The prefix for CSS class names for htmlize font specifications."
|
2013-02-19 13:03:59 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2019-10-08 14:15:06 -04:00
|
|
|
|
(defcustom org-html-wrap-src-lines nil
|
|
|
|
|
"If non-nil, wrap individual lines of source blocks in \"code\" elements.
|
|
|
|
|
In this case, add line number in attribute \"data-ox-html-linenr\" when line
|
|
|
|
|
numbers are enabled."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.3")
|
|
|
|
|
:type 'boolean
|
2021-10-02 13:37:42 -04:00
|
|
|
|
:safe #'booleanp)
|
2019-10-08 14:15:06 -04:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;;; Table
|
|
|
|
|
|
2013-04-10 15:28:36 -04:00
|
|
|
|
(defcustom org-html-table-default-attributes
|
|
|
|
|
'(:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "hsides")
|
|
|
|
|
"Default attributes and values which will be used in table tags.
|
|
|
|
|
This is a plist where attributes are symbols, starting with
|
2013-05-02 17:07:38 -04:00
|
|
|
|
colons, and values are strings.
|
|
|
|
|
|
|
|
|
|
When exporting to HTML5, these values will be disregarded."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-04-10 15:28:36 -04:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(plist :key-type (symbol :tag "Property")
|
|
|
|
|
:value-type (string :tag "Value")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-header-tags '("<th scope=\"%s\"%s>" . "</th>")
|
2014-03-19 06:27:18 -04:00
|
|
|
|
"The opening and ending tags for table header fields.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
This is customizable so that alignment options can be specified.
|
|
|
|
|
The first %s will be filled with the scope of the field, either row or col.
|
|
|
|
|
The second %s will be replaced by a style entry to align the field.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
See also the variable `org-html-table-use-header-tags-for-first-column'.
|
|
|
|
|
See also the variable `org-html-table-align-individual-fields'."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-data-tags '("<td%s>" . "</td>")
|
2014-03-19 06:27:18 -04:00
|
|
|
|
"The opening and ending tags for table data fields.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
This is customizable so that alignment options can be specified.
|
|
|
|
|
The first %s will be filled with the scope of the field, either row or col.
|
|
|
|
|
The second %s will be replaced by a style entry to align the field.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
See also the variable `org-html-table-align-individual-fields'."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
|
|
|
|
|
|
2016-02-02 18:10:24 -05:00
|
|
|
|
(defcustom org-html-table-row-open-tag "<tr>"
|
|
|
|
|
"The opening tag for table rows.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
This is customizable so that alignment options can be specified.
|
2016-02-02 18:10:24 -05:00
|
|
|
|
Instead of strings, these can be a Lisp function that will be
|
2013-04-07 17:19:07 -04:00
|
|
|
|
evaluated for each row in order to construct the table row tags.
|
|
|
|
|
|
2016-02-02 18:10:24 -05:00
|
|
|
|
The function will be called with these arguments:
|
2013-04-07 17:19:07 -04:00
|
|
|
|
|
2016-02-02 18:10:24 -05:00
|
|
|
|
`number': row number (0 is the first row)
|
|
|
|
|
`group-number': group number of current row
|
2016-10-31 05:01:33 -04:00
|
|
|
|
`start-group?': non-nil means the row starts a group
|
|
|
|
|
`end-group?': non-nil means the row ends a group
|
|
|
|
|
`top?': non-nil means this is the top row
|
|
|
|
|
`bottom?': non-nil means this is the bottom row
|
2013-04-07 17:19:07 -04:00
|
|
|
|
|
|
|
|
|
For example:
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2016-10-31 05:01:33 -04:00
|
|
|
|
(setq org-html-table-row-open-tag
|
|
|
|
|
(lambda (number group-number start-group? end-group-p top? bottom?)
|
|
|
|
|
(cond (top? \"<tr class=\\\"tr-top\\\">\")
|
|
|
|
|
(bottom? \"<tr class=\\\"tr-bottom\\\">\")
|
|
|
|
|
(t (if (= (mod number 2) 1)
|
2016-02-02 18:10:24 -05:00
|
|
|
|
\"<tr class=\\\"tr-odd\\\">\"
|
|
|
|
|
\"<tr class=\\\"tr-even\\\">\")))))
|
2013-04-09 13:40:06 -04:00
|
|
|
|
|
|
|
|
|
will use the \"tr-top\" and \"tr-bottom\" classes for the top row
|
|
|
|
|
and the bottom row, and otherwise alternate between \"tr-odd\" and
|
|
|
|
|
\"tr-even\" for odd and even rows."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2016-02-02 18:10:24 -05:00
|
|
|
|
:type '(choice :tag "Opening tag"
|
|
|
|
|
(string :tag "Specify")
|
|
|
|
|
(function)))
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-table-row-close-tag "</tr>"
|
|
|
|
|
"The closing tag for table rows.
|
|
|
|
|
This is customizable so that alignment options can be specified.
|
|
|
|
|
Instead of strings, this can be a Lisp function that will be
|
|
|
|
|
evaluated for each row in order to construct the table row tags.
|
|
|
|
|
|
|
|
|
|
See documentation of `org-html-table-row-open-tag'."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:type '(choice :tag "Closing tag"
|
|
|
|
|
(string :tag "Specify")
|
|
|
|
|
(function)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-align-individual-fields t
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Non-nil means attach style attributes for alignment to each table field.
|
|
|
|
|
When nil, alignment will only be specified in the column tags, but this
|
|
|
|
|
is ignored by some browsers (like Firefox, Safari). Opera does it right
|
|
|
|
|
though."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-use-header-tags-for-first-column nil
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Non-nil means format column one in tables with header tags.
|
|
|
|
|
When nil, also column one will use data tags."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-caption-above t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"When non-nil, place caption string at the beginning of the table.
|
|
|
|
|
Otherwise, place it near the end."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Tags
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-tag-class-prefix ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Prefix to class names for TODO keywords.
|
|
|
|
|
Each tag gets a class given by the tag itself, with this prefix.
|
|
|
|
|
The default prefix is empty because it is nice to just use the keyword
|
|
|
|
|
as a class name. But if you get into conflicts with other, existing
|
|
|
|
|
CSS classes, then this prefix can be very useful."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Generic
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-extension "html"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The extension for exported HTML files."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-xml-declaration
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>")
|
|
|
|
|
("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>"))
|
|
|
|
|
"The extension for exported HTML files.
|
|
|
|
|
%s will be replaced with the charset of the exported file.
|
|
|
|
|
This may be a string, or an alist with export extensions
|
2013-05-02 17:07:38 -04:00
|
|
|
|
and corresponding declarations.
|
|
|
|
|
|
|
|
|
|
This declaration only applies when exporting to XHTML."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(choice
|
|
|
|
|
(string :tag "Single declaration")
|
|
|
|
|
(repeat :tag "Dependent on extension"
|
|
|
|
|
(cons (string :tag "Extension")
|
|
|
|
|
(string :tag "Declaration")))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-coding-system 'utf-8
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Coding system for HTML export.
|
2012-08-25 15:20:17 -04:00
|
|
|
|
Use utf-8 as the default value."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
Add :version and :package-version
* ox.el (org-export-snippet-translation-alist)
(org-export-coding-system, org-export-in-background)
(org-export-async-init-file, org-export-invisible-backends)
(org-export-dispatch-use-expert-ui):
* ox-texinfo.el (org-texinfo-filename, org-texinfo-classes)
(org-texinfo-format-headline-function)
(org-texinfo-node-description-column)
(org-texinfo-active-timestamp-format)
(org-texinfo-link-with-unknown-path-format)
(org-texinfo-tables-verbatim)
(org-texinfo-table-scientific-notation)
(org-texinfo-text-markup-alist)
(org-texinfo-format-drawer-function)
(org-texinfo-format-inlinetask-function)
(org-texinfo-info-process):
* ox-man.el (org-man-tables-centered)
(org-man-table-scientific-notation)
(org-man-source-highlight, org-man-source-highlight-langs)
(org-man-pdf-process, org-man-logfiles-extensions):
* ox-html.el (org-html-allow-name-attribute-in-anchors)
(org-html-coding-system, org-html-divs):
* ox-ascii.el (org-ascii-text-width)
(org-ascii-headline-spacing, org-ascii-indented-line-width)
(org-ascii-paragraph-spacing, org-ascii-charset)
(org-ascii-underline, org-ascii-bullets)
(org-ascii-links-to-notes)
(org-ascii-table-keep-all-vertical-lines)
(org-ascii-table-widen-columns)
(org-ascii-table-use-ascii-art)
(org-ascii-format-drawer-function)
(org-ascii-format-inlinetask-function):
* org.el (org-modules, org-export-backends)
(org-highlight-latex-and-related, orgstruct-setup-hook):
* org-attach.el (org-attach-git-annex-cutoff):
* org-archive.el (org-archive-file-header-format):
* org-agenda.el (org-agenda-todo-ignore-time-comparison-use-seconds):
* ob-python.el (org-babel-python-hline-to)
(org-babel-python-None-to):
* ob-ditaa.el (org-ditaa-eps-jar-path):
* ob-core.el (org-babel-results-keyword): Add :version and
:package-version.
* ox-ascii.el: Use utf-8-emacs as the file coding system.
2013-03-05 10:34:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'coding-system)
|
|
|
|
|
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(defcustom org-html-doctype "xhtml-strict"
|
2013-03-08 19:00:21 -05:00
|
|
|
|
"Document type definition to use for exported HTML files.
|
|
|
|
|
Can be set with the in-buffer HTML_DOCTYPE property or for
|
|
|
|
|
publishing, with :html-doctype."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
Add :version and :package-version
* ox.el (org-export-snippet-translation-alist)
(org-export-coding-system, org-export-in-background)
(org-export-async-init-file, org-export-invisible-backends)
(org-export-dispatch-use-expert-ui):
* ox-texinfo.el (org-texinfo-filename, org-texinfo-classes)
(org-texinfo-format-headline-function)
(org-texinfo-node-description-column)
(org-texinfo-active-timestamp-format)
(org-texinfo-link-with-unknown-path-format)
(org-texinfo-tables-verbatim)
(org-texinfo-table-scientific-notation)
(org-texinfo-text-markup-alist)
(org-texinfo-format-drawer-function)
(org-texinfo-format-inlinetask-function)
(org-texinfo-info-process):
* ox-man.el (org-man-tables-centered)
(org-man-table-scientific-notation)
(org-man-source-highlight, org-man-source-highlight-langs)
(org-man-pdf-process, org-man-logfiles-extensions):
* ox-html.el (org-html-allow-name-attribute-in-anchors)
(org-html-coding-system, org-html-divs):
* ox-ascii.el (org-ascii-text-width)
(org-ascii-headline-spacing, org-ascii-indented-line-width)
(org-ascii-paragraph-spacing, org-ascii-charset)
(org-ascii-underline, org-ascii-bullets)
(org-ascii-links-to-notes)
(org-ascii-table-keep-all-vertical-lines)
(org-ascii-table-widen-columns)
(org-ascii-table-use-ascii-art)
(org-ascii-format-drawer-function)
(org-ascii-format-inlinetask-function):
* org.el (org-modules, org-export-backends)
(org-highlight-latex-and-related, orgstruct-setup-hook):
* org-attach.el (org-attach-git-annex-cutoff):
* org-archive.el (org-archive-file-header-format):
* org-agenda.el (org-agenda-todo-ignore-time-comparison-use-seconds):
* ob-python.el (org-babel-python-hline-to)
(org-babel-python-None-to):
* ob-ditaa.el (org-ditaa-eps-jar-path):
* ob-core.el (org-babel-results-keyword): Add :version and
:package-version.
* ox-ascii.el: Use utf-8-emacs as the file coding system.
2013-03-05 10:34:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2014-01-16 13:41:23 -05:00
|
|
|
|
:type (append
|
|
|
|
|
'(choice)
|
|
|
|
|
(mapcar (lambda (x) `(const ,(car x))) org-html-doctype-alist)
|
|
|
|
|
'((string :tag "Custom doctype" ))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(defcustom org-html-html5-fancy nil
|
2013-06-20 15:14:57 -04:00
|
|
|
|
"Non-nil means using new HTML5 elements.
|
2021-06-22 16:16:52 -04:00
|
|
|
|
This variable is ignored for anything other than HTML5 export."
|
2013-05-02 17:07:38 -04:00
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-03-08 19:00:21 -05:00
|
|
|
|
(defcustom org-html-container-element "div"
|
2013-03-15 18:07:13 -04:00
|
|
|
|
"HTML element to use for wrapping top level sections.
|
2013-03-08 19:00:21 -05:00
|
|
|
|
Can be set with the in-buffer HTML_CONTAINER property or for
|
2013-03-12 04:49:34 -04:00
|
|
|
|
publishing, with :html-container.
|
|
|
|
|
|
|
|
|
|
Note that changing the default will prevent you from using
|
|
|
|
|
org-info.js for your website."
|
2013-03-08 19:00:21 -05:00
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2021-02-08 17:46:51 -05:00
|
|
|
|
(defcustom org-html-content-class "content"
|
|
|
|
|
"CSS class name to use for the top level content wrapper.
|
|
|
|
|
Can be set with the in-buffer HTML_CONTENT_CLASS property or for
|
|
|
|
|
publishing, with :html-content-class."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "27.2"
|
|
|
|
|
:package-version '(Org . "9.5")
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
|
2013-03-08 19:00:21 -05:00
|
|
|
|
(defcustom org-html-divs
|
|
|
|
|
'((preamble "div" "preamble")
|
|
|
|
|
(content "div" "content")
|
|
|
|
|
(postamble "div" "postamble"))
|
2013-04-07 13:02:11 -04:00
|
|
|
|
"Alist of the three section elements for HTML export.
|
2015-09-21 00:24:12 -04:00
|
|
|
|
The car of each entry is one of `preamble', `content' or `postamble'.
|
2013-03-08 19:00:21 -05:00
|
|
|
|
The cdrs of each entry are the ELEMENT_TYPE and ID for each
|
2013-03-12 04:49:34 -04:00
|
|
|
|
section of the exported document.
|
|
|
|
|
|
|
|
|
|
Note that changing the default will prevent you from using
|
|
|
|
|
org-info.js for your website."
|
2013-03-08 19:00:21 -05:00
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(list :greedy t
|
|
|
|
|
(list :tag "Preamble"
|
|
|
|
|
(const :format "" preamble)
|
|
|
|
|
(string :tag "element") (string :tag " id"))
|
|
|
|
|
(list :tag "Content"
|
|
|
|
|
(const :format "" content)
|
|
|
|
|
(string :tag "element") (string :tag " id"))
|
|
|
|
|
(list :tag "Postamble" (const :format "" postamble)
|
|
|
|
|
(string :tag " id") (string :tag "element"))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-12-03 14:37:30 -05:00
|
|
|
|
(defconst org-html-checkbox-types
|
|
|
|
|
'((unicode .
|
2021-09-29 03:22:47 -04:00
|
|
|
|
((on . "☑") (off . "☐") (trans . "☐")))
|
2013-12-03 14:37:30 -05:00
|
|
|
|
(ascii .
|
2021-09-29 03:22:47 -04:00
|
|
|
|
((on . "<code>[X]</code>")
|
|
|
|
|
(off . "<code>[ ]</code>")
|
|
|
|
|
(trans . "<code>[-]</code>")))
|
2013-12-03 14:37:30 -05:00
|
|
|
|
(html .
|
|
|
|
|
((on . "<input type='checkbox' checked='checked' />")
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(off . "<input type='checkbox' />")
|
|
|
|
|
(trans . "<input type='checkbox' />"))))
|
2013-12-03 14:37:30 -05:00
|
|
|
|
"Alist of checkbox types.
|
|
|
|
|
The cdr of each entry is an alist list three checkbox types for
|
2014-01-10 03:48:57 -05:00
|
|
|
|
HTML export: `on', `off' and `trans'.
|
2013-12-03 14:37:30 -05:00
|
|
|
|
|
|
|
|
|
The choices are:
|
2014-01-10 04:00:17 -05:00
|
|
|
|
`unicode' Unicode characters (HTML entities)
|
|
|
|
|
`ascii' ASCII characters
|
|
|
|
|
`html' HTML checkboxes
|
2014-01-10 03:48:57 -05:00
|
|
|
|
|
2013-12-03 14:37:30 -05:00
|
|
|
|
Note that only the ascii characters implement tri-state
|
2021-09-16 06:32:43 -04:00
|
|
|
|
checkboxes. The other two use the `off' checkbox for `trans'.")
|
2013-12-03 14:37:30 -05:00
|
|
|
|
|
2014-01-10 03:48:57 -05:00
|
|
|
|
(defcustom org-html-checkbox-type 'ascii
|
|
|
|
|
"The type of checkboxes to use for HTML export.
|
2019-09-20 18:27:53 -04:00
|
|
|
|
See `org-html-checkbox-types' for the values used for each
|
2014-01-10 03:48:57 -05:00
|
|
|
|
option."
|
2013-12-03 14:37:30 -05:00
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(choice
|
2014-01-10 03:48:57 -05:00
|
|
|
|
(const :tag "ASCII characters" ascii)
|
|
|
|
|
(const :tag "Unicode characters" unicode)
|
|
|
|
|
(const :tag "HTML checkboxes" html)))
|
2013-12-03 14:37:30 -05:00
|
|
|
|
|
2013-04-07 14:59:26 -04:00
|
|
|
|
(defcustom org-html-metadata-timestamp-format "%Y-%m-%d %a %H:%M"
|
|
|
|
|
"Format used for timestamps in preamble, postamble and metadata.
|
|
|
|
|
See `format-time-string' for more information on its components."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Mathjax
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-mathjax-options
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
'((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")
|
|
|
|
|
(scale 1.0)
|
2012-07-24 14:48:41 -04:00
|
|
|
|
(align "center")
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
(font "mathjax-modern")
|
|
|
|
|
(overflow "overflow")
|
|
|
|
|
(tags "ams")
|
2015-02-15 20:04:02 -05:00
|
|
|
|
(indent "0em")
|
|
|
|
|
(multlinewidth "85%")
|
|
|
|
|
(tagindent ".8em")
|
|
|
|
|
(tagside "right"))
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Options for MathJax setup.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
Alist of the following elements.
|
2015-02-15 20:04:02 -05:00
|
|
|
|
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
path The path to MathJax version 3 or later.
|
2015-02-15 20:04:02 -05:00
|
|
|
|
scale Scaling with HTML-CSS, MathML and SVG output engines.
|
|
|
|
|
align How to align display math: left, center, or right.
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
font The font to use with HTML-CSS and SVG output. Needs
|
2022-10-07 09:03:48 -04:00
|
|
|
|
MathJax version 4+. MathJax 4 provides 11 fonts:
|
|
|
|
|
\"mathjax-modern\" Latin-Modern font, default in MathJax 4+
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
\"mathjax-asana\" Asana-Math font
|
|
|
|
|
\"mathjax-bonum\" Gyre Bonum font
|
|
|
|
|
\"mathjax-dejavu\" Gyre DejaVu font
|
|
|
|
|
\"mathjax-pagella\" Gyre Pagella font
|
|
|
|
|
\"mathjax-schola\" Gyre Schola font
|
|
|
|
|
\"mathjax-termes\" Gyre Termes font
|
|
|
|
|
\"mathjax-stix2\" STIX2 font
|
|
|
|
|
\"mathjax-fira\" Fira and Fira-Math fonts
|
|
|
|
|
\"mathjax-euler\" Neo Euler font that extends Latin-Modern
|
|
|
|
|
\"mathjax-tex\" The original MathJax TeX font
|
2023-12-10 06:52:16 -05:00
|
|
|
|
overflow How to break displayed equations when too large. Needs
|
2022-10-07 09:03:48 -04:00
|
|
|
|
MathJax 4 or newer. Supported options include
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
\"overflow\", \"scale\", \"scroll\", \"truncate\",
|
|
|
|
|
\"linebreak\", and \"elide\".
|
2015-02-15 20:04:02 -05:00
|
|
|
|
linebreaks Let MathJax perform automatic linebreaks. Valid values
|
|
|
|
|
are \"true\" and \"false\".
|
2022-08-31 10:05:04 -04:00
|
|
|
|
indent If align is not center, how far from the left/right side? For
|
|
|
|
|
example, \"1em\".
|
2015-02-15 20:04:02 -05:00
|
|
|
|
multlinewidth The width of the multline environment.
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
tags How to number equations. Valid values are \"none\",
|
|
|
|
|
\"all\" and \"ams\".
|
2015-02-15 20:04:02 -05:00
|
|
|
|
tagindent The amount tags are indented.
|
2015-08-10 01:18:52 -04:00
|
|
|
|
tagside Which side to show tags/labels on. Valid values are
|
2015-02-15 20:04:02 -05:00
|
|
|
|
\"left\" and \"right\"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
You can also customize this for some buffer, using something like
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
#+HTML_MATHJAX: align: left indent: 5em tagside: left
|
2015-02-15 20:04:02 -05:00
|
|
|
|
|
|
|
|
|
For further information about MathJax options, see the MathJax documentation:
|
|
|
|
|
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
https://docs.mathjax.org/
|
|
|
|
|
|
|
|
|
|
To maintain compatibility with pre-9.6 Org that used MathJax 2,
|
|
|
|
|
the following conversions take place.
|
|
|
|
|
|
|
|
|
|
The legacy \"autonumber\" option, with the value \"AMS\",
|
|
|
|
|
\"None\", or \"All\", becomes the \"tags\" option set to the
|
|
|
|
|
value \"ams\", \"none\", or \"all\", respectively.
|
|
|
|
|
|
|
|
|
|
Any legacy values of the \"scale\" option, specified as
|
|
|
|
|
percentage strings, become converted to unit-interval numbers.
|
|
|
|
|
For example, a legacy scale of \"150\" becomes a scale of 1.5.
|
|
|
|
|
|
|
|
|
|
The legacy \"linebreaks\" option, with the value \"true\" or
|
|
|
|
|
\"false\", becomes the \"overflow\" option set to the value
|
|
|
|
|
\"linebreak\" or \"overflow\", respectively.
|
|
|
|
|
|
|
|
|
|
The legacy values of the \"font\" option, namely \"TeX\",
|
|
|
|
|
\"STIX-Web\", \"Asana-Math\", \"Neo-Euler\", \"Gyre-Pagella\",
|
|
|
|
|
\"Gyre-Termes\", \"Latin-Modern\", become converted to the
|
2022-10-07 09:03:48 -04:00
|
|
|
|
corresponding MathJax 4+ font names.
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
|
2023-12-10 06:52:16 -05:00
|
|
|
|
Legacy options and values always take precedence."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
:package-version '(Org . "9.6")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(list :greedy t
|
2015-02-15 20:04:02 -05:00
|
|
|
|
(list :tag "path (the path from where to load MathJax.js)"
|
|
|
|
|
(const :format " " path) (string))
|
|
|
|
|
(list :tag "scale (scaling for the displayed math)"
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
(const :format " " scale) (float))
|
2015-02-15 20:04:02 -05:00
|
|
|
|
(list :tag "align (alignment of displayed equations)"
|
|
|
|
|
(const :format " " align) (string))
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
(list :tag "font (used to typeset math)"
|
|
|
|
|
(const :format " " font)
|
|
|
|
|
(choice (const "mathjax-modern")
|
|
|
|
|
(const "mathjax-asana")
|
|
|
|
|
(const "mathjax-bonum")
|
|
|
|
|
(const "mathjax-dejavu")
|
|
|
|
|
(const "mathjax-pagella")
|
|
|
|
|
(const "mathjax-schola")
|
|
|
|
|
(const "mathjax-termes")
|
|
|
|
|
(const "mathjax-stix2")
|
|
|
|
|
(const "mathjax-fira")
|
|
|
|
|
(const "mathjax-euler")
|
|
|
|
|
(const "mathjax-tex")))
|
|
|
|
|
(list :tag "overflow (how to break displayed math)"
|
|
|
|
|
(const :format " " overflow)
|
|
|
|
|
(choice (const "overflow")
|
|
|
|
|
(const "scale")
|
|
|
|
|
(const "scroll")
|
|
|
|
|
(const "truncate")
|
|
|
|
|
(const "linebreak")
|
|
|
|
|
(const "elide")))
|
|
|
|
|
(list :tag "tags (whether equations are numbered and how)"
|
|
|
|
|
(const :format " " tags)
|
|
|
|
|
(choice (const "ams")
|
|
|
|
|
(const "none")
|
|
|
|
|
(const "all")))
|
2015-02-15 20:04:02 -05:00
|
|
|
|
(list :tag "indent (indentation with left or right alignment)"
|
|
|
|
|
(const :format " " indent) (string))
|
|
|
|
|
(list :tag "multlinewidth (width to use for the multline environment)"
|
|
|
|
|
(const :format " " multlinewidth) (string))
|
|
|
|
|
(list :tag "tagindent (the indentation of tags from left or right)"
|
|
|
|
|
(const :format " " tagindent) (string))
|
|
|
|
|
(list :tag "tagside (location of tags)"
|
|
|
|
|
(const :format " " tagside)
|
|
|
|
|
(choice (const "left")
|
|
|
|
|
(const "right")))))
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-mathjax-template
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
"<script>
|
|
|
|
|
window.MathJax = {
|
|
|
|
|
tex: {
|
|
|
|
|
ams: {
|
|
|
|
|
multlineWidth: '%MULTLINEWIDTH'
|
|
|
|
|
},
|
|
|
|
|
tags: '%TAGS',
|
|
|
|
|
tagSide: '%TAGSIDE',
|
|
|
|
|
tagIndent: '%TAGINDENT'
|
|
|
|
|
},
|
|
|
|
|
chtml: {
|
|
|
|
|
scale: %SCALE,
|
|
|
|
|
displayAlign: '%ALIGN',
|
|
|
|
|
displayIndent: '%INDENT'
|
|
|
|
|
},
|
|
|
|
|
svg: {
|
|
|
|
|
scale: %SCALE,
|
|
|
|
|
displayAlign: '%ALIGN',
|
|
|
|
|
displayIndent: '%INDENT'
|
|
|
|
|
},
|
|
|
|
|
output: {
|
|
|
|
|
font: '%FONT',
|
|
|
|
|
displayOverflow: '%OVERFLOW'
|
|
|
|
|
}
|
|
|
|
|
};
|
2015-02-15 20:04:02 -05:00
|
|
|
|
</script>
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
|
|
|
|
|
<script
|
|
|
|
|
id=\"MathJax-script\"
|
|
|
|
|
async
|
|
|
|
|
src=\"%PATH\">
|
|
|
|
|
</script>"
|
2015-02-15 20:04:02 -05:00
|
|
|
|
"The MathJax template. See also `org-html-mathjax-options'."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
;;;; Template :: Postamble
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-postamble 'auto
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means insert a postamble in HTML export.
|
|
|
|
|
|
2015-09-21 00:24:12 -04:00
|
|
|
|
When set to `auto', check against the
|
2013-03-05 09:28:43 -05:00
|
|
|
|
`org-export-with-author/email/creator/date' variables to set the
|
2022-11-02 00:28:52 -04:00
|
|
|
|
content of the postamble. When t, insert a string as defined by the
|
|
|
|
|
formatting string in `org-html-postamble-format'. When set to a
|
|
|
|
|
string, use this formatting string instead (see
|
|
|
|
|
`org-html-postamble-format' for an example of such a formatting
|
|
|
|
|
string).
|
2013-03-05 09:28:43 -05:00
|
|
|
|
|
|
|
|
|
When set to a function, apply this function and insert the
|
|
|
|
|
returned string. The function takes the property list of export
|
|
|
|
|
options as its only argument.
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
|
|
|
|
Setting :html-postamble in publishing projects will take
|
|
|
|
|
precedence over this variable."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(choice (const :tag "No postamble" nil)
|
2013-05-09 09:19:02 -04:00
|
|
|
|
(const :tag "Auto postamble" auto)
|
2012-07-24 14:48:41 -04:00
|
|
|
|
(const :tag "Default formatting string" t)
|
|
|
|
|
(string :tag "Custom formatting string")
|
|
|
|
|
(function :tag "Function (must return a string)")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-postamble-format
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("en" "<p class=\"author\">Author: %a (%e)</p>
|
|
|
|
|
<p class=\"date\">Date: %d</p>
|
ox/ox-html: Fix defcustoms
* lisp/ox.el (org-export-with-archived-trees, org-export-with-author,
org-export-with-clocks, org-export-with-date,
org-export-creator-string, org-export-with-drawers,
org-export-with-email, org-export-with-emphasize,
org-export-exclude-tags, org-export-with-fixed-width,
org-export-with-footnotes, org-export-with-latex,
org-export-headline-levels, org-export-default-language,
org-export-preserve-breaks, org-export-with-entities,
org-export-with-inlinetasks, org-export-with-planning,
org-export-with-priority, org-export-with-section-numbers,
org-export-select-tags, org-export-with-smart-quotes,
org-export-with-special-strings,
org-export-with-statistics-cookies,
org-export-with-sub-superscripts, org-export-with-toc,
org-export-with-tables, org-export-with-tags,
org-export-with-tasks, org-export-time-stamp-file,
org-export-with-timestamps, org-export-with-todo-keywords): Fix
docstrings.
* lisp/ox-html.el (org-html-postamble-format): Slightly change default
value so "Generated by" string doesn't get duplicated.
(org-html-creator-string): Fix docstring.
2013-04-07 08:36:48 -04:00
|
|
|
|
<p class=\"creator\">%c</p>
|
2013-05-02 17:07:38 -04:00
|
|
|
|
<p class=\"validation\">%v</p>"))
|
2012-09-25 16:17:54 -04:00
|
|
|
|
"Alist of languages and format strings for the HTML postamble.
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
2012-09-25 16:17:54 -04:00
|
|
|
|
The first element of each list is the language code, as used for
|
2013-04-07 08:52:43 -04:00
|
|
|
|
the LANGUAGE keyword. See `org-export-default-language'.
|
2012-09-25 16:17:54 -04:00
|
|
|
|
|
|
|
|
|
The second element of each list is a format string to format the
|
|
|
|
|
postamble itself. This format string can contain these elements:
|
|
|
|
|
|
2013-03-15 18:07:13 -04:00
|
|
|
|
%t stands for the title.
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
%s stands for the subtitle.
|
2012-09-25 16:17:54 -04:00
|
|
|
|
%a stands for the author's name.
|
|
|
|
|
%e stands for the author's email.
|
|
|
|
|
%d stands for the date.
|
2013-04-07 08:52:43 -04:00
|
|
|
|
%c will be replaced by `org-html-creator-string'.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
%v will be replaced by `org-html-validation-link'.
|
2013-04-07 08:52:43 -04:00
|
|
|
|
%T will be replaced by the export time.
|
2013-04-07 08:59:27 -04:00
|
|
|
|
%C will be replaced by the last modification time.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
If you need to use a \"%\" character, you need to escape it
|
|
|
|
|
like that: \"%%\"."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-05-09 09:19:02 -04:00
|
|
|
|
:type '(repeat
|
|
|
|
|
(list (string :tag "Language")
|
|
|
|
|
(string :tag "Format string"))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-validation-link
|
2020-03-15 04:44:46 -04:00
|
|
|
|
"<a href=\"https://validator.w3.org/check?uri=referer\">Validate</a>"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Link to HTML validation service."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2020-03-15 12:02:01 -04:00
|
|
|
|
:package-version '(Org . "9.4")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-creator-string
|
2018-01-16 11:22:00 -05:00
|
|
|
|
(format "<a href=\"https://www.gnu.org/software/emacs/\">Emacs</a> %s (<a href=\"https://orgmode.org\">Org</a> mode %s)"
|
2013-04-07 14:12:56 -04:00
|
|
|
|
emacs-version
|
|
|
|
|
(if (fboundp 'org-version) (org-version) "unknown version"))
|
ox/ox-html: Fix defcustoms
* lisp/ox.el (org-export-with-archived-trees, org-export-with-author,
org-export-with-clocks, org-export-with-date,
org-export-creator-string, org-export-with-drawers,
org-export-with-email, org-export-with-emphasize,
org-export-exclude-tags, org-export-with-fixed-width,
org-export-with-footnotes, org-export-with-latex,
org-export-headline-levels, org-export-default-language,
org-export-preserve-breaks, org-export-with-entities,
org-export-with-inlinetasks, org-export-with-planning,
org-export-with-priority, org-export-with-section-numbers,
org-export-select-tags, org-export-with-smart-quotes,
org-export-with-special-strings,
org-export-with-statistics-cookies,
org-export-with-sub-superscripts, org-export-with-toc,
org-export-with-tables, org-export-with-tags,
org-export-with-tasks, org-export-time-stamp-file,
org-export-with-timestamps, org-export-with-todo-keywords): Fix
docstrings.
* lisp/ox-html.el (org-html-postamble-format): Slightly change default
value so "Generated by" string doesn't get duplicated.
(org-html-creator-string): Fix docstring.
2013-04-07 08:36:48 -04:00
|
|
|
|
"Information about the creator of the HTML document.
|
|
|
|
|
This option can also be set on with the CREATOR keyword."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-11-13 01:27:10 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-06 03:09:31 -04:00
|
|
|
|
:type '(string :tag "Creator string"))
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Preamble
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-preamble t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means insert a preamble in HTML export.
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2013-03-05 09:28:43 -05:00
|
|
|
|
When t, insert a string as defined by the formatting string in
|
|
|
|
|
`org-html-preamble-format'. When set to a string, use this
|
|
|
|
|
formatting string instead (see `org-html-postamble-format' for an
|
|
|
|
|
example of such a formatting string).
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
When set to a function, apply this function and insert the
|
|
|
|
|
returned string. The function takes the property list of export
|
|
|
|
|
options as its only argument.
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
Setting :html-preamble in publishing projects will take
|
|
|
|
|
precedence over this variable."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(choice (const :tag "No preamble" nil)
|
|
|
|
|
(const :tag "Default preamble" t)
|
|
|
|
|
(string :tag "Custom formatting string")
|
|
|
|
|
(function :tag "Function (must return a string)")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-preamble-format '(("en" ""))
|
2012-09-25 16:17:54 -04:00
|
|
|
|
"Alist of languages and format strings for the HTML preamble.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-09-25 16:17:54 -04:00
|
|
|
|
The first element of each list is the language code, as used for
|
2013-04-07 08:52:43 -04:00
|
|
|
|
the LANGUAGE keyword. See `org-export-default-language'.
|
2012-09-25 16:17:54 -04:00
|
|
|
|
|
|
|
|
|
The second element of each list is a format string to format the
|
|
|
|
|
preamble itself. This format string can contain these elements:
|
|
|
|
|
|
|
|
|
|
%t stands for the title.
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
%s stands for the subtitle.
|
2012-09-25 16:17:54 -04:00
|
|
|
|
%a stands for the author's name.
|
|
|
|
|
%e stands for the author's email.
|
|
|
|
|
%d stands for the date.
|
2013-04-07 08:52:43 -04:00
|
|
|
|
%c will be replaced by `org-html-creator-string'.
|
2013-03-15 18:07:13 -04:00
|
|
|
|
%v will be replaced by `org-html-validation-link'.
|
2013-04-07 08:52:43 -04:00
|
|
|
|
%T will be replaced by the export time.
|
2013-04-07 08:59:27 -04:00
|
|
|
|
%C will be replaced by the last modification time.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
If you need to use a \"%\" character, you need to escape it
|
2013-03-05 09:28:43 -05:00
|
|
|
|
like that: \"%%\".
|
|
|
|
|
|
|
|
|
|
See the default value of `org-html-postamble-format' for an
|
|
|
|
|
example."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-05-09 09:19:02 -04:00
|
|
|
|
:type '(repeat
|
|
|
|
|
(list (string :tag "Language")
|
|
|
|
|
(string :tag "Format string"))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-link-up ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Where should the \"UP\" link of exported HTML pages lead?"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(string :tag "File or URL"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-link-home ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Where should the \"HOME\" link of exported HTML pages lead?"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(string :tag "File or URL"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-07-01 10:06:37 -04:00
|
|
|
|
(defcustom org-html-link-use-abs-url nil
|
|
|
|
|
"Should we prepend relative links with HTML_LINK_HOME?"
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.1")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-home/up-format
|
2013-03-12 02:41:38 -04:00
|
|
|
|
"<div id=\"org-div-home-and-up\">
|
2012-07-24 14:48:41 -04:00
|
|
|
|
<a accesskey=\"h\" href=\"%s\"> UP </a>
|
|
|
|
|
|
|
|
|
|
|
<a accesskey=\"H\" href=\"%s\"> HOME </a>
|
|
|
|
|
</div>"
|
|
|
|
|
"Snippet used to insert the HOME and UP links.
|
|
|
|
|
This is a format string, the first %s will receive the UP link,
|
2013-01-27 17:11:34 -05:00
|
|
|
|
the second the HOME link. If both `org-html-link-up' and
|
|
|
|
|
`org-html-link-home' are empty, the entire snippet will be
|
2012-07-24 14:48:41 -04:00
|
|
|
|
ignored."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Scripts
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2021-05-01 05:25:51 -04:00
|
|
|
|
(defcustom org-html-head-include-scripts nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means include the JavaScript snippets in exported HTML files.
|
2021-05-01 05:25:51 -04:00
|
|
|
|
The actual script is defined in `org-html-scripts'."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-03-02 12:05:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'boolean)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Styles
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2020-12-14 04:50:15 -05:00
|
|
|
|
(defcustom org-html-meta-tags #'org-html-meta-tags-default
|
|
|
|
|
"Form that is used to produce meta tags in the HTML head.
|
|
|
|
|
|
|
|
|
|
Can be a list where each item is a list of arguments to be passed
|
|
|
|
|
to `org-html--build-meta-entry'. Any nil items are ignored.
|
|
|
|
|
|
|
|
|
|
Also accept a function which gives such a list when called with a
|
|
|
|
|
single argument (INFO, a communication plist)."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.5")
|
|
|
|
|
:type '(choice
|
|
|
|
|
(repeat
|
|
|
|
|
(list (string :tag "Meta label")
|
|
|
|
|
(string :tag "label value")
|
|
|
|
|
(string :tag "Content value")))
|
|
|
|
|
function))
|
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(defcustom org-html-head-include-default-style t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means include the default style in exported HTML files.
|
2013-03-02 12:05:16 -05:00
|
|
|
|
The actual style is defined in `org-html-style-default' and
|
2013-03-05 11:06:01 -05:00
|
|
|
|
should not be modified. Use `org-html-head' to use your own
|
2013-03-02 12:05:16 -05:00
|
|
|
|
style information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-03-02 12:05:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
;;;###autoload
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(put 'org-html-head-include-default-style 'safe-local-variable 'booleanp)
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(defcustom org-html-head ""
|
|
|
|
|
"Org-wide head definitions for exported HTML files.
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
This variable can contain the full HTML structure to provide a
|
|
|
|
|
style, including the surrounding HTML tags. You can consider
|
|
|
|
|
including definitions for the following classes: title, todo,
|
|
|
|
|
done, timestamp, timestamp-kwd, tag, target.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
For example, a valid value would be:
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2021-06-22 16:16:52 -04:00
|
|
|
|
<style>
|
2018-01-15 10:38:33 -05:00
|
|
|
|
p { font-weight: normal; color: gray; }
|
|
|
|
|
h1 { color: black; }
|
2012-07-24 14:48:41 -04:00
|
|
|
|
.title { text-align: center; }
|
|
|
|
|
.todo, .timestamp-kwd { color: red; }
|
|
|
|
|
.done { color: green; }
|
|
|
|
|
</style>
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
If you want to refer to an external style, use something like
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\" />
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
As the value of this option simply gets inserted into the HTML
|
|
|
|
|
<head> header, you can use it to add any arbitrary text to the
|
2013-03-03 12:58:40 -05:00
|
|
|
|
header.
|
|
|
|
|
|
|
|
|
|
You can set this on a per-file basis using #+HTML_HEAD:,
|
|
|
|
|
or for publication projects using the :html-head property."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-03-02 12:05:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
|
|
|
|
;;;###autoload
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(put 'org-html-head 'safe-local-variable 'stringp)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-03 12:58:40 -05:00
|
|
|
|
(defcustom org-html-head-extra ""
|
|
|
|
|
"More head information to add in the HTML output.
|
|
|
|
|
|
|
|
|
|
You can set this on a per-file basis using #+HTML_HEAD_EXTRA:,
|
|
|
|
|
or for publication projects using the :html-head-extra property."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'string)
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(put 'org-html-head-extra 'safe-local-variable 'stringp)
|
|
|
|
|
|
2015-04-01 09:39:28 -04:00
|
|
|
|
;;;; Template :: Viewport
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-viewport '((width "device-width")
|
|
|
|
|
(initial-scale "1")
|
|
|
|
|
(minimum-scale "")
|
|
|
|
|
(maximum-scale "")
|
|
|
|
|
(user-scalable ""))
|
|
|
|
|
"Viewport options for mobile-optimized sites.
|
|
|
|
|
|
|
|
|
|
The following values are recognized
|
|
|
|
|
|
|
|
|
|
width Size of the viewport.
|
|
|
|
|
initial-scale Zoom level when the page is first loaded.
|
|
|
|
|
minimum-scale Minimum allowed zoom level.
|
|
|
|
|
maximum-scale Maximum allowed zoom level.
|
|
|
|
|
user-scalable Whether zoom can be changed.
|
|
|
|
|
|
|
|
|
|
The viewport meta tag is inserted if this variable is non-nil.
|
|
|
|
|
|
|
|
|
|
See the following site for a reference:
|
|
|
|
|
https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag"
|
|
|
|
|
:group 'org-export-html
|
2017-01-25 23:39:18 -05:00
|
|
|
|
:version "26.1"
|
2015-04-01 09:39:28 -04:00
|
|
|
|
:package-version '(Org . "8.3")
|
2015-07-20 04:36:32 -04:00
|
|
|
|
:type '(choice (const :tag "Disable" nil)
|
|
|
|
|
(list :tag "Enable"
|
|
|
|
|
(list :tag "Width of viewport"
|
|
|
|
|
(const :format " " width)
|
|
|
|
|
(choice (const :tag "unset" "")
|
|
|
|
|
(string)))
|
|
|
|
|
(list :tag "Initial scale"
|
|
|
|
|
(const :format " " initial-scale)
|
|
|
|
|
(choice (const :tag "unset" "")
|
|
|
|
|
(string)))
|
|
|
|
|
(list :tag "Minimum scale/zoom"
|
|
|
|
|
(const :format " " minimum-scale)
|
|
|
|
|
(choice (const :tag "unset" "")
|
|
|
|
|
(string)))
|
|
|
|
|
(list :tag "Maximum scale/zoom"
|
|
|
|
|
(const :format " " maximum-scale)
|
|
|
|
|
(choice (const :tag "unset" "")
|
|
|
|
|
(string)))
|
|
|
|
|
(list :tag "User scalable/zoomable"
|
|
|
|
|
(const :format " " user-scalable)
|
|
|
|
|
(choice (const :tag "unset" "")
|
|
|
|
|
(const "true")
|
|
|
|
|
(const "false"))))))
|
2015-04-01 09:39:28 -04:00
|
|
|
|
|
2017-03-23 18:22:30 -04:00
|
|
|
|
;; Handle source code blocks with Klipse
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-klipsify-src nil
|
|
|
|
|
"When non-nil, source code blocks are editable in exported presentation."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.1")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-klipse-css
|
|
|
|
|
"https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"
|
|
|
|
|
"Location of the codemirror CSS file for use with klipse."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.1")
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-klipse-js
|
|
|
|
|
"https://storage.googleapis.com/app.klipse.tech/plugin_prod/js/klipse_plugin.min.js"
|
|
|
|
|
"Location of the klipse javascript file."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-klipse-selection-script
|
|
|
|
|
"window.klipse_settings = {selector_eval_html: '.src-html',
|
|
|
|
|
selector_eval_js: '.src-js',
|
|
|
|
|
selector_eval_python_client: '.src-python',
|
|
|
|
|
selector_eval_scheme: '.src-scheme',
|
|
|
|
|
selector: '.src-clojure',
|
|
|
|
|
selector_eval_ruby: '.src-ruby'};"
|
|
|
|
|
"Javascript snippet to activate klipse."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:package-version '(Org . "9.1")
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Todos
|
2012-04-22 01:09:19 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-todo-kwd-class-prefix ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Prefix to class names for TODO keywords.
|
|
|
|
|
Each TODO keyword gets a class given by the keyword itself, with this prefix.
|
|
|
|
|
The default prefix is empty because it is nice to just use the keyword
|
|
|
|
|
as a class name. But if you get into conflicts with other, existing
|
|
|
|
|
CSS classes, then this prefix can be very useful."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2017-03-23 18:22:30 -04:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;; Internal Functions
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(defun org-html-xhtml-p (info)
|
2023-12-10 06:52:16 -05:00
|
|
|
|
"Return non-nil when :html-doctype property in INFO plist is xhtml."
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(let ((dt (downcase (plist-get info :html-doctype))))
|
|
|
|
|
(string-match-p "xhtml" dt)))
|
|
|
|
|
|
|
|
|
|
(defun org-html-html5-p (info)
|
2023-12-10 06:52:16 -05:00
|
|
|
|
"Return non-nil when :html-doctype property in INFO plist is html5 or equivalent."
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(let ((dt (downcase (plist-get info :html-doctype))))
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(member dt '("html5" "xhtml5" "<!doctype html>"))))
|
2013-05-02 17:07:38 -04:00
|
|
|
|
|
2015-08-19 05:07:06 -04:00
|
|
|
|
(defun org-html--html5-fancy-p (info)
|
|
|
|
|
"Non-nil when exporting to HTML5 with fancy elements.
|
|
|
|
|
INFO is the current state of the export process, as a plist."
|
2015-08-17 20:42:35 -04:00
|
|
|
|
(and (plist-get info :html-html5-fancy)
|
|
|
|
|
(org-html-html5-p info)))
|
|
|
|
|
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(defun org-html-close-tag (tag attr info)
|
2017-01-12 03:58:50 -05:00
|
|
|
|
"Return close-tag for string TAG.
|
|
|
|
|
ATTR specifies additional attributes. INFO is a property list
|
|
|
|
|
containing current export state."
|
2017-01-12 03:54:22 -05:00
|
|
|
|
(concat "<" tag
|
|
|
|
|
(org-string-nw-p (concat " " attr))
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(if (org-html-xhtml-p info) " />" ">")))
|
|
|
|
|
|
2013-05-29 09:53:51 -04:00
|
|
|
|
(defun org-html-doctype (info)
|
2017-01-12 03:58:50 -05:00
|
|
|
|
"Return correct HTML doctype tag.
|
|
|
|
|
INFO is a plist used as a communication channel. Doctype tag is
|
|
|
|
|
extracted from `org-html-doctype-alist', or the literal value
|
|
|
|
|
of :html-doctype from INFO if :html-doctype is not found in the
|
|
|
|
|
alist."
|
2013-05-29 09:53:51 -04:00
|
|
|
|
(let ((dt (plist-get info :html-doctype)))
|
|
|
|
|
(or (cdr (assoc dt org-html-doctype-alist)) dt)))
|
|
|
|
|
|
2013-04-10 15:28:36 -04:00
|
|
|
|
(defun org-html--make-attribute-string (attributes)
|
|
|
|
|
"Return a list of attributes, as a string.
|
2017-01-12 03:58:50 -05:00
|
|
|
|
ATTRIBUTES is a plist where values are either strings or nil. An
|
|
|
|
|
attribute with a nil value will be omitted from the result."
|
2013-04-10 15:28:36 -04:00
|
|
|
|
(let (output)
|
|
|
|
|
(dolist (item attributes (mapconcat 'identity (nreverse output) " "))
|
|
|
|
|
(cond ((null item) (pop output))
|
|
|
|
|
((symbolp item) (push (substring (symbol-name item) 1) output))
|
|
|
|
|
(t (let ((key (car output))
|
|
|
|
|
(value (replace-regexp-in-string
|
|
|
|
|
"\"" """ (org-html-encode-plain-text item))))
|
|
|
|
|
(setcar output (format "%s=\"%s\"" key value))))))))
|
|
|
|
|
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(defun org-html--reference (datum info &optional named-only)
|
|
|
|
|
"Return an appropriate reference for DATUM.
|
|
|
|
|
|
|
|
|
|
DATUM is an element or a `target' type object. INFO is the
|
|
|
|
|
current export state, as a plist.
|
|
|
|
|
|
|
|
|
|
When NAMED-ONLY is non-nil and DATUM has no NAME keyword, return
|
|
|
|
|
nil. This doesn't apply to headlines, inline tasks, radio
|
|
|
|
|
targets and targets."
|
|
|
|
|
(let* ((type (org-element-type datum))
|
2022-10-22 06:49:24 -04:00
|
|
|
|
(custom-id (and (memq type '(headline inlinetask))
|
|
|
|
|
(org-element-property :CUSTOM_ID datum)))
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(user-label
|
2022-10-22 06:49:24 -04:00
|
|
|
|
(or
|
|
|
|
|
custom-id
|
|
|
|
|
(and (memq type '(radio-target target))
|
|
|
|
|
(org-element-property :value datum))
|
|
|
|
|
(org-element-property :name datum)
|
|
|
|
|
(when-let ((id (org-element-property :ID datum)))
|
|
|
|
|
(concat org-html--id-attr-prefix id)))))
|
|
|
|
|
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(cond
|
|
|
|
|
((and user-label
|
|
|
|
|
(or (plist-get info :html-prefer-user-labels)
|
|
|
|
|
;; Used CUSTOM_ID property unconditionally.
|
2022-10-22 06:49:24 -04:00
|
|
|
|
custom-id))
|
2020-09-08 04:14:06 -04:00
|
|
|
|
user-label)
|
|
|
|
|
((and named-only
|
|
|
|
|
(not (memq type '(headline inlinetask radio-target target)))
|
|
|
|
|
(not user-label))
|
|
|
|
|
nil)
|
|
|
|
|
(t
|
|
|
|
|
(org-export-get-reference datum info)))))
|
|
|
|
|
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(defun org-html--wrap-image (contents info &optional caption label)
|
|
|
|
|
"Wrap CONTENTS string within an appropriate environment for images.
|
|
|
|
|
INFO is a plist used as a communication channel. When optional
|
|
|
|
|
arguments CAPTION and LABEL are given, use them for caption and
|
|
|
|
|
\"id\" attribute."
|
2015-08-19 05:07:06 -04:00
|
|
|
|
(let ((html5-fancy (org-html--html5-fancy-p info)))
|
2017-01-24 16:22:47 -05:00
|
|
|
|
(format (if html5-fancy "\n<figure%s>\n%s%s\n</figure>"
|
|
|
|
|
"\n<div%s class=\"figure\">\n%s%s\n</div>")
|
2013-07-01 16:51:26 -04:00
|
|
|
|
;; ID.
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(if (org-string-nw-p label) (format " id=\"%s\"" label) "")
|
2013-07-01 16:51:26 -04:00
|
|
|
|
;; Contents.
|
2017-01-24 16:22:47 -05:00
|
|
|
|
(if html5-fancy contents (format "<p>%s</p>" contents))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
;; Caption.
|
|
|
|
|
(if (not (org-string-nw-p caption)) ""
|
|
|
|
|
(format (if html5-fancy "\n<figcaption>%s</figcaption>"
|
|
|
|
|
"\n<p>%s</p>")
|
|
|
|
|
caption)))))
|
|
|
|
|
|
|
|
|
|
(defun org-html--format-image (source attributes info)
|
|
|
|
|
"Return \"img\" tag with given SOURCE and ATTRIBUTES.
|
|
|
|
|
SOURCE is a string specifying the location of the image.
|
|
|
|
|
ATTRIBUTES is a plist, as returned by
|
|
|
|
|
`org-export-read-attribute'. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
2021-04-07 07:07:53 -04:00
|
|
|
|
(org-html-close-tag
|
|
|
|
|
"img"
|
|
|
|
|
(org-html--make-attribute-string
|
|
|
|
|
(org-combine-plists
|
|
|
|
|
(list :src source
|
|
|
|
|
:alt (if (string-match-p
|
|
|
|
|
(concat "^" org-preview-latex-image-directory) source)
|
|
|
|
|
(org-html-encode-plain-text
|
|
|
|
|
(org-find-text-property-in-string 'org-latex-src source))
|
|
|
|
|
(file-name-nondirectory source)))
|
2021-07-30 23:53:07 -04:00
|
|
|
|
(if (string= "svg" (file-name-extension source))
|
|
|
|
|
(org-combine-plists '(:class "org-svg") attributes '(:fallback nil))
|
|
|
|
|
attributes)))
|
2021-04-07 07:07:53 -04:00
|
|
|
|
info))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--textarea-block (element)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Transcode ELEMENT into a textarea block.
|
2018-09-20 05:23:49 -04:00
|
|
|
|
ELEMENT is either a source or an example block."
|
2013-03-08 18:58:31 -05:00
|
|
|
|
(let* ((code (car (org-export-unravel-code element)))
|
|
|
|
|
(attr (org-export-read-attribute :attr_html element)))
|
|
|
|
|
(format "<p>\n<textarea cols=\"%s\" rows=\"%s\">\n%s</textarea>\n</p>"
|
2012-12-09 06:16:37 -05:00
|
|
|
|
(or (plist-get attr :width) 80)
|
|
|
|
|
(or (plist-get attr :height) (org-count-lines code))
|
|
|
|
|
code)))
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html--has-caption-p (element &optional _info)
|
2013-06-29 01:44:52 -04:00
|
|
|
|
"Non-nil when ELEMENT has a caption affiliated keyword.
|
|
|
|
|
INFO is a plist used as a communication channel. This function
|
|
|
|
|
is meant to be used as a predicate for `org-export-get-ordinal' or
|
|
|
|
|
a value to `org-html-standalone-image-predicate'."
|
|
|
|
|
(org-element-property :caption element))
|
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;;; Table
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defun org-html-htmlize-region-for-paste (beg end)
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
"Convert the region between BEG and END to HTML, using htmlize.el.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
This is much like `htmlize-region-for-paste', only that it uses
|
|
|
|
|
the settings define in the org-... variables."
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(let* ((htmlize-output-type org-html-htmlize-output-type)
|
|
|
|
|
(htmlize-css-name-prefix org-html-htmlize-font-prefix)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(htmlbuf (htmlize-region beg end)))
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(with-current-buffer htmlbuf
|
|
|
|
|
(buffer-substring (plist-get htmlize-buffer-places 'content-start)
|
|
|
|
|
(plist-get htmlize-buffer-places 'content-end)))
|
|
|
|
|
(kill-buffer htmlbuf))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;;###autoload
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defun org-html-htmlize-generate-css ()
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Create the CSS for all font definitions in the current Emacs session.
|
|
|
|
|
Use this to create face definitions in your CSS style file that can then
|
|
|
|
|
be used by code snippets transformed by htmlize.
|
|
|
|
|
This command just produces a buffer that contains class definitions for all
|
|
|
|
|
faces used in the current Emacs session. You can copy and paste the ones you
|
|
|
|
|
need into your CSS file.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2024-04-04 07:17:27 -04:00
|
|
|
|
The face definitions are prepended with
|
|
|
|
|
`org-html-htmlize-font-prefix'.
|
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
If you then set `org-html-htmlize-output-type' to `css', calls
|
|
|
|
|
to the function `org-html-htmlize-region-for-paste' will
|
2013-01-27 17:11:34 -05:00
|
|
|
|
produce code that uses these same face definitions."
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(interactive)
|
2023-01-23 10:06:46 -05:00
|
|
|
|
(org-require-package 'htmlize)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(and (get-buffer "*html*") (kill-buffer "*html*"))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(let ((fl (face-list))
|
2024-04-04 07:17:27 -04:00
|
|
|
|
(htmlize-css-name-prefix org-html-htmlize-font-prefix)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(htmlize-output-type 'css)
|
|
|
|
|
f i)
|
2024-04-04 07:17:27 -04:00
|
|
|
|
(while fl
|
|
|
|
|
(setq f (pop fl)
|
|
|
|
|
i (and f (face-attribute f :inherit)))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(when (and (symbolp f) (or (not i) (not (listp i))))
|
|
|
|
|
(insert (org-add-props (copy-sequence "1") nil 'face f))))
|
|
|
|
|
(htmlize-region (point-min) (point-max))))
|
2016-06-23 04:00:00 -04:00
|
|
|
|
(pop-to-buffer-same-window "*html*")
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(goto-char (point-min))
|
2018-05-09 20:17:12 -04:00
|
|
|
|
(when (re-search-forward "<style" nil t)
|
|
|
|
|
(delete-region (point-min) (match-beginning 0)))
|
|
|
|
|
(when (re-search-forward "</style>" nil t)
|
|
|
|
|
(delete-region (1+ (match-end 0)) (point-max)))
|
2023-05-10 09:27:13 -04:00
|
|
|
|
(forward-line 0)
|
2018-05-09 20:17:12 -04:00
|
|
|
|
(when (looking-at " +") (replace-match ""))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(goto-char (point-min)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--make-string (n string)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Build a string by concatenating N times STRING."
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(let (out) (dotimes (_ n out) (setq out (concat string out)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(defun org-html-fix-class-name (kwd) ; audit callers of this function
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
"Turn todo keyword KWD into a valid class name.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
Replaces invalid characters with \"_\"."
|
2016-09-02 21:05:10 -04:00
|
|
|
|
(replace-regexp-in-string "[^a-zA-Z0-9_]" "_" kwd nil t))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-footnote-section (info)
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
"Format the footnote section.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2018-10-03 09:26:14 -04:00
|
|
|
|
(pcase (org-export-collect-footnote-definitions info)
|
|
|
|
|
(`nil nil)
|
|
|
|
|
(definitions
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format
|
|
|
|
|
(plist-get info :html-footnotes-section)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--translate "Footnotes" info)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(format
|
2013-03-10 07:09:43 -04:00
|
|
|
|
"\n%s\n"
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(mapconcat
|
2018-10-03 09:26:14 -04:00
|
|
|
|
(lambda (definition)
|
|
|
|
|
(pcase definition
|
|
|
|
|
(`(,n ,_ ,def)
|
|
|
|
|
;; `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.%d" n)
|
|
|
|
|
n
|
2021-06-22 16:16:52 -04:00
|
|
|
|
(format " class=\"footnum\" href=\"#fnr.%d\" role=\"doc-backlink\"" n)
|
2018-10-03 09:26:14 -04:00
|
|
|
|
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)
|
2021-06-22 16:16:52 -04:00
|
|
|
|
(format "<div class=\"footpara\" role=\"doc-footnote\">%s</div>"
|
2018-10-03 09:26:14 -04:00
|
|
|
|
(if (not inline?) contents
|
|
|
|
|
(format "<p class=\"footpara\">%s</p>"
|
|
|
|
|
contents))))))))
|
|
|
|
|
definitions
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
"\n"))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Template
|
|
|
|
|
|
2020-12-14 04:50:15 -05:00
|
|
|
|
(defun org-html-meta-tags-default (info)
|
|
|
|
|
"A default value for `org-html-meta-tags'.
|
|
|
|
|
|
|
|
|
|
Generate a list items, each of which is a list of arguments that can
|
|
|
|
|
be passed to `org-html--build-meta-entry', to generate meta tags to be
|
|
|
|
|
included in the HTML head.
|
|
|
|
|
|
|
|
|
|
Use document's plist INFO to derive relevant information for the tags."
|
|
|
|
|
(let ((author (and (plist-get info :with-author)
|
|
|
|
|
(let ((auth (plist-get info :author)))
|
|
|
|
|
;; Return raw Org syntax.
|
|
|
|
|
(and auth (org-element-interpret-data auth))))))
|
|
|
|
|
(list
|
|
|
|
|
(when (org-string-nw-p author)
|
|
|
|
|
(list "name" "author" author))
|
|
|
|
|
(when (org-string-nw-p (plist-get info :description))
|
|
|
|
|
(list "name" "description"
|
|
|
|
|
(plist-get info :description)))
|
|
|
|
|
(when (org-string-nw-p (plist-get info :keywords))
|
|
|
|
|
(list "name" "keywords" (plist-get info :keywords)))
|
|
|
|
|
'("name" "generator" "Org Mode"))))
|
|
|
|
|
|
2020-12-14 04:41:33 -05:00
|
|
|
|
(defun org-html--build-meta-entry
|
|
|
|
|
(label identity &optional content-format &rest content-formatters)
|
|
|
|
|
"Build a meta tag using the provided information.
|
|
|
|
|
|
|
|
|
|
Construct <meta> tag of form <meta LABEL=\"IDENTITY\" />, or when CONTENT-FORMAT
|
|
|
|
|
is present: <meta LABEL=\"IDENTITY\" content=\"{content}\" />
|
|
|
|
|
|
|
|
|
|
Here {content} is determined by applying any CONTENT-FORMATTERS to the
|
|
|
|
|
CONTENT-FORMAT and encoding the result as plain text."
|
|
|
|
|
(concat "<meta "
|
|
|
|
|
(format "%s=\"%s" label identity)
|
|
|
|
|
(when content-format
|
|
|
|
|
(concat "\" content=\""
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"\"" """
|
|
|
|
|
(org-html-encode-plain-text
|
|
|
|
|
(if content-formatters
|
|
|
|
|
(apply #'format content-format content-formatters)
|
|
|
|
|
content-format)))))
|
|
|
|
|
"\" />\n"))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-meta-info (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Return meta tags for exported document.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2020-12-14 04:41:33 -05:00
|
|
|
|
(let* ((title (org-html-plain-text
|
|
|
|
|
(org-element-interpret-data (plist-get info :title)) info))
|
|
|
|
|
;; Set title to an invisible character instead of leaving it
|
|
|
|
|
;; empty, which is invalid.
|
|
|
|
|
(title (if (org-string-nw-p title) title "‎"))
|
|
|
|
|
(charset (or (and org-html-coding-system
|
|
|
|
|
(symbol-name
|
|
|
|
|
(coding-system-get org-html-coding-system
|
|
|
|
|
'mime-charset)))
|
|
|
|
|
"iso-8859-1")))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(concat
|
2013-05-30 15:19:57 -04:00
|
|
|
|
(when (plist-get info :time-stamp-file)
|
|
|
|
|
(format-time-string
|
2015-04-08 07:23:35 -04:00
|
|
|
|
(concat "<!-- "
|
|
|
|
|
(plist-get info :html-metadata-timestamp-format)
|
|
|
|
|
" -->\n")))
|
2020-12-14 04:41:33 -05:00
|
|
|
|
|
|
|
|
|
(if (org-html-html5-p info)
|
|
|
|
|
(org-html--build-meta-entry "charset" charset)
|
|
|
|
|
(org-html--build-meta-entry "http-equiv" "Content-Type"
|
|
|
|
|
(concat "text/html;charset=" charset)))
|
|
|
|
|
|
2015-06-09 00:48:26 -04:00
|
|
|
|
(let ((viewport-options
|
2015-11-06 07:04:20 -05:00
|
|
|
|
(cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
|
2020-02-16 17:33:13 -05:00
|
|
|
|
(plist-get info :html-viewport))))
|
2020-12-14 04:41:33 -05:00
|
|
|
|
(if viewport-options
|
|
|
|
|
(org-html--build-meta-entry "name" "viewport"
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (elm)
|
|
|
|
|
(format "%s=%s" (car elm) (cadr elm)))
|
|
|
|
|
viewport-options ", "))))
|
|
|
|
|
|
2015-06-09 00:48:26 -04:00
|
|
|
|
(format "<title>%s</title>\n" title)
|
2020-12-14 04:41:33 -05:00
|
|
|
|
|
2020-12-14 04:50:15 -05:00
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (args) (apply #'org-html--build-meta-entry args))
|
|
|
|
|
(delq nil (if (functionp org-html-meta-tags)
|
|
|
|
|
(funcall org-html-meta-tags info)
|
|
|
|
|
org-html-meta-tags))
|
|
|
|
|
""))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
|
2013-03-03 12:58:40 -05:00
|
|
|
|
(defun org-html--build-head (info)
|
|
|
|
|
"Return information for the <head>..</head> of the HTML output.
|
2012-09-25 16:20:37 -04:00
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(concat
|
2013-03-03 00:34:35 -05:00
|
|
|
|
(when (plist-get info :html-head-include-default-style)
|
2013-02-19 19:06:49 -05:00
|
|
|
|
(org-element-normalize-string org-html-style-default))
|
2013-03-03 12:58:40 -05:00
|
|
|
|
(org-element-normalize-string (plist-get info :html-head))
|
|
|
|
|
(org-element-normalize-string (plist-get info :html-head-extra))
|
2013-02-19 19:06:49 -05:00
|
|
|
|
(when (and (plist-get info :html-htmlized-css-url)
|
|
|
|
|
(eq org-html-htmlize-output-type 'css))
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(org-html-close-tag "link"
|
2015-11-30 15:45:07 -05:00
|
|
|
|
(format "rel=\"stylesheet\" href=\"%s\" type=\"text/css\""
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(plist-get info :html-htmlized-css-url))
|
|
|
|
|
info))
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(when (plist-get info :html-head-include-scripts) org-html-scripts))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-mathjax-config (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Insert the user setup into the mathjax template.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2013-02-15 09:50:38 -05:00
|
|
|
|
(when (and (memq (plist-get info :with-latex) '(mathjax t))
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
(org-element-map (plist-get info :parse-tree)
|
|
|
|
|
'(latex-fragment latex-environment) #'identity info t nil t))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((template (plist-get info :html-mathjax-template))
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
(options (let ((options (plist-get info :html-mathjax-options)))
|
|
|
|
|
;; If the user customized some legacy option, set
|
|
|
|
|
;; the corresponding new option to nil, so that
|
|
|
|
|
;; the legacy user choice overrides the default.
|
|
|
|
|
;; Otherwise, the user did not set the legacy
|
|
|
|
|
;; option, in which case still set the legacy
|
|
|
|
|
;; option but to no value, so that the code can
|
|
|
|
|
;; find its in-buffer value, if set.
|
|
|
|
|
`((,(if (plist-member options 'autonumber)
|
|
|
|
|
'tags 'autonumber)
|
|
|
|
|
nil)
|
|
|
|
|
(,(if (plist-member options 'linebreaks)
|
|
|
|
|
'overflow 'linebreaks)
|
|
|
|
|
nil)
|
|
|
|
|
,@options)))
|
|
|
|
|
(in-buffer (or (plist-get info :html-mathjax) "")))
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(dolist (e options (org-element-normalize-string template))
|
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility. All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3. Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.
Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-10-07 09:03:48 -04:00
|
|
|
|
(let ((symbol (car e))
|
|
|
|
|
(value (nth 1 e)))
|
|
|
|
|
(when (string-match (concat "\\<" (symbol-name symbol) ":")
|
|
|
|
|
in-buffer)
|
|
|
|
|
(setq value
|
|
|
|
|
(car (split-string (substring in-buffer
|
|
|
|
|
(match-end 0))))))
|
|
|
|
|
(when value
|
|
|
|
|
(pcase symbol
|
|
|
|
|
(`font
|
|
|
|
|
(when-let
|
|
|
|
|
((value-new
|
|
|
|
|
(pcase value
|
|
|
|
|
("TeX" "mathjax-tex")
|
|
|
|
|
("STIX-Web" "mathjax-stix2")
|
|
|
|
|
("Asana-Math" "mathjax-asana")
|
|
|
|
|
("Neo-Euler" "mathjax-euler")
|
|
|
|
|
("Gyre-Pagella" "mathjax-pagella")
|
|
|
|
|
("Gyre-Termes" "mathjax-termes")
|
|
|
|
|
("Latin-Modern" "mathjax-modern"))))
|
|
|
|
|
(setq value value-new)))
|
|
|
|
|
(`linebreaks
|
|
|
|
|
(org-display-warning
|
|
|
|
|
"Converting legacy MathJax option: linebreaks")
|
|
|
|
|
(setq symbol 'overflow
|
|
|
|
|
value (if (string= value "true")
|
|
|
|
|
"linebreak"
|
|
|
|
|
"overflow")))
|
|
|
|
|
(`scale
|
|
|
|
|
(when (stringp value)
|
|
|
|
|
(let ((value-maybe (string-to-number value)))
|
|
|
|
|
(setq value
|
|
|
|
|
(if (= value-maybe 0)
|
|
|
|
|
(progn
|
|
|
|
|
(org-display-warning
|
|
|
|
|
(format "Non-numerical MathJax scale: %s"
|
|
|
|
|
value))
|
|
|
|
|
1.0)
|
|
|
|
|
value-maybe))))
|
|
|
|
|
(when (>= value 10)
|
|
|
|
|
(setq value
|
|
|
|
|
(let ((value-new (/ (float value) 100)))
|
|
|
|
|
(org-display-warning
|
|
|
|
|
(format "Converting legacy MathJax scale: %s to %s"
|
|
|
|
|
value
|
|
|
|
|
value-new))
|
|
|
|
|
value-new))))
|
|
|
|
|
(`autonumber
|
|
|
|
|
(org-display-warning
|
|
|
|
|
"Converting legacy MathJax option: autonumber")
|
|
|
|
|
(setq symbol 'tags
|
|
|
|
|
value (downcase value))))
|
|
|
|
|
(while (string-match (format "\\(%%%s\\)[^A-Z]"
|
|
|
|
|
(upcase (symbol-name symbol)))
|
|
|
|
|
template)
|
|
|
|
|
(setq template
|
|
|
|
|
(replace-match (format "%s" value)
|
|
|
|
|
t
|
|
|
|
|
t template 1)))))))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
|
2013-03-16 15:10:53 -04:00
|
|
|
|
(defun org-html-format-spec (info)
|
2016-11-19 17:17:32 -05:00
|
|
|
|
"Return format specification for preamble and postamble.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(let ((timestamp-format (plist-get info :html-metadata-timestamp-format)))
|
|
|
|
|
`((?t . ,(org-export-data (plist-get info :title) info))
|
|
|
|
|
(?s . ,(org-export-data (plist-get info :subtitle) info))
|
|
|
|
|
(?d . ,(org-export-data (org-export-get-date info timestamp-format)
|
|
|
|
|
info))
|
|
|
|
|
(?T . ,(format-time-string timestamp-format))
|
|
|
|
|
(?a . ,(org-export-data (plist-get info :author) info))
|
|
|
|
|
(?e . ,(mapconcat
|
|
|
|
|
(lambda (e) (format "<a href=\"mailto:%s\">%s</a>" e e))
|
|
|
|
|
(split-string (plist-get info :email) ",+ *")
|
|
|
|
|
", "))
|
|
|
|
|
(?c . ,(plist-get info :creator))
|
|
|
|
|
(?C . ,(let ((file (plist-get info :input-file)))
|
|
|
|
|
(format-time-string timestamp-format
|
2018-09-23 21:30:46 -04:00
|
|
|
|
(and file (file-attribute-modification-time
|
|
|
|
|
(file-attributes file))))))
|
2016-11-19 17:17:32 -05:00
|
|
|
|
(?v . ,(or (plist-get info :html-validation-link) "")))))
|
2013-03-16 15:10:53 -04:00
|
|
|
|
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(defun org-html--build-pre/postamble (type info)
|
|
|
|
|
"Return document preamble or postamble as a string, or nil.
|
2015-09-21 00:24:12 -04:00
|
|
|
|
TYPE is either `preamble' or `postamble', INFO is a plist used as a
|
2013-03-15 18:07:13 -04:00
|
|
|
|
communication channel."
|
|
|
|
|
(let ((section (plist-get info (intern (format ":html-%s" type))))
|
2013-03-16 15:10:53 -04:00
|
|
|
|
(spec (org-html-format-spec info)))
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(when section
|
|
|
|
|
(let ((section-contents
|
|
|
|
|
(if (functionp section) (funcall section info)
|
|
|
|
|
(cond
|
|
|
|
|
((stringp section) (format-spec section spec))
|
2022-11-02 00:21:01 -04:00
|
|
|
|
((and (eq section 'auto) (eq type 'postamble))
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(let ((date (cdr (assq ?d spec)))
|
|
|
|
|
(author (cdr (assq ?a spec)))
|
|
|
|
|
(email (cdr (assq ?e spec)))
|
|
|
|
|
(creator (cdr (assq ?c spec)))
|
|
|
|
|
(validation-link (cdr (assq ?v spec))))
|
|
|
|
|
(concat
|
2019-05-21 04:24:11 -04:00
|
|
|
|
(and (plist-get info :with-date)
|
|
|
|
|
(org-string-nw-p date)
|
|
|
|
|
(format "<p class=\"date\">%s: %s</p>\n"
|
|
|
|
|
(org-html--translate "Date" info)
|
|
|
|
|
date))
|
|
|
|
|
(and (plist-get info :with-author)
|
|
|
|
|
(org-string-nw-p author)
|
|
|
|
|
(format "<p class=\"author\">%s: %s</p>\n"
|
|
|
|
|
(org-html--translate "Author" info)
|
|
|
|
|
author))
|
|
|
|
|
(and (plist-get info :with-email)
|
|
|
|
|
(org-string-nw-p email)
|
|
|
|
|
(format "<p class=\"email\">%s: %s</p>\n"
|
|
|
|
|
(org-html--translate "Email" info)
|
|
|
|
|
email))
|
|
|
|
|
(and (plist-get info :time-stamp-file)
|
|
|
|
|
(format
|
|
|
|
|
"<p class=\"date\">%s: %s</p>\n"
|
|
|
|
|
(org-html--translate "Created" info)
|
|
|
|
|
(format-time-string
|
|
|
|
|
(plist-get info :html-metadata-timestamp-format))))
|
|
|
|
|
(and (plist-get info :with-creator)
|
|
|
|
|
(org-string-nw-p creator)
|
|
|
|
|
(format "<p class=\"creator\">%s</p>\n" creator))
|
|
|
|
|
(and (org-string-nw-p validation-link)
|
|
|
|
|
(format "<p class=\"validation\">%s</p>\n"
|
|
|
|
|
validation-link)))))
|
2018-05-03 18:24:36 -04:00
|
|
|
|
(t
|
|
|
|
|
(let ((formats (plist-get info (if (eq type 'preamble)
|
|
|
|
|
:html-preamble-format
|
|
|
|
|
:html-postamble-format)))
|
|
|
|
|
(language (plist-get info :language)))
|
|
|
|
|
(format-spec
|
|
|
|
|
(cadr (or (assoc-string language formats t)
|
|
|
|
|
(assoc-string "en" formats t)))
|
|
|
|
|
spec)))))))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((div (assq type (plist-get info :html-divs))))
|
|
|
|
|
(when (org-string-nw-p section-contents)
|
|
|
|
|
(concat
|
|
|
|
|
(format "<%s id=\"%s\" class=\"%s\">\n"
|
|
|
|
|
(nth 1 div)
|
|
|
|
|
(nth 2 div)
|
|
|
|
|
org-html--pre/postamble-class)
|
|
|
|
|
(org-element-normalize-string section-contents)
|
|
|
|
|
(format "</%s>\n" (nth 1 div)))))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-11 16:19:23 -05:00
|
|
|
|
(defun org-html-inner-template (contents info)
|
|
|
|
|
"Return body of document string after HTML conversion.
|
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
|
|
|
|
(concat
|
|
|
|
|
;; Table of contents.
|
|
|
|
|
(let ((depth (plist-get info :with-toc)))
|
|
|
|
|
(when depth (org-html-toc depth info)))
|
|
|
|
|
;; Document contents.
|
|
|
|
|
contents
|
|
|
|
|
;; Footnotes section.
|
2013-05-12 08:38:10 -04:00
|
|
|
|
(org-html-footnote-section info)))
|
2013-02-11 16:19:23 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-template (contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Return complete document string after HTML conversion.
|
2012-09-25 16:20:37 -04:00
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(concat
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let* ((xml-declaration (plist-get info :html-xml-declaration))
|
|
|
|
|
(decl (or (and (stringp xml-declaration) xml-declaration)
|
|
|
|
|
(cdr (assoc (plist-get info :html-extension)
|
|
|
|
|
xml-declaration))
|
|
|
|
|
(cdr (assoc "html" xml-declaration))
|
|
|
|
|
"")))
|
|
|
|
|
(when (not (or (not decl) (string= "" decl)))
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(format "%s\n"
|
|
|
|
|
(format decl
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(or (and org-html-coding-system
|
2021-09-26 15:29:25 -04:00
|
|
|
|
;; FIXME: Use Emacs 22 style here, see `coding-system-get'.
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(coding-system-get org-html-coding-system 'mime-charset))
|
|
|
|
|
"iso-8859-1"))))))
|
2013-05-29 09:53:51 -04:00
|
|
|
|
(org-html-doctype info)
|
2013-03-08 19:00:21 -05:00
|
|
|
|
"\n"
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(concat "<html"
|
2015-11-30 16:07:10 -05:00
|
|
|
|
(cond ((org-html-xhtml-p info)
|
|
|
|
|
(format
|
|
|
|
|
" xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\""
|
|
|
|
|
(plist-get info :language) (plist-get info :language)))
|
|
|
|
|
((org-html-html5-p info)
|
|
|
|
|
(format " lang=\"%s\"" (plist-get info :language))))
|
2013-05-02 17:07:38 -04:00
|
|
|
|
">\n")
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"<head>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--build-meta-info info)
|
2013-03-03 12:58:40 -05:00
|
|
|
|
(org-html--build-head info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--build-mathjax-config info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"</head>\n"
|
|
|
|
|
"<body>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((link-up (org-trim (plist-get info :html-link-up)))
|
|
|
|
|
(link-home (org-trim (plist-get info :html-link-home))))
|
2013-06-20 14:18:55 -04:00
|
|
|
|
(unless (and (string= link-up "") (string= link-home ""))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format (plist-get info :html-home/up-format)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(or link-up link-home)
|
|
|
|
|
(or link-home link-up))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Preamble.
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(org-html--build-pre/postamble 'preamble info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Document contents.
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((div (assq 'content (plist-get info :html-divs))))
|
2021-02-08 17:46:51 -05:00
|
|
|
|
(format "<%s id=\"%s\" class=\"%s\">\n"
|
|
|
|
|
(nth 1 div)
|
|
|
|
|
(nth 2 div)
|
|
|
|
|
(plist-get info :html-content-class)))
|
2013-03-04 06:15:44 -05:00
|
|
|
|
;; Document title.
|
ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
ox-ascii.el (org-ascii-template--document-title),
ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
ox-latex.el (org-latex-template), ox-man.el (org-man-template),
ox-odt.el (org-odt-template), ox-org.el (org-org-template),
ox-publish.el (org-publish-project-alist),
ox-texinfo.el (org-texinfo-template),
ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.
This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-10 18:09:39 -05:00
|
|
|
|
(when (plist-get info :with-title)
|
2017-08-01 05:32:44 -04:00
|
|
|
|
(let ((title (and (plist-get info :with-title)
|
|
|
|
|
(plist-get info :title)))
|
2015-08-17 20:42:35 -04:00
|
|
|
|
(subtitle (plist-get info :subtitle))
|
2015-08-19 05:07:06 -04:00
|
|
|
|
(html5-fancy (org-html--html5-fancy-p info)))
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
(when title
|
|
|
|
|
(format
|
2015-08-17 20:42:35 -04:00
|
|
|
|
(if html5-fancy
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
"<header>\n<h1 class=\"title\">%s</h1>\n%s</header>"
|
|
|
|
|
"<h1 class=\"title\">%s%s</h1>\n")
|
|
|
|
|
(org-export-data title info)
|
|
|
|
|
(if subtitle
|
|
|
|
|
(format
|
2015-08-17 20:42:35 -04:00
|
|
|
|
(if html5-fancy
|
2021-06-22 16:16:52 -04:00
|
|
|
|
"<p class=\"subtitle\" role=\"doc-subtitle\">%s</p>\n"
|
2017-07-04 12:43:18 -04:00
|
|
|
|
(concat "\n" (org-html-close-tag "br" nil info) "\n"
|
|
|
|
|
"<span class=\"subtitle\">%s</span>\n"))
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
|
(org-export-data subtitle info))
|
|
|
|
|
"")))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
contents
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format "</%s>\n" (nth 1 (assq 'content (plist-get info :html-divs))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Postamble.
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(org-html--build-pre/postamble 'postamble info)
|
2017-03-23 18:22:30 -04:00
|
|
|
|
;; Possibly use the Klipse library live code blocks.
|
2018-05-09 20:17:12 -04:00
|
|
|
|
(when (plist-get info :html-klipsify-src)
|
|
|
|
|
(concat "<script>" (plist-get info :html-klipse-selection-script)
|
|
|
|
|
"</script><script src=\""
|
|
|
|
|
org-html-klipse-js
|
|
|
|
|
"\"></script><link rel=\"stylesheet\" type=\"text/css\" href=\""
|
|
|
|
|
org-html-klipse-css "\"/>"))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Closing document.
|
|
|
|
|
"</body>\n</html>"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--translate (s info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Translate string S according to specified language.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(org-export-translate s :html info))
|
2012-07-12 17:53:57 -04:00
|
|
|
|
|
2012-07-07 15:20:47 -04:00
|
|
|
|
;;;; Anchor
|
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defun org-html--anchor (id desc attributes info)
|
2023-12-10 06:52:16 -05:00
|
|
|
|
"Format a HTML anchor.
|
|
|
|
|
ID is the anchor id. ATTRIBUTES is the anchor attributes, as a string.
|
|
|
|
|
DESC is the anchor text. INFO is the info plist."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let* ((name (and (plist-get info :html-allow-name-attribute-in-anchors) id))
|
2012-07-07 15:20:47 -04:00
|
|
|
|
(attributes (concat (and id (format " id=\"%s\"" id))
|
|
|
|
|
(and name (format " name=\"%s\"" name))
|
|
|
|
|
attributes)))
|
|
|
|
|
(format "<a%s>%s</a>" attributes (or desc ""))))
|
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Todo
|
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defun org-html--todo (todo info)
|
2023-12-10 06:52:16 -05:00
|
|
|
|
"Format TODO keywords into HTML.
|
|
|
|
|
TODO is the keyword, as a string.
|
|
|
|
|
INFO is the info plist."
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(when todo
|
|
|
|
|
(format "<span class=\"%s %s%s\">%s</span>"
|
|
|
|
|
(if (member todo org-done-keywords) "done" "todo")
|
2016-02-19 08:22:08 -05:00
|
|
|
|
(or (plist-get info :html-todo-kwd-class-prefix) "")
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(org-html-fix-class-name todo)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
todo)))
|
|
|
|
|
|
2015-01-10 04:21:54 -05:00
|
|
|
|
;;;; Priority
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html--priority (priority _info)
|
2015-01-10 04:21:54 -05:00
|
|
|
|
"Format a priority into HTML.
|
|
|
|
|
PRIORITY is the character code of the priority or nil. INFO is
|
|
|
|
|
a plist containing export options."
|
|
|
|
|
(and priority (format "<span class=\"priority\">[%c]</span>" priority)))
|
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Tags
|
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defun org-html--tags (tags info)
|
|
|
|
|
"Format TAGS into HTML.
|
|
|
|
|
INFO is a plist containing export options."
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(when tags
|
|
|
|
|
(format "<span class=\"tag\">%s</span>"
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (tag)
|
|
|
|
|
(format "<span class=\"%s\">%s</span>"
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(concat (plist-get info :html-tag-class-prefix)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-fix-class-name tag))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
tag))
|
2013-03-02 00:30:46 -05:00
|
|
|
|
tags " "))))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Src Code
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-fontify-code (code lang)
|
2012-12-09 06:18:22 -05:00
|
|
|
|
"Color CODE with htmlize library.
|
|
|
|
|
CODE is a string representing the source code to colorize. LANG
|
|
|
|
|
is the language used for CODE, as a string, or nil."
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(when code
|
|
|
|
|
(cond
|
2017-11-09 11:28:15 -05:00
|
|
|
|
;; No language. Possibly an example block.
|
|
|
|
|
((not lang) (org-html-encode-plain-text code))
|
|
|
|
|
;; Plain text explicitly set.
|
|
|
|
|
((not org-html-htmlize-output-type) (org-html-encode-plain-text code))
|
|
|
|
|
;; No htmlize library or an inferior version of htmlize.
|
2018-09-18 17:03:24 -04:00
|
|
|
|
((not (progn (require 'htmlize nil t)
|
2023-03-29 10:30:41 -04:00
|
|
|
|
(fboundp 'htmlize-region-for-paste)))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;; Emit a warning.
|
2023-03-29 10:30:41 -04:00
|
|
|
|
(warn "Cannot fontify source block (htmlize.el >= 1.34 required)")
|
2014-03-25 11:27:07 -04:00
|
|
|
|
(org-html-encode-plain-text code))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(t
|
|
|
|
|
;; Map language
|
|
|
|
|
(setq lang (or (assoc-default lang org-src-lang-modes) lang))
|
|
|
|
|
(let* ((lang-mode (and lang (intern (format "%s-mode" lang)))))
|
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: Language is not associated with any Emacs mode
|
|
|
|
|
((not (functionp lang-mode))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-encode-plain-text code))
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;; Case 2: Default. Fontify code.
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(t
|
|
|
|
|
;; htmlize
|
2015-08-04 09:52:47 -04:00
|
|
|
|
(setq code
|
|
|
|
|
(let ((output-type org-html-htmlize-output-type)
|
2020-06-01 06:30:04 -04:00
|
|
|
|
(font-prefix org-html-htmlize-font-prefix)
|
|
|
|
|
(inhibit-read-only t))
|
2015-08-04 09:52:47 -04:00
|
|
|
|
(with-temp-buffer
|
|
|
|
|
;; Switch to language-specific mode.
|
|
|
|
|
(funcall lang-mode)
|
|
|
|
|
(insert code)
|
|
|
|
|
;; Fontify buffer.
|
2022-06-30 07:06:21 -04:00
|
|
|
|
(font-lock-ensure)
|
2015-08-04 09:52:47 -04:00
|
|
|
|
;; Remove formatting on newline characters.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((beg (point-min))
|
|
|
|
|
(end (point-max)))
|
|
|
|
|
(goto-char beg)
|
|
|
|
|
(while (progn (end-of-line) (< (point) end))
|
|
|
|
|
(put-text-property (point) (1+ (point)) 'face nil)
|
|
|
|
|
(forward-char 1))))
|
|
|
|
|
(org-src-mode)
|
|
|
|
|
(set-buffer-modified-p nil)
|
|
|
|
|
;; Htmlize region.
|
|
|
|
|
(let ((org-html-htmlize-output-type output-type)
|
|
|
|
|
(org-html-htmlize-font-prefix font-prefix))
|
|
|
|
|
(org-html-htmlize-region-for-paste
|
|
|
|
|
(point-min) (point-max))))))
|
2013-02-25 18:29:04 -05:00
|
|
|
|
;; Strip any enclosing <pre></pre> tags.
|
2017-12-03 18:42:13 -05:00
|
|
|
|
(let* ((beg (and (string-match "\\`<pre[^>]*>\n?" code) (match-end 0)))
|
2013-02-25 18:29:04 -05:00
|
|
|
|
(end (and beg (string-match "</pre>\\'" code))))
|
|
|
|
|
(if (and beg end) (substring code beg end) code)))))))))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-do-format-code
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(code &optional lang refs retain-labels num-start wrap-lines)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Format CODE string as source code.
|
2019-10-08 14:15:06 -04:00
|
|
|
|
Optional arguments LANG, REFS, RETAIN-LABELS, NUM-START, WRAP-LINES
|
|
|
|
|
are, respectively, the language of the source code, as a string, an
|
2012-12-09 06:16:37 -05:00
|
|
|
|
alist between line numbers and references (as returned by
|
|
|
|
|
`org-export-unravel-code'), a boolean specifying if labels should
|
2019-10-08 14:15:06 -04:00
|
|
|
|
appear in the source code, the number associated to the first
|
|
|
|
|
line of code, and a boolean specifying if lines of code should be
|
|
|
|
|
wrapped in code elements."
|
2017-12-03 18:42:13 -05:00
|
|
|
|
(let* ((code-lines (split-string code "\n"))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(code-length (length code-lines))
|
|
|
|
|
(num-fmt
|
|
|
|
|
(and num-start
|
|
|
|
|
(format "%%%ds: "
|
|
|
|
|
(length (number-to-string (+ code-length num-start))))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(code (org-html-fontify-code code lang)))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(org-export-format-code
|
|
|
|
|
code
|
|
|
|
|
(lambda (loc line-num ref)
|
|
|
|
|
(setq loc
|
|
|
|
|
(concat
|
|
|
|
|
;; Add line number, if needed.
|
|
|
|
|
(when num-start
|
|
|
|
|
(format "<span class=\"linenr\">%s</span>"
|
|
|
|
|
(format num-fmt line-num)))
|
|
|
|
|
;; Transcoded src line.
|
2019-10-08 14:15:06 -04:00
|
|
|
|
(if wrap-lines
|
|
|
|
|
(format "<code%s>%s</code>"
|
|
|
|
|
(if num-start
|
|
|
|
|
(format " data-ox-html-linenr=\"%s\"" line-num)
|
|
|
|
|
"")
|
|
|
|
|
loc)
|
|
|
|
|
loc)
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;; Add label, if needed.
|
|
|
|
|
(when (and ref retain-labels) (format " (%s)" ref))))
|
|
|
|
|
;; Mark transcoded line as an anchor, if needed.
|
|
|
|
|
(if (not ref) loc
|
|
|
|
|
(format "<span id=\"coderef-%s\" class=\"coderef-off\">%s</span>"
|
|
|
|
|
ref loc)))
|
|
|
|
|
num-start refs)))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-code (element info)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Format contents of ELEMENT as source code.
|
2018-09-20 05:23:49 -04:00
|
|
|
|
ELEMENT is either an example or a source block. INFO is a plist
|
|
|
|
|
used as a communication channel."
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(let* ((lang (org-element-property :language element))
|
|
|
|
|
;; Extract code and references.
|
|
|
|
|
(code-info (org-export-unravel-code element))
|
|
|
|
|
(code (car code-info))
|
|
|
|
|
(refs (cdr code-info))
|
2018-09-20 05:23:49 -04:00
|
|
|
|
;; Does the source block contain labels?
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(retain-labels (org-element-property :retain-labels element))
|
|
|
|
|
;; Does it have line numbers?
|
2019-10-08 14:15:06 -04:00
|
|
|
|
(num-start (org-export-get-loc element info))
|
|
|
|
|
;; Should lines be wrapped in code elements?
|
|
|
|
|
(wrap-lines (plist-get info :html-wrap-src-lines)))
|
|
|
|
|
(org-html-do-format-code code lang refs retain-labels num-start wrap-lines)))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
|
2013-02-24 09:57:46 -05:00
|
|
|
|
|
|
|
|
|
;;; Tables of Contents
|
|
|
|
|
|
2014-10-25 11:14:34 -04:00
|
|
|
|
(defun org-html-toc (depth info &optional scope)
|
2013-02-24 09:57:46 -05:00
|
|
|
|
"Build a table of contents.
|
2014-10-25 11:14:34 -04:00
|
|
|
|
DEPTH is an integer specifying the depth of the table. INFO is
|
|
|
|
|
a plist used as a communication channel. Optional argument SCOPE
|
|
|
|
|
is an element defining the scope of the table. Return the table
|
|
|
|
|
of contents as a string, or nil if it is empty."
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(let ((toc-entries
|
|
|
|
|
(mapcar (lambda (headline)
|
|
|
|
|
(cons (org-html--format-toc-headline headline info)
|
|
|
|
|
(org-export-get-relative-level headline info)))
|
2014-10-25 11:14:34 -04:00
|
|
|
|
(org-export-collect-headlines info depth scope))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(when toc-entries
|
2021-06-22 16:16:52 -04:00
|
|
|
|
(let ((toc (concat "<div id=\"text-table-of-contents\" role=\"doc-toc\">"
|
2014-10-25 11:14:34 -04:00
|
|
|
|
(org-html--toc-text toc-entries)
|
|
|
|
|
"</div>\n")))
|
|
|
|
|
(if scope toc
|
2015-08-19 05:07:06 -04:00
|
|
|
|
(let ((outer-tag (if (org-html--html5-fancy-p info)
|
2014-10-25 11:14:34 -04:00
|
|
|
|
"nav"
|
|
|
|
|
"div")))
|
2021-06-22 16:16:52 -04:00
|
|
|
|
(concat (format "<%s id=\"table-of-contents\" role=\"doc-toc\">\n" outer-tag)
|
2014-10-25 11:14:34 -04:00
|
|
|
|
(let ((top-level (plist-get info :html-toplevel-hlevel)))
|
|
|
|
|
(format "<h%d>%s</h%d>\n"
|
|
|
|
|
top-level
|
|
|
|
|
(org-html--translate "Table of Contents" info)
|
|
|
|
|
top-level))
|
|
|
|
|
toc
|
|
|
|
|
(format "</%s>\n" outer-tag))))))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
|
|
|
|
|
(defun org-html--toc-text (toc-entries)
|
|
|
|
|
"Return innards of a table of contents, as a string.
|
|
|
|
|
TOC-ENTRIES is an alist where key is an entry title, as a string,
|
|
|
|
|
and value is its relative level, as an integer."
|
|
|
|
|
(let* ((prev-level (1- (cdar toc-entries)))
|
|
|
|
|
(start-level prev-level))
|
|
|
|
|
(concat
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (entry)
|
|
|
|
|
(let ((headline (car entry))
|
|
|
|
|
(level (cdr entry)))
|
|
|
|
|
(concat
|
|
|
|
|
(let* ((cnt (- level prev-level))
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(times (if (> cnt 0) (1- cnt) (- cnt))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(setq prev-level level)
|
|
|
|
|
(concat
|
|
|
|
|
(org-html--make-string
|
|
|
|
|
times (cond ((> cnt 0) "\n<ul>\n<li>")
|
|
|
|
|
((< cnt 0) "</li>\n</ul>\n")))
|
|
|
|
|
(if (> cnt 0) "\n<ul>\n<li>" "</li>\n<li>")))
|
|
|
|
|
headline)))
|
|
|
|
|
toc-entries "")
|
|
|
|
|
(org-html--make-string (- prev-level start-level) "</li>\n</ul>\n"))))
|
|
|
|
|
|
2013-02-24 10:03:58 -05:00
|
|
|
|
(defun org-html--format-toc-headline (headline info)
|
2013-02-24 09:57:46 -05:00
|
|
|
|
"Return an appropriate table of contents entry for HEADLINE.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2013-11-22 03:26:58 -05:00
|
|
|
|
(let* ((headline-number (org-export-get-headline-number headline info))
|
|
|
|
|
(todo (and (plist-get info :with-todo-keywords)
|
2013-11-06 09:26:53 -05:00
|
|
|
|
(let ((todo (org-element-property :todo-keyword headline)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
|
|
|
|
(todo-type (and todo (org-element-property :todo-type headline)))
|
|
|
|
|
(priority (and (plist-get info :with-priority)
|
|
|
|
|
(org-element-property :priority headline)))
|
|
|
|
|
(text (org-export-data-with-backend
|
|
|
|
|
(org-export-get-alt-title headline info)
|
2017-10-14 06:29:52 -04:00
|
|
|
|
(org-export-toc-entry-backend 'html)
|
2013-11-06 09:26:53 -05:00
|
|
|
|
info))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(tags (and (eq (plist-get info :with-tags) t)
|
|
|
|
|
(org-export-get-tags headline info))))
|
|
|
|
|
(format "<a href=\"#%s\">%s</a>"
|
2013-11-22 03:26:58 -05:00
|
|
|
|
;; Label.
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(org-html--reference headline info)
|
2013-11-22 03:26:58 -05:00
|
|
|
|
;; Body.
|
|
|
|
|
(concat
|
|
|
|
|
(and (not (org-export-low-level-p headline info))
|
|
|
|
|
(org-export-numbered-headline-p headline info)
|
|
|
|
|
(concat (mapconcat #'number-to-string headline-number ".")
|
|
|
|
|
". "))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(apply (plist-get info :html-format-headline-function)
|
2013-11-22 03:26:58 -05:00
|
|
|
|
todo todo-type priority text tags :section-number nil)))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
|
|
|
|
|
(defun org-html-list-of-listings (info)
|
|
|
|
|
"Build a list of listings.
|
|
|
|
|
INFO is a plist used as a communication channel. Return the list
|
|
|
|
|
of listings as a string, or nil if it is empty."
|
|
|
|
|
(let ((lol-entries (org-export-collect-listings info)))
|
|
|
|
|
(when lol-entries
|
|
|
|
|
(concat "<div id=\"list-of-listings\">\n"
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((top-level (plist-get info :html-toplevel-hlevel)))
|
|
|
|
|
(format "<h%d>%s</h%d>\n"
|
|
|
|
|
top-level
|
|
|
|
|
(org-html--translate "List of Listings" info)
|
|
|
|
|
top-level))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
"<div id=\"text-list-of-listings\">\n<ul>\n"
|
|
|
|
|
(let ((count 0)
|
2013-07-03 17:51:56 -04:00
|
|
|
|
(initial-fmt (format "<span class=\"listing-number\">%s</span>"
|
|
|
|
|
(org-html--translate "Listing %d:" info))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (entry)
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let ((label (org-html--reference entry info t))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(title (org-trim
|
|
|
|
|
(org-export-data
|
|
|
|
|
(or (org-export-get-caption entry t)
|
|
|
|
|
(org-export-get-caption entry))
|
|
|
|
|
info))))
|
|
|
|
|
(concat
|
|
|
|
|
"<li>"
|
|
|
|
|
(if (not label)
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(concat (format initial-fmt (cl-incf count))
|
|
|
|
|
" "
|
|
|
|
|
title)
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(format "<a href=\"#%s\">%s %s</a>"
|
2015-04-13 05:24:42 -04:00
|
|
|
|
label
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(format initial-fmt (cl-incf count))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
title))
|
|
|
|
|
"</li>")))
|
|
|
|
|
lol-entries "\n"))
|
|
|
|
|
"\n</ul>\n</div>\n</div>"))))
|
|
|
|
|
|
|
|
|
|
(defun org-html-list-of-tables (info)
|
|
|
|
|
"Build a list of tables.
|
|
|
|
|
INFO is a plist used as a communication channel. Return the list
|
|
|
|
|
of tables as a string, or nil if it is empty."
|
|
|
|
|
(let ((lol-entries (org-export-collect-tables info)))
|
|
|
|
|
(when lol-entries
|
|
|
|
|
(concat "<div id=\"list-of-tables\">\n"
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((top-level (plist-get info :html-toplevel-hlevel)))
|
|
|
|
|
(format "<h%d>%s</h%d>\n"
|
|
|
|
|
top-level
|
|
|
|
|
(org-html--translate "List of Tables" info)
|
|
|
|
|
top-level))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
"<div id=\"text-list-of-tables\">\n<ul>\n"
|
|
|
|
|
(let ((count 0)
|
2013-07-03 17:51:56 -04:00
|
|
|
|
(initial-fmt (format "<span class=\"table-number\">%s</span>"
|
|
|
|
|
(org-html--translate "Table %d:" info))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (entry)
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let ((label (org-html--reference entry info t))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(title (org-trim
|
|
|
|
|
(org-export-data
|
|
|
|
|
(or (org-export-get-caption entry t)
|
|
|
|
|
(org-export-get-caption entry))
|
|
|
|
|
info))))
|
|
|
|
|
(concat
|
|
|
|
|
"<li>"
|
|
|
|
|
(if (not label)
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(concat (format initial-fmt (cl-incf count))
|
|
|
|
|
" "
|
|
|
|
|
title)
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(format "<a href=\"#%s\">%s %s</a>"
|
2015-04-13 05:24:42 -04:00
|
|
|
|
label
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(format initial-fmt (cl-incf count))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
title))
|
|
|
|
|
"</li>")))
|
|
|
|
|
lol-entries "\n"))
|
|
|
|
|
"\n</ul>\n</div>\n</div>"))))
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;; Transcode Functions
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Bold
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-bold (_bold contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode BOLD from Org to HTML.
|
|
|
|
|
CONTENTS is the text with bold markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format (or (cdr (assq 'bold (plist-get info :html-text-markup-alist))) "%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
contents))
|
|
|
|
|
|
|
|
|
|
;;;; Center Block
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-center-block (_center-block contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a CENTER-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2015-08-25 19:14:15 -04:00
|
|
|
|
(format "<div class=\"org-center\">\n%s</div>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-04-28 20:11:22 -04:00
|
|
|
|
;;;; Clock
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-clock (clock _contents _info)
|
2012-04-28 20:11:22 -04:00
|
|
|
|
"Transcode a CLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
|
|
|
|
(format "<p>
|
|
|
|
|
<span class=\"timestamp-wrapper\">
|
|
|
|
|
<span class=\"timestamp-kwd\">%s</span> <span class=\"timestamp\">%s</span>%s
|
|
|
|
|
</span>
|
|
|
|
|
</p>"
|
|
|
|
|
org-clock-string
|
2014-12-03 11:09:43 -05:00
|
|
|
|
(org-timestamp-translate (org-element-property :value clock))
|
2012-10-30 16:59:50 -04:00
|
|
|
|
(let ((time (org-element-property :duration clock)))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
(and time (format " <span class=\"timestamp\">(%s)</span>" time)))))
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Code
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-code (code _contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode CODE from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format (or (cdr (assq 'code (plist-get info :html-text-markup-alist))) "%s")
|
2013-06-06 14:55:33 -04:00
|
|
|
|
(org-html-encode-plain-text (org-element-property :value code))))
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Drawer
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-drawer (drawer contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a DRAWER element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(funcall (plist-get info :html-format-drawer-function)
|
|
|
|
|
(org-element-property :drawer-name drawer)
|
|
|
|
|
contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Dynamic Block
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-dynamic-block (_dynamic-block contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a DYNAMIC-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
holding contextual information. See `org-export-data'."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
contents)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Entity
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-entity (entity _contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an ENTITY object from Org to HTML.
|
|
|
|
|
CONTENTS are the definition itself. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(org-element-property :html entity))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Example Block
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-example-block (example-block _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a EXAMPLE-BLOCK element from Org to HTML.
|
2012-12-09 06:16:37 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2016-03-28 15:06:50 -04:00
|
|
|
|
(let ((attributes (org-export-read-attribute :attr_html example-block)))
|
|
|
|
|
(if (plist-get attributes :textarea)
|
|
|
|
|
(org-html--textarea-block example-block)
|
2024-02-03 09:07:32 -05:00
|
|
|
|
(if-let ((class-val (plist-get attributes :class)))
|
|
|
|
|
(setq attributes (plist-put attributes :class (concat "example " class-val)))
|
|
|
|
|
(setq attributes (plist-put attributes :class "example")))
|
|
|
|
|
(format "<pre%s>\n%s</pre>"
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let* ((reference (org-html--reference example-block info))
|
2016-03-28 15:06:50 -04:00
|
|
|
|
(a (org-html--make-attribute-string
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(if (or (not reference) (plist-member attributes :id))
|
2016-03-28 15:06:50 -04:00
|
|
|
|
attributes
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(plist-put attributes :id reference)))))
|
2016-03-28 15:06:50 -04:00
|
|
|
|
(if (org-string-nw-p a) (concat " " a) ""))
|
|
|
|
|
(org-html-format-code example-block info)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Export Snippet
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-export-snippet (export-snippet _contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a EXPORT-SNIPPET object from Org to HTML.
|
2012-12-09 06:16:37 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(when (eq (org-export-snippet-backend export-snippet) 'html)
|
2012-02-23 12:10:14 -05:00
|
|
|
|
(org-element-property :value export-snippet)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2014-09-08 05:57:27 -04:00
|
|
|
|
;;;; Export Block
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-export-block (export-block _contents _info)
|
2014-09-08 05:57:27 -04:00
|
|
|
|
"Transcode a EXPORT-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(when (string= (org-element-property :type export-block) "HTML")
|
|
|
|
|
(org-remove-indentation (org-element-property :value export-block))))
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Fixed Width
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-fixed-width (fixed-width _contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a FIXED-WIDTH element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(format "<pre class=\"example\">\n%s</pre>"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-do-format-code
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(org-remove-indentation
|
|
|
|
|
(org-element-property :value fixed-width)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Footnote Reference
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-footnote-reference (footnote-reference _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a FOOTNOTE-REFERENCE element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(concat
|
|
|
|
|
;; Insert separator between two footnotes in a row.
|
2012-07-27 10:13:57 -04:00
|
|
|
|
(let ((prev (org-export-get-previous-element footnote-reference info)))
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(when (org-element-type-p prev 'footnote-reference)
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(plist-get info :html-footnote-separator)))
|
|
|
|
|
(let* ((n (org-export-get-footnote-number footnote-reference info))
|
|
|
|
|
(id (format "fnr.%d%s"
|
|
|
|
|
n
|
|
|
|
|
(if (org-export-footnote-first-reference-p
|
|
|
|
|
footnote-reference info)
|
|
|
|
|
""
|
|
|
|
|
".100"))))
|
|
|
|
|
(format
|
|
|
|
|
(plist-get info :html-footnote-format)
|
|
|
|
|
(org-html--anchor
|
2021-06-22 16:16:52 -04:00
|
|
|
|
id n (format " class=\"footref\" href=\"#fn.%d\" role=\"doc-backlink\"" n) info)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Headline
|
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defun org-html-headline (headline contents info)
|
2013-02-23 07:47:44 -05:00
|
|
|
|
"Transcode a HEADLINE element from Org to HTML.
|
2012-02-19 10:57:05 -05:00
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2014-09-18 15:37:07 -04:00
|
|
|
|
(unless (org-element-property :footnote-section-p headline)
|
2014-09-18 16:08:30 -04:00
|
|
|
|
(let* ((numberedp (org-export-numbered-headline-p headline info))
|
|
|
|
|
(numbers (org-export-get-headline-number headline info))
|
|
|
|
|
(level (+ (org-export-get-relative-level headline info)
|
|
|
|
|
(1- (plist-get info :html-toplevel-hlevel))))
|
|
|
|
|
(todo (and (plist-get info :with-todo-keywords)
|
|
|
|
|
(let ((todo (org-element-property :todo-keyword headline)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
|
|
|
|
(todo-type (and todo (org-element-property :todo-type headline)))
|
|
|
|
|
(priority (and (plist-get info :with-priority)
|
|
|
|
|
(org-element-property :priority headline)))
|
|
|
|
|
(text (org-export-data (org-element-property :title headline) info))
|
|
|
|
|
(tags (and (plist-get info :with-tags)
|
|
|
|
|
(org-export-get-tags headline info)))
|
|
|
|
|
(full-text (funcall (plist-get info :html-format-headline-function)
|
|
|
|
|
todo todo-type priority text tags info))
|
|
|
|
|
(contents (or contents ""))
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(id (org-html--reference headline info))
|
2018-12-16 15:55:40 -05:00
|
|
|
|
(formatted-text
|
|
|
|
|
(if (plist-get info :html-self-link-headlines)
|
|
|
|
|
(format "<a href=\"#%s\">%s</a>" id full-text)
|
|
|
|
|
full-text)))
|
2014-09-18 15:37:07 -04:00
|
|
|
|
(if (org-export-low-level-p headline info)
|
2014-09-18 16:08:30 -04:00
|
|
|
|
;; This is a deep sub-tree: export it as a list item.
|
2017-02-13 11:52:38 -05:00
|
|
|
|
(let* ((html-type (if numberedp "ol" "ul")))
|
|
|
|
|
(concat
|
|
|
|
|
(and (org-export-first-sibling-p headline info)
|
2017-02-14 06:03:16 -05:00
|
|
|
|
(apply #'format "<%s class=\"org-%s\">\n"
|
2017-02-13 11:52:38 -05:00
|
|
|
|
(make-list 2 html-type)))
|
|
|
|
|
(org-html-format-list-item
|
2017-09-09 18:16:12 -04:00
|
|
|
|
contents (if numberedp 'ordered 'unordered)
|
|
|
|
|
nil info nil
|
2018-12-16 15:55:40 -05:00
|
|
|
|
(concat (org-html--anchor id nil nil info) formatted-text)) "\n"
|
2017-02-13 11:52:38 -05:00
|
|
|
|
(and (org-export-last-sibling-p headline info)
|
2017-02-14 06:03:16 -05:00
|
|
|
|
(format "</%s>\n" html-type))))
|
2017-02-13 11:52:38 -05:00
|
|
|
|
;; Standard headline. Export it as a section.
|
2018-12-02 14:25:38 -05:00
|
|
|
|
(let ((extra-class
|
|
|
|
|
(org-element-property :HTML_CONTAINER_CLASS headline))
|
|
|
|
|
(headline-class
|
|
|
|
|
(org-element-property :HTML_HEADLINE_CLASS headline))
|
2014-09-18 16:08:30 -04:00
|
|
|
|
(first-content (car (org-element-contents headline))))
|
|
|
|
|
(format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n"
|
|
|
|
|
(org-html--container headline info)
|
2020-02-12 13:00:42 -05:00
|
|
|
|
(format "outline-container-%s" id)
|
2014-09-18 16:08:30 -04:00
|
|
|
|
(concat (format "outline-%d" level)
|
|
|
|
|
(and extra-class " ")
|
|
|
|
|
extra-class)
|
2018-12-02 14:25:38 -05:00
|
|
|
|
(format "\n<h%d id=\"%s\"%s>%s</h%d>\n"
|
2014-09-18 16:08:30 -04:00
|
|
|
|
level
|
2017-09-09 18:16:12 -04:00
|
|
|
|
id
|
2018-12-02 14:25:38 -05:00
|
|
|
|
(if (not headline-class) ""
|
|
|
|
|
(format " class=\"%s\"" headline-class))
|
2014-09-18 16:08:30 -04:00
|
|
|
|
(concat
|
|
|
|
|
(and numberedp
|
|
|
|
|
(format
|
|
|
|
|
"<span class=\"section-number-%d\">%s</span> "
|
|
|
|
|
level
|
2021-05-03 13:10:52 -04:00
|
|
|
|
(concat (mapconcat #'number-to-string numbers ".") ".")))
|
2018-12-16 15:55:40 -05:00
|
|
|
|
formatted-text)
|
2014-09-18 16:08:30 -04:00
|
|
|
|
level)
|
|
|
|
|
;; When there is no section, pretend there is an
|
|
|
|
|
;; empty one to get the correct <div
|
|
|
|
|
;; class="outline-...> which is needed by
|
|
|
|
|
;; `org-info.js'.
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(if (org-element-type-p first-content 'section) contents
|
2014-09-18 16:08:30 -04:00
|
|
|
|
(concat (org-html-section first-content "" info) contents))
|
|
|
|
|
(org-html--container headline info)))))))
|
2013-04-15 13:59:16 -04:00
|
|
|
|
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(defun org-html-format-headline-default-function
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(todo _todo-type priority text tags info)
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
"Default format function for a headline.
|
2023-12-10 06:52:16 -05:00
|
|
|
|
See `org-html-format-headline-function' for details and the
|
|
|
|
|
description of TODO, PRIORITY, TEXT, TAGS, and INFO arguments."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((todo (org-html--todo todo info))
|
2015-01-10 04:21:54 -05:00
|
|
|
|
(priority (org-html--priority priority info))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(tags (org-html--tags tags info)))
|
2015-01-10 04:21:54 -05:00
|
|
|
|
(concat todo (and todo " ")
|
|
|
|
|
priority (and priority " ")
|
|
|
|
|
text
|
|
|
|
|
(and tags "   ") tags)))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
|
2013-04-15 13:59:16 -04:00
|
|
|
|
(defun org-html--container (headline info)
|
2023-12-10 06:52:16 -05:00
|
|
|
|
"Return HTML container name for HEADLINE as a string.
|
|
|
|
|
INFO is the info plist."
|
2013-04-15 13:59:16 -04:00
|
|
|
|
(or (org-element-property :HTML_CONTAINER headline)
|
|
|
|
|
(if (= 1 (org-export-get-relative-level headline info))
|
|
|
|
|
(plist-get info :html-container)
|
|
|
|
|
"div")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Horizontal Rule
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-horizontal-rule (_horizontal-rule _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an HORIZONTAL-RULE object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(org-html-close-tag "hr" nil info))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Inline Src Block
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-inline-src-block (inline-src-block _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an INLINE-SRC-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-05-15 11:35:52 -04:00
|
|
|
|
(let* ((lang (org-element-property :language inline-src-block))
|
|
|
|
|
(code (org-html-fontify-code
|
|
|
|
|
(org-element-property :value inline-src-block)
|
|
|
|
|
lang))
|
|
|
|
|
(label
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let ((lbl (org-html--reference inline-src-block info t)))
|
2017-05-15 11:35:52 -04:00
|
|
|
|
(if (not lbl) "" (format " id=\"%s\"" lbl)))))
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(format "<code class=\"src src-%s\"%s>%s</code>" lang label code)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Inlinetask
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-inlinetask (inlinetask contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an INLINETASK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let* ((todo (and (plist-get info :with-todo-keywords)
|
|
|
|
|
(let ((todo (org-element-property :todo-keyword inlinetask)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
|
|
|
|
(todo-type (and todo (org-element-property :todo-type inlinetask)))
|
|
|
|
|
(priority (and (plist-get info :with-priority)
|
|
|
|
|
(org-element-property :priority inlinetask)))
|
|
|
|
|
(text (org-export-data (org-element-property :title inlinetask) info))
|
|
|
|
|
(tags (and (plist-get info :with-tags)
|
|
|
|
|
(org-export-get-tags inlinetask info))))
|
|
|
|
|
(funcall (plist-get info :html-format-inlinetask-function)
|
2014-10-25 20:48:27 -04:00
|
|
|
|
todo todo-type priority text tags contents info)))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
|
|
|
|
|
(defun org-html-format-inlinetask-default-function
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(todo todo-type priority text tags contents info)
|
2018-02-16 15:16:15 -05:00
|
|
|
|
"Default format function for inlinetasks.
|
2023-12-10 06:52:16 -05:00
|
|
|
|
See `org-html-format-inlinetask-function' for details and the
|
|
|
|
|
description of TODO, TODO-TYPE, PRIORITY, TEXT, TAGS, CONTENTS, and
|
|
|
|
|
INFO arguments."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format "<div class=\"inlinetask\">\n<b>%s</b>%s\n%s</div>"
|
|
|
|
|
(org-html-format-headline-default-function
|
|
|
|
|
todo todo-type priority text tags info)
|
|
|
|
|
(org-html-close-tag "br" nil info)
|
|
|
|
|
contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Italic
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-italic (_italic contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode ITALIC from Org to HTML.
|
|
|
|
|
CONTENTS is the text with italic markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format
|
|
|
|
|
(or (cdr (assq 'italic (plist-get info :html-text-markup-alist))) "%s")
|
|
|
|
|
contents))
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Item
|
|
|
|
|
|
2013-12-03 14:37:30 -05:00
|
|
|
|
(defun org-html-checkbox (checkbox info)
|
2014-01-10 03:48:57 -05:00
|
|
|
|
"Format CHECKBOX into HTML.
|
|
|
|
|
INFO is a plist holding contextual information. See
|
|
|
|
|
`org-html-checkbox-type' for customization options."
|
|
|
|
|
(cdr (assq checkbox
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(cdr (assq (plist-get info :html-checkbox-type)
|
|
|
|
|
org-html-checkbox-types)))))
|
2012-02-29 03:39:14 -05:00
|
|
|
|
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(defun org-html-format-list-item (contents type checkbox info
|
2016-07-20 16:02:50 -04:00
|
|
|
|
&optional term-counter-id
|
|
|
|
|
headline)
|
2023-12-11 06:59:27 -05:00
|
|
|
|
"Format a list item into HTML.
|
|
|
|
|
CONTENTS is the item contents. TYPE is one of symbols `ordered',
|
|
|
|
|
`unordered', or `descriptive'. CHECKBOX checkbox type is nil or one of
|
|
|
|
|
symbols `on', `off', or `trans'. INFO is the info plist."
|
2014-04-17 12:40:26 -04:00
|
|
|
|
(let ((class (if checkbox
|
|
|
|
|
(format " class=\"%s\""
|
|
|
|
|
(symbol-name checkbox)) ""))
|
2014-04-16 13:39:20 -04:00
|
|
|
|
(checkbox (concat (org-html-checkbox checkbox info)
|
2013-12-03 14:37:30 -05:00
|
|
|
|
(and checkbox " ")))
|
2017-02-14 06:03:16 -05:00
|
|
|
|
(br (org-html-close-tag "br" nil info))
|
|
|
|
|
(extra-newline (if (and (org-string-nw-p contents) headline) "\n" "")))
|
2012-06-09 09:34:27 -04:00
|
|
|
|
(concat
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(pcase type
|
|
|
|
|
(`ordered
|
2012-06-09 09:34:27 -04:00
|
|
|
|
(let* ((counter term-counter-id)
|
|
|
|
|
(extra (if counter (format " value=\"%s\"" counter) "")))
|
2012-09-10 19:21:24 -04:00
|
|
|
|
(concat
|
2014-04-17 12:40:26 -04:00
|
|
|
|
(format "<li%s%s>" class extra)
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(when headline (concat headline br)))))
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(`unordered
|
2012-06-09 09:34:27 -04:00
|
|
|
|
(let* ((id term-counter-id)
|
|
|
|
|
(extra (if id (format " id=\"%s\"" id) "")))
|
|
|
|
|
(concat
|
2014-04-17 12:40:26 -04:00
|
|
|
|
(format "<li%s%s>" class extra)
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(when headline (concat headline br)))))
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(`descriptive
|
2012-06-09 09:34:27 -04:00
|
|
|
|
(let* ((term term-counter-id))
|
|
|
|
|
(setq term (or term "(no term)"))
|
|
|
|
|
;; Check-boxes in descriptive lists are associated to tag.
|
2014-04-17 12:40:26 -04:00
|
|
|
|
(concat (format "<dt%s>%s</dt>"
|
2014-04-16 13:39:20 -04:00
|
|
|
|
class (concat checkbox term))
|
2012-06-09 09:34:27 -04:00
|
|
|
|
"<dd>"))))
|
|
|
|
|
(unless (eq type 'descriptive) checkbox)
|
2017-02-14 06:03:16 -05:00
|
|
|
|
extra-newline
|
|
|
|
|
(and (org-string-nw-p contents) (org-trim contents))
|
|
|
|
|
extra-newline
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(pcase type
|
|
|
|
|
(`ordered "</li>")
|
|
|
|
|
(`unordered "</li>")
|
|
|
|
|
(`descriptive "</dd>")))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-item (item contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an ITEM element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2023-05-03 08:56:35 -04:00
|
|
|
|
(let* ((plain-list (org-element-parent item))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(type (org-element-property :type plain-list))
|
|
|
|
|
(counter (org-element-property :counter item))
|
|
|
|
|
(checkbox (org-element-property :checkbox item))
|
|
|
|
|
(tag (let ((tag (org-element-property :tag item)))
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(and tag (org-export-data tag info)))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-list-item
|
2013-05-02 17:07:38 -04:00
|
|
|
|
contents type checkbox info (or tag counter))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Keyword
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-keyword (keyword _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a KEYWORD element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(let ((key (org-element-property :key keyword))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(value (org-element-property :value keyword)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
2012-08-23 15:24:38 -04:00
|
|
|
|
((string= key "HTML") value)
|
2012-03-28 08:04:26 -04:00
|
|
|
|
((string= key "TOC")
|
2014-10-25 11:14:34 -04:00
|
|
|
|
(let ((case-fold-search t))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
|
|
|
|
((string-match "\\<headlines\\>" value)
|
2014-10-25 11:14:34 -04:00
|
|
|
|
(let ((depth (and (string-match "\\<[0-9]+\\>" value)
|
|
|
|
|
(string-to-number (match-string 0 value))))
|
2019-05-15 14:22:05 -04:00
|
|
|
|
(scope
|
|
|
|
|
(cond
|
|
|
|
|
((string-match ":target +\\(\".+?\"\\|\\S-+\\)" value) ;link
|
|
|
|
|
(org-export-resolve-link
|
|
|
|
|
(org-strip-quotes (match-string 1 value)) info))
|
|
|
|
|
((string-match-p "\\<local\\>" value) keyword)))) ;local
|
|
|
|
|
(org-html-toc depth info scope)))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
((string= "listings" value) (org-html-list-of-listings info))
|
|
|
|
|
((string= "tables" value) (org-html-list-of-tables info))))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2023-03-05 16:01:11 -05:00
|
|
|
|
;;;; LaTeX Environment
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-12-03 14:52:22 -05:00
|
|
|
|
(defun org-html-format-latex (latex-frag processing-type info)
|
|
|
|
|
"Format a LaTeX fragment LATEX-FRAG into HTML.
|
2016-05-19 10:01:24 -04:00
|
|
|
|
PROCESSING-TYPE designates the tool used for conversion. It can
|
2020-02-16 19:52:02 -05:00
|
|
|
|
be `mathjax', `verbatim', `html', nil, t or symbols in
|
2016-05-19 10:01:24 -04:00
|
|
|
|
`org-preview-latex-process-alist', e.g., `dvipng', `dvisvgm' or
|
|
|
|
|
`imagemagick'. See `org-html-with-latex' for more information.
|
|
|
|
|
INFO is a plist containing export properties."
|
2013-05-14 12:50:06 -04:00
|
|
|
|
(let ((cache-relpath "") (cache-dir ""))
|
2020-02-16 19:52:02 -05:00
|
|
|
|
(unless (or (eq processing-type 'mathjax)
|
|
|
|
|
(eq processing-type 'html))
|
2013-05-14 12:50:06 -04:00
|
|
|
|
(let ((bfn (or (buffer-file-name)
|
|
|
|
|
(make-temp-name
|
2013-12-03 14:52:22 -05:00
|
|
|
|
(expand-file-name "latex" temporary-file-directory))))
|
|
|
|
|
(latex-header
|
|
|
|
|
(let ((header (plist-get info :latex-header)))
|
|
|
|
|
(and header
|
|
|
|
|
(concat (mapconcat
|
|
|
|
|
(lambda (line) (concat "#+LATEX_HEADER: " line))
|
|
|
|
|
(org-split-string header "\n")
|
|
|
|
|
"\n")
|
|
|
|
|
"\n")))))
|
2013-05-14 12:50:06 -04:00
|
|
|
|
(setq cache-relpath
|
2016-05-19 10:01:24 -04:00
|
|
|
|
(concat (file-name-as-directory org-preview-latex-image-directory)
|
2013-05-14 12:50:06 -04:00
|
|
|
|
(file-name-sans-extension
|
|
|
|
|
(file-name-nondirectory bfn)))
|
2013-12-03 14:52:22 -05:00
|
|
|
|
cache-dir (file-name-directory bfn))
|
|
|
|
|
;; Re-create LaTeX environment from original buffer in
|
|
|
|
|
;; temporary buffer so that dvipng/imagemagick can properly
|
|
|
|
|
;; turn the fragment into an image.
|
|
|
|
|
(setq latex-frag (concat latex-header latex-frag))))
|
2022-10-09 02:16:41 -04:00
|
|
|
|
(org-export-with-buffer-copy
|
|
|
|
|
:to-buffer (get-buffer-create " *Org HTML Export LaTeX*")
|
|
|
|
|
:drop-visibility t :drop-narrowing t :drop-contents t
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert latex-frag)
|
|
|
|
|
(org-format-latex cache-relpath nil nil cache-dir nil
|
|
|
|
|
"Creating LaTeX Image..." nil processing-type)
|
|
|
|
|
(buffer-string))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(defun org-html--wrap-latex-environment (contents _ &optional caption label)
|
|
|
|
|
"Wrap CONTENTS string within appropriate environment for equations.
|
|
|
|
|
When optional arguments CAPTION and LABEL are given, use them for
|
|
|
|
|
caption and \"id\" attribute."
|
|
|
|
|
(format "\n<div%s class=\"equation-container\">\n%s%s\n</div>"
|
|
|
|
|
;; ID.
|
|
|
|
|
(if (org-string-nw-p label) (format " id=\"%s\"" label) "")
|
|
|
|
|
;; Contents.
|
|
|
|
|
(format "<span class=\"equation\">\n%s\n</span>" contents)
|
|
|
|
|
;; Caption.
|
|
|
|
|
(if (not (org-string-nw-p caption)) ""
|
|
|
|
|
(format "\n<span class=\"equation-label\">\n%s\n</span>"
|
|
|
|
|
caption))))
|
|
|
|
|
|
|
|
|
|
(defun org-html--math-environment-p (element &optional _)
|
|
|
|
|
"Non-nil when ELEMENT is a LaTeX math environment.
|
|
|
|
|
Math environments match the regular expression defined in
|
|
|
|
|
`org-latex-math-environments-re'. This function is meant to be
|
|
|
|
|
used as a predicate for `org-export-get-ordinal' or a value to
|
|
|
|
|
`org-html-standalone-image-predicate'."
|
|
|
|
|
(string-match-p org-latex-math-environments-re
|
|
|
|
|
(org-element-property :value element)))
|
|
|
|
|
|
2019-12-09 15:29:56 -05:00
|
|
|
|
(defun org-html--latex-environment-numbered-p (element)
|
2023-12-11 06:59:27 -05:00
|
|
|
|
"Non-nil when ELEMENT is a numbered LaTeX math environment.
|
2019-12-09 15:29:56 -05:00
|
|
|
|
Starred and \"displaymath\" environments are not numbered."
|
|
|
|
|
(not (string-match-p "\\`[ \t]*\\\\begin{\\(.*\\*\\|displaymath\\)}"
|
|
|
|
|
(org-element-property :value element))))
|
|
|
|
|
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(defun org-html--unlabel-latex-environment (latex-frag)
|
|
|
|
|
"Change environment in LATEX-FRAG string to an unnumbered one.
|
2022-04-22 10:17:22 -04:00
|
|
|
|
For instance, change an `equation' environment to `equation*'."
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"\\`[ \t]*\\\\begin{\\([^*]+?\\)}"
|
|
|
|
|
"\\1*"
|
|
|
|
|
(replace-regexp-in-string "^[ \t]*\\\\end{\\([^*]+?\\)}[ \r\t\n]*\\'"
|
|
|
|
|
"\\1*"
|
|
|
|
|
latex-frag nil nil 1)
|
|
|
|
|
nil nil 1))
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-latex-environment (latex-environment _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LATEX-ENVIRONMENT element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((processing-type (plist-get info :with-latex))
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(latex-frag (org-remove-indentation
|
|
|
|
|
(org-element-property :value latex-environment)))
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(attributes (org-export-read-attribute :attr_html latex-environment))
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(label (org-html--reference latex-environment info t))
|
2019-12-09 15:29:56 -05:00
|
|
|
|
(caption (and (org-html--latex-environment-numbered-p latex-environment)
|
|
|
|
|
(number-to-string
|
|
|
|
|
(org-export-get-ordinal
|
|
|
|
|
latex-environment info nil
|
|
|
|
|
(lambda (l _)
|
|
|
|
|
(and (org-html--math-environment-p l)
|
|
|
|
|
(org-html--latex-environment-numbered-p l))))))))
|
2016-05-19 10:01:24 -04:00
|
|
|
|
(cond
|
|
|
|
|
((memq processing-type '(t mathjax))
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(org-html-format-latex
|
|
|
|
|
(if (org-string-nw-p label)
|
|
|
|
|
(replace-regexp-in-string "\\`.*"
|
|
|
|
|
(format "\\&\n\\\\label{%s}" label)
|
|
|
|
|
latex-frag)
|
|
|
|
|
latex-frag)
|
|
|
|
|
'mathjax info))
|
2016-05-19 10:01:24 -04:00
|
|
|
|
((assq processing-type org-preview-latex-process-alist)
|
|
|
|
|
(let ((formula-link
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(org-html-format-latex
|
|
|
|
|
(org-html--unlabel-latex-environment latex-frag)
|
|
|
|
|
processing-type info)))
|
|
|
|
|
(when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
|
2020-05-16 13:28:59 -04:00
|
|
|
|
(let ((source (org-export-file-uri (match-string 1 formula-link))))
|
|
|
|
|
(org-html--wrap-latex-environment
|
|
|
|
|
(org-html--format-image source attributes info)
|
|
|
|
|
info caption label)))))
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(t (org-html--wrap-latex-environment latex-frag info caption label)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2023-03-05 16:01:11 -05:00
|
|
|
|
;;;; LaTeX Fragment
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-latex-fragment (latex-fragment _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LATEX-FRAGMENT object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(let ((latex-frag (org-element-property :value latex-fragment))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(processing-type (plist-get info :with-latex)))
|
2016-05-19 10:01:24 -04:00
|
|
|
|
(cond
|
|
|
|
|
((memq processing-type '(t mathjax))
|
|
|
|
|
(org-html-format-latex latex-frag 'mathjax info))
|
2020-02-16 19:52:02 -05:00
|
|
|
|
((memq processing-type '(t html))
|
|
|
|
|
(org-html-format-latex latex-frag 'html info))
|
2016-05-19 10:01:24 -04:00
|
|
|
|
((assq processing-type org-preview-latex-process-alist)
|
|
|
|
|
(let ((formula-link
|
|
|
|
|
(org-html-format-latex latex-frag processing-type info)))
|
|
|
|
|
(when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
|
2020-05-16 13:28:59 -04:00
|
|
|
|
(let ((source (org-export-file-uri (match-string 1 formula-link))))
|
|
|
|
|
(org-html--format-image source nil info)))))
|
2016-05-19 10:01:24 -04:00
|
|
|
|
(t latex-frag))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Line Break
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-line-break (_line-break _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LINE-BREAK object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2013-05-02 17:07:38 -04:00
|
|
|
|
(concat (org-html-close-tag "br" nil info) "\n"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Link
|
|
|
|
|
|
2016-12-17 05:36:49 -05:00
|
|
|
|
(defun org-html-image-link-filter (data _backend info)
|
2023-12-11 06:59:27 -05:00
|
|
|
|
"Process image links that are inside descriptions.
|
|
|
|
|
DATA is the parse tree. INFO is and info plist.
|
|
|
|
|
See `org-export-insert-image-links' for more details."
|
2016-12-17 05:36:49 -05:00
|
|
|
|
(org-export-insert-image-links data info org-html-inline-image-rules))
|
|
|
|
|
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(defun org-html-inline-image-p (link info)
|
|
|
|
|
"Non-nil when LINK is meant to appear as an image.
|
|
|
|
|
INFO is a plist used as a communication channel. LINK is an
|
|
|
|
|
inline image when it has no description and targets an image
|
|
|
|
|
file (see `org-html-inline-image-rules' for more information), or
|
|
|
|
|
if its description is a single link targeting an image file."
|
|
|
|
|
(if (not (org-element-contents link))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(org-export-inline-image-p
|
|
|
|
|
link (plist-get info :html-inline-image-rules))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(not
|
|
|
|
|
(let ((link-count 0))
|
|
|
|
|
(org-element-map (org-element-contents link)
|
|
|
|
|
(cons 'plain-text org-element-all-objects)
|
|
|
|
|
(lambda (obj)
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(pcase (org-element-type obj)
|
|
|
|
|
(`plain-text (org-string-nw-p obj))
|
|
|
|
|
(`link (if (= link-count 1) t
|
|
|
|
|
(cl-incf link-count)
|
|
|
|
|
(not (org-export-inline-image-p
|
|
|
|
|
obj (plist-get info :html-inline-image-rules)))))
|
|
|
|
|
(_ t)))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
info t)))))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defvar org-html-standalone-image-predicate)
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(defun org-html-standalone-image-p (element info)
|
2014-05-15 07:39:28 -04:00
|
|
|
|
"Non-nil if ELEMENT is a standalone image.
|
2013-07-01 16:51:26 -04:00
|
|
|
|
|
2012-03-06 12:57:33 -05:00
|
|
|
|
INFO is a plist holding contextual information.
|
|
|
|
|
|
2014-05-15 07:39:28 -04:00
|
|
|
|
An element or object is a standalone image when
|
2012-03-06 12:57:33 -05:00
|
|
|
|
|
2014-05-15 07:39:28 -04:00
|
|
|
|
- its type is `paragraph' and its sole content, save for white
|
|
|
|
|
spaces, is a link that qualifies as an inline image;
|
2012-03-06 12:57:33 -05:00
|
|
|
|
|
2014-05-15 07:39:28 -04:00
|
|
|
|
- its type is `link' and its containing paragraph has no other
|
|
|
|
|
content save white spaces.
|
2012-03-06 12:57:33 -05:00
|
|
|
|
|
2013-07-01 16:51:26 -04:00
|
|
|
|
Bind `org-html-standalone-image-predicate' to constrain paragraph
|
|
|
|
|
further. For example, to check for only captioned standalone
|
|
|
|
|
images, set it to:
|
2012-03-06 12:57:33 -05:00
|
|
|
|
|
2015-09-17 19:08:20 -04:00
|
|
|
|
(lambda (paragraph) (org-element-property :caption paragraph))"
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(let ((paragraph (pcase (org-element-type element)
|
|
|
|
|
(`paragraph element)
|
2023-05-03 08:56:35 -04:00
|
|
|
|
(`link (org-element-parent element)))))
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(and (org-element-type-p paragraph 'paragraph)
|
2021-04-29 22:15:08 -04:00
|
|
|
|
(or (not (and (boundp 'org-html-standalone-image-predicate)
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(fboundp org-html-standalone-image-predicate)))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(funcall org-html-standalone-image-predicate paragraph))
|
2014-05-15 07:39:28 -04:00
|
|
|
|
(catch 'exit
|
|
|
|
|
(let ((link-count 0))
|
|
|
|
|
(org-element-map (org-element-contents paragraph)
|
|
|
|
|
(cons 'plain-text org-element-all-objects)
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(lambda (obj)
|
|
|
|
|
(when (pcase (org-element-type obj)
|
|
|
|
|
(`plain-text (org-string-nw-p obj))
|
|
|
|
|
(`link (or (> (cl-incf link-count) 1)
|
|
|
|
|
(not (org-html-inline-image-p obj info))))
|
|
|
|
|
(_ t))
|
|
|
|
|
(throw 'exit nil)))
|
2014-05-15 07:39:28 -04:00
|
|
|
|
info nil 'link)
|
|
|
|
|
(= link-count 1))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-link (link desc info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LINK object from Org to HTML.
|
|
|
|
|
DESC is the description part of the link, or the empty string.
|
|
|
|
|
INFO is a plist holding contextual information. See
|
|
|
|
|
`org-export-data'."
|
2020-02-11 03:30:57 -05:00
|
|
|
|
(let* ((html-ext (plist-get info :html-extension))
|
2020-02-11 17:52:17 -05:00
|
|
|
|
(dot (when (> (length html-ext) 0) "."))
|
2020-02-11 03:30:57 -05:00
|
|
|
|
(link-org-files-as-html-maybe
|
2015-09-02 15:30:59 -04:00
|
|
|
|
(lambda (raw-path info)
|
|
|
|
|
;; Treat links to `file.org' as links to `file.html', if
|
|
|
|
|
;; needed. See `org-html-link-org-files-as-html'.
|
2022-09-05 07:40:13 -04:00
|
|
|
|
(save-match-data
|
|
|
|
|
(cond
|
|
|
|
|
((and (plist-get info :html-link-org-files-as-html)
|
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(string-match "\\(.+\\)\\.org\\(?:\\.gpg\\)?$" raw-path)))
|
|
|
|
|
(concat (match-string 1 raw-path) dot html-ext))
|
|
|
|
|
(t raw-path)))))
|
2020-01-17 18:44:41 -05:00
|
|
|
|
(type (org-element-property :type link))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(raw-path (org-element-property :path link))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Ensure DESC really exists, or set it to nil.
|
2013-04-24 03:52:20 -04:00
|
|
|
|
(desc (org-string-nw-p desc))
|
2013-02-22 18:03:22 -05:00
|
|
|
|
(path
|
|
|
|
|
(cond
|
2020-02-20 03:29:21 -05:00
|
|
|
|
((string= "file" type)
|
2017-11-26 04:46:53 -05:00
|
|
|
|
;; During publishing, turn absolute file names belonging
|
|
|
|
|
;; to base directory into relative file names. Otherwise,
|
|
|
|
|
;; append "file" protocol to absolute file name.
|
2013-02-22 18:03:22 -05:00
|
|
|
|
(setq raw-path
|
2017-11-26 04:46:53 -05:00
|
|
|
|
(org-export-file-uri
|
|
|
|
|
(org-publish-file-relative-name raw-path info)))
|
|
|
|
|
;; Possibly append `:html-link-home' to relative file
|
|
|
|
|
;; name.
|
2017-11-26 04:57:02 -05:00
|
|
|
|
(let ((home (and (plist-get info :html-link-home)
|
|
|
|
|
(org-trim (plist-get info :html-link-home)))))
|
|
|
|
|
(when (and home
|
|
|
|
|
(plist-get info :html-link-use-abs-url)
|
2023-02-27 14:12:32 -05:00
|
|
|
|
(not (file-name-absolute-p raw-path)))
|
2017-11-26 04:57:02 -05:00
|
|
|
|
(setq raw-path (concat (file-name-as-directory home) raw-path))))
|
|
|
|
|
;; Maybe turn ".org" into ".html".
|
2017-11-26 04:46:53 -05:00
|
|
|
|
(setq raw-path (funcall link-org-files-as-html-maybe raw-path info))
|
2013-02-22 18:03:22 -05:00
|
|
|
|
;; Add search option, if any. A search option can be
|
2016-03-10 16:15:19 -05:00
|
|
|
|
;; relative to a custom-id, a headline title, a name or
|
|
|
|
|
;; a target.
|
2013-02-22 18:03:22 -05:00
|
|
|
|
(let ((option (org-element-property :search-option link)))
|
2017-09-09 18:16:12 -04:00
|
|
|
|
(if (not option) raw-path
|
|
|
|
|
(let ((path (org-element-property :path link)))
|
|
|
|
|
(concat raw-path
|
|
|
|
|
"#"
|
|
|
|
|
(org-publish-resolve-external-link option path t))))))
|
2024-02-05 10:39:05 -05:00
|
|
|
|
(t (url-encode-url (concat type ":" raw-path)))))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(attributes-plist
|
2018-12-08 10:44:06 -05:00
|
|
|
|
(org-combine-plists
|
|
|
|
|
;; Extract attributes from parent's paragraph. HACK: Only
|
|
|
|
|
;; do this for the first link in parent (inner image link
|
|
|
|
|
;; for inline images). This is needed as long as
|
|
|
|
|
;; attributes cannot be set on a per link basis.
|
2023-05-18 07:33:15 -04:00
|
|
|
|
(let* ((parent (org-element-parent-element link))
|
2023-05-03 08:56:35 -04:00
|
|
|
|
(link (let ((container (org-element-parent link)))
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(if (and (org-element-type-p container 'link)
|
2018-12-08 10:44:06 -05:00
|
|
|
|
(org-html-inline-image-p link info))
|
|
|
|
|
container
|
|
|
|
|
link))))
|
|
|
|
|
(and (eq link (org-element-map parent 'link #'identity info t))
|
|
|
|
|
(org-export-read-attribute :attr_html parent)))
|
|
|
|
|
;; Also add attributes from link itself. Currently, those
|
|
|
|
|
;; need to be added programmatically before `org-html-link'
|
|
|
|
|
;; is invoked, for example, by backends building upon HTML
|
|
|
|
|
;; export.
|
|
|
|
|
(org-export-read-attribute :attr_html link)))
|
2013-07-10 04:12:43 -04:00
|
|
|
|
(attributes
|
|
|
|
|
(let ((attr (org-html--make-attribute-string attributes-plist)))
|
2015-01-04 15:54:41 -05:00
|
|
|
|
(if (org-string-nw-p attr) (concat " " attr) ""))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
2015-01-04 15:54:41 -05:00
|
|
|
|
;; Link type is handled by a special function.
|
2020-02-14 04:00:15 -05:00
|
|
|
|
((org-export-custom-protocol-maybe link desc 'html info))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Image file.
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
((and (plist-get info :html-inline-images)
|
|
|
|
|
(org-export-inline-image-p
|
|
|
|
|
link (plist-get info :html-inline-image-rules)))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(org-html--format-image path attributes-plist info))
|
2012-05-18 15:06:12 -04:00
|
|
|
|
;; Radio target: Transcode target's contents and use them as
|
|
|
|
|
;; link's description.
|
2012-03-04 13:49:35 -05:00
|
|
|
|
((string= type "radio")
|
2012-05-18 05:20:00 -04:00
|
|
|
|
(let ((destination (org-export-resolve-radio-link link info)))
|
2014-08-27 18:48:17 -04:00
|
|
|
|
(if (not destination) desc
|
2012-06-08 09:25:29 -04:00
|
|
|
|
(format "<a href=\"#%s\"%s>%s</a>"
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(org-export-get-reference destination info)
|
|
|
|
|
attributes
|
|
|
|
|
desc))))
|
2013-02-23 07:47:44 -05:00
|
|
|
|
;; Links pointing to a headline: Find destination and build
|
2012-03-04 13:49:35 -05:00
|
|
|
|
;; appropriate referencing command.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
((member type '("custom-id" "fuzzy" "id"))
|
|
|
|
|
(let ((destination (if (string= type "fuzzy")
|
|
|
|
|
(org-export-resolve-fuzzy-link link info)
|
|
|
|
|
(org-export-resolve-id-link link info))))
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(pcase (org-element-type destination)
|
2012-07-07 09:54:53 -04:00
|
|
|
|
;; ID link points to an external file.
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(`plain-text
|
2024-04-10 10:02:01 -04:00
|
|
|
|
(let ((fragment (concat org-html--id-attr-prefix raw-path))
|
2012-07-07 09:54:53 -04:00
|
|
|
|
;; Treat links to ".org" files as ".html", if needed.
|
2013-03-13 07:05:15 -04:00
|
|
|
|
(path (funcall link-org-files-as-html-maybe
|
2012-07-07 09:54:53 -04:00
|
|
|
|
destination info)))
|
|
|
|
|
(format "<a href=\"%s#%s\"%s>%s</a>"
|
|
|
|
|
path fragment attributes (or desc destination))))
|
2012-03-04 13:49:35 -05:00
|
|
|
|
;; Fuzzy link points nowhere.
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(`nil
|
2012-03-04 13:49:35 -05:00
|
|
|
|
(format "<i>%s</i>"
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
(or desc
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(org-export-data
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
(org-element-property :raw-link link) info))))
|
2013-02-23 07:47:44 -05:00
|
|
|
|
;; Link points to a headline.
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(`headline
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let ((href (org-html--reference destination info))
|
2012-07-07 05:40:42 -04:00
|
|
|
|
;; What description to use?
|
2012-06-01 19:42:00 -04:00
|
|
|
|
(desc
|
2012-07-07 05:40:42 -04:00
|
|
|
|
;; Case 1: Headline is numbered and LINK has no
|
2013-04-24 03:52:20 -04:00
|
|
|
|
;; description. Display section number.
|
2012-07-07 05:40:42 -04:00
|
|
|
|
(if (and (org-export-numbered-headline-p destination info)
|
2013-04-24 03:52:20 -04:00
|
|
|
|
(not desc))
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(mapconcat #'number-to-string
|
2012-07-07 05:40:42 -04:00
|
|
|
|
(org-export-get-headline-number
|
|
|
|
|
destination info) ".")
|
|
|
|
|
;; Case 2: Either the headline is un-numbered or
|
|
|
|
|
;; LINK has a custom description. Display LINK's
|
|
|
|
|
;; description or headline's title.
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(or desc
|
|
|
|
|
(org-export-data
|
|
|
|
|
(org-element-property :title destination) info)))))
|
|
|
|
|
(format "<a href=\"#%s\"%s>%s</a>" href attributes desc)))
|
2013-06-29 08:20:19 -04:00
|
|
|
|
;; Fuzzy link points to a target or an element.
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(_
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(if (and destination
|
|
|
|
|
(memq (plist-get info :with-latex) '(mathjax t))
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(org-element-type-p destination 'latex-environment)
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(eq 'math (org-latex--environment-type destination)))
|
|
|
|
|
;; Caption and labels are introduced within LaTeX
|
2020-04-20 15:49:12 -04:00
|
|
|
|
;; environment. Use "ref" or "eqref" macro, depending on user
|
|
|
|
|
;; preference to refer to those in the document.
|
|
|
|
|
(format (plist-get info :html-equation-reference-format)
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(org-html--reference destination info))
|
|
|
|
|
(let* ((ref (org-html--reference destination info))
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(org-html-standalone-image-predicate
|
|
|
|
|
#'org-html--has-caption-p)
|
|
|
|
|
(counter-predicate
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(if (org-element-type-p destination 'latex-environment)
|
2018-01-07 04:04:39 -05:00
|
|
|
|
#'org-html--math-environment-p
|
|
|
|
|
#'org-html--has-caption-p))
|
|
|
|
|
(number
|
|
|
|
|
(cond
|
|
|
|
|
(desc nil)
|
|
|
|
|
((org-html-standalone-image-p destination info)
|
|
|
|
|
(org-export-get-ordinal
|
|
|
|
|
(org-element-map destination 'link #'identity info t)
|
2022-12-21 07:28:48 -05:00
|
|
|
|
info '(link) 'org-html-standalone-image-p))
|
2018-01-07 04:04:39 -05:00
|
|
|
|
(t (org-export-get-ordinal
|
|
|
|
|
destination info nil counter-predicate))))
|
|
|
|
|
(desc
|
|
|
|
|
(cond (desc)
|
|
|
|
|
((not number) "No description for this link")
|
|
|
|
|
((numberp number) (number-to-string number))
|
|
|
|
|
(t (mapconcat #'number-to-string number ".")))))
|
|
|
|
|
(format "<a href=\"#%s\"%s>%s</a>" ref attributes desc)))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Coderef: replace link with the reference name or the
|
|
|
|
|
;; equivalent line number.
|
|
|
|
|
((string= type "coderef")
|
2024-04-10 10:02:01 -04:00
|
|
|
|
(let ((fragment (concat "coderef-" (org-html-encode-plain-text raw-path))))
|
2017-01-24 12:19:23 -05:00
|
|
|
|
(format "<a href=\"#%s\" %s%s>%s</a>"
|
2012-06-08 09:25:29 -04:00
|
|
|
|
fragment
|
2015-09-02 15:30:59 -04:00
|
|
|
|
(format "class=\"coderef\" onmouseover=\"CodeHighlightOn(this, \
|
|
|
|
|
'%s');\" onmouseout=\"CodeHighlightOff(this, '%s');\""
|
|
|
|
|
fragment fragment)
|
2012-06-08 09:25:29 -04:00
|
|
|
|
attributes
|
2024-04-10 10:02:01 -04:00
|
|
|
|
(format (org-export-get-coderef-format raw-path desc)
|
|
|
|
|
(org-export-resolve-coderef raw-path info)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; External link with a description part.
|
2019-02-27 14:22:51 -05:00
|
|
|
|
((and path desc)
|
|
|
|
|
(format "<a href=\"%s\"%s>%s</a>"
|
|
|
|
|
(org-html-encode-plain-text path)
|
|
|
|
|
attributes
|
|
|
|
|
desc))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; External link without a description part.
|
2019-02-27 14:22:51 -05:00
|
|
|
|
(path
|
|
|
|
|
(let ((path (org-html-encode-plain-text path)))
|
|
|
|
|
(format "<a href=\"%s\"%s>%s</a>" path attributes path)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; No path, only description. Try to do something useful.
|
2019-02-27 14:22:51 -05:00
|
|
|
|
(t
|
|
|
|
|
(format "<i>%s</i>" desc)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-09-25 15:27:29 -04:00
|
|
|
|
;;;; Node Property
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-node-property (node-property _contents _info)
|
2013-09-25 15:27:29 -04:00
|
|
|
|
"Transcode a NODE-PROPERTY element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(format "%s:%s"
|
|
|
|
|
(org-element-property :key node-property)
|
|
|
|
|
(let ((value (org-element-property :value node-property)))
|
|
|
|
|
(if value (concat " " value) ""))))
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Paragraph
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-paragraph (paragraph contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a PARAGRAPH element from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the paragraph, as a string. INFO is
|
|
|
|
|
the plist used as a communication channel."
|
2023-05-03 08:56:35 -04:00
|
|
|
|
(let* ((parent (org-element-parent paragraph))
|
2013-03-10 07:09:43 -04:00
|
|
|
|
(parent-type (org-element-type parent))
|
2015-04-24 15:21:22 -04:00
|
|
|
|
(style '((footnote-definition " class=\"footpara\"")
|
2015-04-24 15:24:57 -04:00
|
|
|
|
(org-data " class=\"footpara\"")))
|
2014-04-16 11:11:17 -04:00
|
|
|
|
(attributes (org-html--make-attribute-string
|
|
|
|
|
(org-export-read-attribute :attr_html paragraph)))
|
2015-04-24 15:21:22 -04:00
|
|
|
|
(extra (or (cadr (assq parent-type style)) "")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
2014-09-06 13:03:18 -04:00
|
|
|
|
((and (eq parent-type 'item)
|
|
|
|
|
(not (org-export-get-previous-element paragraph info))
|
2014-08-26 03:51:20 -04:00
|
|
|
|
(let ((followers (org-export-get-next-element paragraph info 2)))
|
|
|
|
|
(and (not (cdr followers))
|
2023-05-16 06:41:53 -04:00
|
|
|
|
(org-element-type-p (car followers) '(nil plain-list)))))
|
2014-08-26 03:51:20 -04:00
|
|
|
|
;; First paragraph in an item has no tag if it is alone or
|
|
|
|
|
;; followed, at most, by a sub-list.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
contents)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((org-html-standalone-image-p paragraph info)
|
2013-07-01 16:51:26 -04:00
|
|
|
|
;; Standalone image.
|
|
|
|
|
(let ((caption
|
|
|
|
|
(let ((raw (org-export-data
|
|
|
|
|
(org-export-get-caption paragraph) info))
|
|
|
|
|
(org-html-standalone-image-predicate
|
2016-08-22 16:13:24 -04:00
|
|
|
|
#'org-html--has-caption-p))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(if (not (org-string-nw-p raw)) raw
|
2016-08-22 16:13:24 -04:00
|
|
|
|
(concat "<span class=\"figure-number\">"
|
|
|
|
|
(format (org-html--translate "Figure %d:" info)
|
|
|
|
|
(org-export-get-ordinal
|
|
|
|
|
(org-element-map paragraph 'link
|
|
|
|
|
#'identity info t)
|
|
|
|
|
info nil #'org-html-standalone-image-p))
|
|
|
|
|
" </span>"
|
|
|
|
|
raw))))
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(label (org-html--reference paragraph info)))
|
2013-07-01 16:51:26 -04:00
|
|
|
|
(org-html--wrap-image contents info caption label)))
|
|
|
|
|
;; Regular paragraph.
|
2014-04-16 11:11:17 -04:00
|
|
|
|
(t (format "<p%s%s>\n%s</p>"
|
|
|
|
|
(if (org-string-nw-p attributes)
|
|
|
|
|
(concat " " attributes) "")
|
|
|
|
|
extra contents)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Plain List
|
|
|
|
|
|
2017-02-14 10:32:44 -05:00
|
|
|
|
(defun org-html-plain-list (plain-list contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a PLAIN-LIST element from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-02-14 10:32:44 -05:00
|
|
|
|
(let* ((type (pcase (org-element-property :type plain-list)
|
2017-02-14 11:27:26 -05:00
|
|
|
|
(`ordered "ol")
|
|
|
|
|
(`unordered "ul")
|
|
|
|
|
(`descriptive "dl")
|
|
|
|
|
(other (error "Unknown HTML list type: %s" other))))
|
2017-02-14 10:32:44 -05:00
|
|
|
|
(class (format "org-%s" type))
|
2017-02-13 11:52:38 -05:00
|
|
|
|
(attributes (org-export-read-attribute :attr_html plain-list)))
|
2017-02-14 10:32:44 -05:00
|
|
|
|
(format "<%s %s>\n%s</%s>"
|
|
|
|
|
type
|
|
|
|
|
(org-html--make-attribute-string
|
|
|
|
|
(plist-put attributes :class
|
|
|
|
|
(org-trim
|
|
|
|
|
(mapconcat #'identity
|
|
|
|
|
(list class (plist-get attributes :class))
|
|
|
|
|
" "))))
|
2017-02-14 10:34:17 -05:00
|
|
|
|
contents
|
2017-02-14 10:32:44 -05:00
|
|
|
|
type)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Plain Text
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-convert-special-strings (string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Convert special characters in STRING to HTML."
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(dolist (a org-html-special-string-regexps string)
|
|
|
|
|
(let ((re (car a))
|
|
|
|
|
(rpl (cdr a)))
|
|
|
|
|
(setq string (replace-regexp-in-string re rpl string t)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-encode-plain-text (text)
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
"Convert plain text characters from TEXT to HTML equivalent.
|
2013-03-04 13:41:34 -05:00
|
|
|
|
Possible conversions are set in `org-html-protect-char-alist'."
|
2015-02-05 06:56:23 -05:00
|
|
|
|
(dolist (pair org-html-protect-char-alist text)
|
|
|
|
|
(setq text (replace-regexp-in-string (car pair) (cdr pair) text t t))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-plain-text (text info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a TEXT string from Org to HTML.
|
|
|
|
|
TEXT is the string to transcode. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-10-26 18:36:00 -04:00
|
|
|
|
(let ((output text))
|
|
|
|
|
;; Protect following characters: <, >, &.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(setq output (org-html-encode-plain-text output))
|
2012-10-26 18:36:00 -04:00
|
|
|
|
;; Handle smart quotes. Be sure to provide original string since
|
|
|
|
|
;; OUTPUT may have been modified.
|
|
|
|
|
(when (plist-get info :with-smart-quotes)
|
|
|
|
|
(setq output (org-export-activate-smart-quotes output :html info text)))
|
|
|
|
|
;; Handle special strings.
|
|
|
|
|
(when (plist-get info :with-special-strings)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(setq output (org-html-convert-special-strings output)))
|
2012-10-26 18:36:00 -04:00
|
|
|
|
;; Handle break preservation if required.
|
|
|
|
|
(when (plist-get info :preserve-breaks)
|
|
|
|
|
(setq output
|
|
|
|
|
(replace-regexp-in-string
|
2013-05-02 17:07:38 -04:00
|
|
|
|
"\\(\\\\\\\\\\)?[ \t]*\n"
|
|
|
|
|
(concat (org-html-close-tag "br" nil info) "\n") output)))
|
2012-10-26 18:36:00 -04:00
|
|
|
|
;; Return value.
|
|
|
|
|
output))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-04-28 20:11:22 -04:00
|
|
|
|
;; Planning
|
|
|
|
|
|
2016-03-30 11:18:47 -04:00
|
|
|
|
(defun org-html-planning (planning _contents info)
|
2012-04-28 20:11:22 -04:00
|
|
|
|
"Transcode a PLANNING element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
2016-03-30 11:17:07 -04:00
|
|
|
|
(format
|
|
|
|
|
"<p><span class=\"timestamp-wrapper\">%s</span></p>"
|
|
|
|
|
(org-trim
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (pair)
|
|
|
|
|
(let ((timestamp (cdr pair)))
|
|
|
|
|
(when timestamp
|
|
|
|
|
(let ((string (car pair)))
|
|
|
|
|
(format "<span class=\"timestamp-kwd\">%s</span> \
|
|
|
|
|
<span class=\"timestamp\">%s</span> "
|
|
|
|
|
string
|
|
|
|
|
(org-html-plain-text (org-timestamp-translate timestamp)
|
|
|
|
|
info))))))
|
|
|
|
|
`((,org-closed-string . ,(org-element-property :closed planning))
|
|
|
|
|
(,org-deadline-string . ,(org-element-property :deadline planning))
|
|
|
|
|
(,org-scheduled-string . ,(org-element-property :scheduled planning)))
|
|
|
|
|
""))))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Property Drawer
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-property-drawer (_property-drawer contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a PROPERTY-DRAWER element from Org to HTML.
|
2013-09-25 15:27:29 -04:00
|
|
|
|
CONTENTS holds the contents of the drawer. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(and (org-string-nw-p contents)
|
|
|
|
|
(format "<pre class=\"example\">\n%s</pre>" contents)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Quote Block
|
|
|
|
|
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(defun org-html-quote-block (quote-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a QUOTE-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2016-03-28 15:06:51 -04:00
|
|
|
|
(format "<blockquote%s>\n%s</blockquote>"
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let* ((reference (org-html--reference quote-block info t))
|
2016-03-28 15:06:51 -04:00
|
|
|
|
(attributes (org-export-read-attribute :attr_html quote-block))
|
|
|
|
|
(a (org-html--make-attribute-string
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(if (or (not reference) (plist-member attributes :id))
|
2016-03-28 15:06:51 -04:00
|
|
|
|
attributes
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(plist-put attributes :id reference)))))
|
2016-03-28 15:06:51 -04:00
|
|
|
|
(if (org-string-nw-p a) (concat " " a) ""))
|
|
|
|
|
contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Section
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-section (section contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SECTION element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the section. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2023-05-18 07:35:35 -04:00
|
|
|
|
(let ((parent (org-element-lineage section 'headline)))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;; Before first headline: no container, just return CONTENTS.
|
|
|
|
|
(if (not parent) contents
|
|
|
|
|
;; Get div's class and id references.
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(let* ((class-num (+ (org-export-get-relative-level parent info)
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(1- (plist-get info :html-toplevel-hlevel))))
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(section-number
|
2014-09-21 10:17:55 -04:00
|
|
|
|
(and (org-export-numbered-headline-p parent info)
|
|
|
|
|
(mapconcat
|
|
|
|
|
#'number-to-string
|
|
|
|
|
(org-export-get-headline-number parent info) "-"))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;; Build return value.
|
2017-02-14 06:03:16 -05:00
|
|
|
|
(format "<div class=\"outline-text-%d\" id=\"text-%s\">\n%s</div>\n"
|
2013-03-01 08:22:09 -05:00
|
|
|
|
class-num
|
2014-09-21 10:17:55 -04:00
|
|
|
|
(or (org-element-property :CUSTOM_ID parent)
|
|
|
|
|
section-number
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(org-export-get-reference parent info))
|
2015-01-29 18:31:33 -05:00
|
|
|
|
(or contents ""))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Radio Target
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-radio-target (radio-target text info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a RADIO-TARGET object from Org to HTML.
|
|
|
|
|
TEXT is the text of the target. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let ((ref (org-html--reference radio-target info)))
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(org-html--anchor ref text nil info)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Special Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-special-block (special-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SPECIAL-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2014-09-17 13:38:06 -04:00
|
|
|
|
(let* ((block-type (org-element-property :type special-block))
|
2016-03-28 15:06:52 -04:00
|
|
|
|
(html5-fancy (and (org-html--html5-fancy-p info)
|
|
|
|
|
(member block-type org-html-html5-elements)))
|
|
|
|
|
(attributes (org-export-read-attribute :attr_html special-block)))
|
2014-09-08 05:57:27 -04:00
|
|
|
|
(unless html5-fancy
|
|
|
|
|
(let ((class (plist-get attributes :class)))
|
2016-03-28 15:06:52 -04:00
|
|
|
|
(setq attributes (plist-put attributes :class
|
|
|
|
|
(if class (concat class " " block-type)
|
|
|
|
|
block-type)))))
|
|
|
|
|
(let* ((contents (or contents ""))
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(reference (org-html--reference special-block info))
|
2016-03-28 15:06:52 -04:00
|
|
|
|
(a (org-html--make-attribute-string
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(if (or (not reference) (plist-member attributes :id))
|
2016-03-28 15:06:52 -04:00
|
|
|
|
attributes
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(plist-put attributes :id reference))))
|
2016-03-28 15:06:52 -04:00
|
|
|
|
(str (if (org-string-nw-p a) (concat " " a) "")))
|
|
|
|
|
(if html5-fancy
|
|
|
|
|
(format "<%s%s>\n%s</%s>" block-type str contents block-type)
|
|
|
|
|
(format "<div%s>\n%s\n</div>" str contents)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Src Block
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-src-block (src-block _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SRC-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-12-09 06:16:37 -05:00
|
|
|
|
(if (org-export-read-attribute :attr_html src-block :textarea)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--textarea-block src-block)
|
2017-03-23 18:22:30 -04:00
|
|
|
|
(let* ((lang (org-element-property :language src-block))
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(code (org-html-format-code src-block info))
|
|
|
|
|
(label (let ((lbl (org-html--reference src-block info t)))
|
|
|
|
|
(if lbl (format " id=\"%s\"" lbl) "")))
|
|
|
|
|
(klipsify (and (plist-get info :html-klipsify-src)
|
|
|
|
|
(member lang '("javascript" "js"
|
|
|
|
|
"ruby" "scheme" "clojure" "php" "html")))))
|
2023-01-16 05:04:01 -05:00
|
|
|
|
(format "<div class=\"org-src-container\">\n%s%s\n</div>"
|
|
|
|
|
;; Build caption.
|
|
|
|
|
(let ((caption (org-export-get-caption src-block)))
|
|
|
|
|
(if (not caption) ""
|
|
|
|
|
(let ((listing-number
|
|
|
|
|
(format
|
|
|
|
|
"<span class=\"listing-number\">%s </span>"
|
|
|
|
|
(format
|
|
|
|
|
(org-html--translate "Listing %d:" info)
|
|
|
|
|
(org-export-get-ordinal
|
|
|
|
|
src-block info nil #'org-html--has-caption-p)))))
|
|
|
|
|
(format "<label class=\"org-src-name\">%s%s</label>"
|
|
|
|
|
listing-number
|
|
|
|
|
(org-trim (org-export-data caption info))))))
|
|
|
|
|
;; Contents.
|
|
|
|
|
(if klipsify
|
|
|
|
|
(format "<pre><code class=\"src src-%s\"%s%s>%s</code></pre>"
|
|
|
|
|
lang ; lang being nil is OK.
|
|
|
|
|
label
|
|
|
|
|
(if (string= lang "html")
|
|
|
|
|
" data-editor-type=\"html\""
|
|
|
|
|
"")
|
|
|
|
|
code)
|
|
|
|
|
(format "<pre class=\"src src-%s\"%s>%s</pre>"
|
|
|
|
|
;; Lang being nil is OK.
|
|
|
|
|
lang label code))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Statistics Cookie
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-statistics-cookie (statistics-cookie _contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a STATISTICS-COOKIE object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(let ((cookie-value (org-element-property :value statistics-cookie)))
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(format "<code>%s</code>" cookie-value)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Strike-Through
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-strike-through (_strike-through contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode STRIKE-THROUGH from Org to HTML.
|
|
|
|
|
CONTENTS is the text with strike-through markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format
|
|
|
|
|
(or (cdr (assq 'strike-through (plist-get info :html-text-markup-alist)))
|
|
|
|
|
"%s")
|
|
|
|
|
contents))
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Subscript
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-subscript (_subscript contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SUBSCRIPT object from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-28 02:39:10 -05:00
|
|
|
|
(format "<sub>%s</sub>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Superscript
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-superscript (_superscript contents _info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SUPERSCRIPT object from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-28 02:39:10 -05:00
|
|
|
|
(format "<sup>%s</sup>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-11-17 03:12:41 -05:00
|
|
|
|
;;;; Table Cell
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table-cell (table-cell contents info)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
"Transcode a TABLE-CELL element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
2023-05-03 08:56:35 -04:00
|
|
|
|
(let* ((table-row (org-element-parent table-cell))
|
2023-05-18 07:35:35 -04:00
|
|
|
|
(table (org-element-lineage table-cell 'table))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(cell-attrs
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(if (not (plist-get info :html-table-align-individual-fields)) ""
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (if (and (boundp 'org-html-format-table-no-css)
|
|
|
|
|
org-html-format-table-no-css)
|
2015-05-06 10:08:44 -04:00
|
|
|
|
" align=\"%s\"" " class=\"org-%s\"")
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(org-export-table-cell-alignment table-cell info)))))
|
2012-04-22 03:58:19 -04:00
|
|
|
|
(when (or (not contents) (string= "" (org-trim contents)))
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(setq contents " "))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
2012-04-22 03:58:19 -04:00
|
|
|
|
((and (org-export-table-has-header-p table info)
|
|
|
|
|
(= 1 (org-export-table-row-group table-row info)))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((header-tags (plist-get info :html-table-header-tags)))
|
|
|
|
|
(concat "\n" (format (car header-tags) "col" cell-attrs)
|
|
|
|
|
contents
|
|
|
|
|
(cdr header-tags))))
|
|
|
|
|
((and (plist-get info :html-table-use-header-tags-for-first-column)
|
2013-03-15 18:07:13 -04:00
|
|
|
|
(zerop (cdr (org-export-table-cell-address table-cell info))))
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(let ((header-tags (plist-get info :html-table-header-tags)))
|
|
|
|
|
(concat "\n" (format (car header-tags) "row" cell-attrs)
|
|
|
|
|
contents
|
|
|
|
|
(cdr header-tags))))
|
|
|
|
|
(t (let ((data-tags (plist-get info :html-table-data-tags)))
|
|
|
|
|
(concat "\n" (format (car data-tags) cell-attrs)
|
|
|
|
|
contents
|
|
|
|
|
(cdr data-tags)))))))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
|
|
|
|
|
;;;; Table Row
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table-row (table-row contents info)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
"Transcode a TABLE-ROW element from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the row. INFO is a plist used as a
|
|
|
|
|
communication channel."
|
|
|
|
|
;; Rules are ignored since table separators are deduced from
|
|
|
|
|
;; borders of the current row.
|
|
|
|
|
(when (eq (org-element-property :type table-row) 'standard)
|
2016-02-02 18:10:24 -05:00
|
|
|
|
(let* ((group (org-export-table-row-group table-row info))
|
|
|
|
|
(number (org-export-table-row-number table-row info))
|
|
|
|
|
(start-group-p
|
2013-04-07 17:19:07 -04:00
|
|
|
|
(org-export-table-row-starts-rowgroup-p table-row info))
|
2016-02-02 18:10:24 -05:00
|
|
|
|
(end-group-p
|
2013-04-07 17:19:07 -04:00
|
|
|
|
(org-export-table-row-ends-rowgroup-p table-row info))
|
2016-02-02 18:10:24 -05:00
|
|
|
|
(topp (and (equal start-group-p '(top))
|
|
|
|
|
(equal end-group-p '(below top))))
|
|
|
|
|
(bottomp (and (equal start-group-p '(above))
|
|
|
|
|
(equal end-group-p '(bottom above))))
|
|
|
|
|
(row-open-tag
|
|
|
|
|
(pcase (plist-get info :html-table-row-open-tag)
|
|
|
|
|
((and accessor (pred functionp))
|
|
|
|
|
(funcall accessor
|
|
|
|
|
number group start-group-p end-group-p topp bottomp))
|
|
|
|
|
(accessor accessor)))
|
|
|
|
|
(row-close-tag
|
|
|
|
|
(pcase (plist-get info :html-table-row-close-tag)
|
|
|
|
|
((and accessor (pred functionp))
|
|
|
|
|
(funcall accessor
|
|
|
|
|
number group start-group-p end-group-p topp bottomp))
|
|
|
|
|
(accessor accessor)))
|
|
|
|
|
(group-tags
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(cond
|
2016-02-02 18:10:24 -05:00
|
|
|
|
;; Row belongs to second or subsequent groups.
|
|
|
|
|
((not (= 1 group)) '("<tbody>" . "\n</tbody>"))
|
|
|
|
|
;; Row is from first group. Table has >=1 groups.
|
2012-04-22 01:09:19 -04:00
|
|
|
|
((org-export-table-has-header-p
|
2023-05-18 07:35:35 -04:00
|
|
|
|
(org-element-lineage table-row 'table) info)
|
2012-06-09 07:19:24 -04:00
|
|
|
|
'("<thead>" . "\n</thead>"))
|
2016-02-02 18:10:24 -05:00
|
|
|
|
;; Row is from first and only group.
|
2012-06-09 07:19:24 -04:00
|
|
|
|
(t '("<tbody>" . "\n</tbody>")))))
|
2016-02-02 18:10:24 -05:00
|
|
|
|
(concat (and start-group-p (car group-tags))
|
|
|
|
|
(concat "\n"
|
|
|
|
|
row-open-tag
|
|
|
|
|
contents
|
|
|
|
|
"\n"
|
|
|
|
|
row-close-tag)
|
|
|
|
|
(and end-group-p (cdr group-tags))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;;;; Table
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table-first-row-data-cells (table info)
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
"Transcode the first row of TABLE.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(let ((table-row
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-element-map table 'table-row
|
|
|
|
|
(lambda (row)
|
|
|
|
|
(unless (eq (org-element-property :type row) 'rule) row))
|
|
|
|
|
info 'first-match))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(special-column-p (org-export-table-has-special-column-p table)))
|
|
|
|
|
(if (not special-column-p) (org-element-contents table-row)
|
|
|
|
|
(cdr (org-element-contents table-row)))))
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-table--table.el-table (table _info)
|
2023-12-11 06:59:27 -05:00
|
|
|
|
"Format table.el TABLE into HTML.
|
ox-html.el: Fix or add docstring
* ox-html.el (org-html-text-markup-alist)
(org-html-pretty-output, org-html-link-org-files-as-html)
(org-html-postamble, org-html-preamble)
(org-html-format-inline-image, org-html-splice-attributes)
(org-export-splice-style, org-html-htmlize-region-for-paste)
(org-html-fix-class-name)
(org-html-format-footnote-reference)
(org-html-format-footnotes-section)
(org-html-footnote-section, org-html--anchor)
(org-html--todo, org-html--tags, org-html-format-headline)
(org-html-toc, org-html-format-section, org-html-checkbox)
(org-html-format-list-item, org-html-format-latex)
(org-html-encode-plain-text)
(org-html-table-first-row-data-cells)
(org-html-table--table.el-table, org-html-final-function): Fix
or add docstring.
2013-03-05 08:35:51 -05:00
|
|
|
|
INFO is a plist used as a communication channel."
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(when (eq (org-element-property :type table) 'table.el)
|
|
|
|
|
(require 'table)
|
|
|
|
|
(let ((outbuf (with-current-buffer
|
|
|
|
|
(get-buffer-create "*org-export-table*")
|
|
|
|
|
(erase-buffer) (current-buffer))))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert (org-element-property :value table))
|
|
|
|
|
(goto-char 1)
|
|
|
|
|
(re-search-forward "^[ \t]*|[^|]" nil t)
|
|
|
|
|
(table-generate-source 'html outbuf))
|
|
|
|
|
(with-current-buffer outbuf
|
|
|
|
|
(prog1 (org-trim (buffer-string))
|
|
|
|
|
(kill-buffer) )))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table (table contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a TABLE element from Org to HTML.
|
2012-05-23 17:21:25 -04:00
|
|
|
|
CONTENTS is the contents of the table. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(if (eq (org-element-property :type table) 'table.el)
|
|
|
|
|
;; "table.el" table. Convert it using appropriate tools.
|
|
|
|
|
(org-html-table--table.el-table table info)
|
|
|
|
|
;; Standard table.
|
|
|
|
|
(let* ((caption (org-export-get-caption table))
|
|
|
|
|
(number (org-export-get-ordinal
|
|
|
|
|
table info nil #'org-html--has-caption-p))
|
|
|
|
|
(attributes
|
|
|
|
|
(org-html--make-attribute-string
|
|
|
|
|
(org-combine-plists
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(list :id (org-html--reference table info t))
|
2016-07-20 16:02:50 -04:00
|
|
|
|
(and (not (org-html-html5-p info))
|
|
|
|
|
(plist-get info :html-table-attributes))
|
|
|
|
|
(org-export-read-attribute :attr_html table))))
|
|
|
|
|
(alignspec
|
|
|
|
|
(if (bound-and-true-p org-html-format-table-no-css)
|
|
|
|
|
"align=\"%s\""
|
|
|
|
|
"class=\"org-%s\""))
|
|
|
|
|
(table-column-specs
|
|
|
|
|
(lambda (table info)
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (table-cell)
|
|
|
|
|
(let ((alignment (org-export-table-cell-alignment
|
|
|
|
|
table-cell info)))
|
|
|
|
|
(concat
|
|
|
|
|
;; Begin a colgroup?
|
|
|
|
|
(when (org-export-table-cell-starts-colgroup-p
|
|
|
|
|
table-cell info)
|
|
|
|
|
"\n<colgroup>")
|
|
|
|
|
;; Add a column. Also specify its alignment.
|
|
|
|
|
(format "\n%s"
|
|
|
|
|
(org-html-close-tag
|
|
|
|
|
"col" (concat " " (format alignspec alignment)) info))
|
|
|
|
|
;; End a colgroup?
|
|
|
|
|
(when (org-export-table-cell-ends-colgroup-p
|
|
|
|
|
table-cell info)
|
|
|
|
|
"\n</colgroup>"))))
|
|
|
|
|
(org-html-table-first-row-data-cells table info) "\n"))))
|
|
|
|
|
(format "<table%s>\n%s\n%s\n%s</table>"
|
|
|
|
|
(if (equal attributes "") "" (concat " " attributes))
|
|
|
|
|
(if (not caption) ""
|
|
|
|
|
(format (if (plist-get info :html-table-caption-above)
|
|
|
|
|
"<caption class=\"t-above\">%s</caption>"
|
|
|
|
|
"<caption class=\"t-bottom\">%s</caption>")
|
|
|
|
|
(concat
|
|
|
|
|
"<span class=\"table-number\">"
|
|
|
|
|
(format (org-html--translate "Table %d:" info) number)
|
|
|
|
|
"</span> " (org-export-data caption info))))
|
|
|
|
|
(funcall table-column-specs table info)
|
|
|
|
|
contents))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Target
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-target (target _contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a TARGET object from Org to HTML.
|
2012-03-04 13:49:35 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2020-09-08 04:14:06 -04:00
|
|
|
|
(let ((ref (org-html--reference target info)))
|
2015-04-13 05:24:42 -04:00
|
|
|
|
(org-html--anchor ref nil nil info)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-04-28 20:23:09 -04:00
|
|
|
|
;;;; Timestamp
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-timestamp (timestamp _contents info)
|
2012-04-28 20:23:09 -04:00
|
|
|
|
"Transcode a TIMESTAMP object from Org to HTML.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2014-12-03 11:09:43 -05:00
|
|
|
|
(let ((value (org-html-plain-text (org-timestamp-translate timestamp) info)))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
(format "<span class=\"timestamp-wrapper\"><span class=\"timestamp\">%s</span></span>"
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(replace-regexp-in-string "--" "–" value))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Underline
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-underline (_underline contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode UNDERLINE from Org to HTML.
|
|
|
|
|
CONTENTS is the text with underline markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format (or (cdr (assq 'underline (plist-get info :html-text-markup-alist)))
|
|
|
|
|
"%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
contents))
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Verbatim
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-verbatim (verbatim _contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode VERBATIM from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
|
(format (or (cdr (assq 'verbatim (plist-get info :html-text-markup-alist))) "%s")
|
2013-06-06 14:55:33 -04:00
|
|
|
|
(org-html-encode-plain-text (org-element-property :value verbatim))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Verse Block
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-verse-block (_verse-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a VERSE-BLOCK element from Org to HTML.
|
2012-04-25 16:15:29 -04:00
|
|
|
|
CONTENTS is verse block contents. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-01-12 08:47:32 -05:00
|
|
|
|
(format "<p class=\"verse\">\n%s</p>"
|
|
|
|
|
;; Replace leading white spaces with non-breaking spaces.
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"^[ \t]+" (lambda (m) (org-html--make-string (length m) " "))
|
|
|
|
|
;; Replace each newline character with line break. Also
|
|
|
|
|
;; remove any trailing "br" close-tag so as to avoid
|
|
|
|
|
;; duplicates.
|
|
|
|
|
(let* ((br (org-html-close-tag "br" nil info))
|
2017-03-07 18:12:55 -05:00
|
|
|
|
(re (format "\\(?:%s\\)?[ \t]*\n" (regexp-quote br))))
|
|
|
|
|
(replace-regexp-in-string re (concat br "\n") contents)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;;; Filter Functions
|
|
|
|
|
|
2015-10-29 13:35:20 -04:00
|
|
|
|
(defun org-html-final-function (contents _backend info)
|
2023-12-11 06:59:27 -05:00
|
|
|
|
"Filter to indent the HTML and convert HTML entities.
|
|
|
|
|
CONTENTS is the exported HTML code. INFO is the info plist."
|
2013-03-15 10:02:18 -04:00
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert contents)
|
|
|
|
|
(set-auto-mode t)
|
2018-05-09 20:17:12 -04:00
|
|
|
|
(when (plist-get info :html-indent)
|
|
|
|
|
(indent-region (point-min) (point-max)))
|
2013-03-15 10:02:18 -04:00
|
|
|
|
(buffer-substring-no-properties (point-min) (point-max))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
|
2012-12-09 06:18:22 -05:00
|
|
|
|
|
2012-10-08 08:20:56 -04:00
|
|
|
|
;;; End-user functions
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-20 07:11:44 -04:00
|
|
|
|
;;;###autoload
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-export-as-html
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-07-20 07:11:44 -04:00
|
|
|
|
"Export current buffer to an HTML buffer.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 11:24:19 -05:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting buffer should be accessible
|
|
|
|
|
through the `org-export-stack' interface.
|
|
|
|
|
|
2012-07-20 07:11:44 -04:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"<body>\" and \"</body>\" tags.
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
Export is done in a buffer named \"*Org HTML Export*\", which
|
2012-07-20 07:11:44 -04:00
|
|
|
|
will be displayed when `org-export-show-temporary-export-buffer'
|
|
|
|
|
is non-nil."
|
|
|
|
|
(interactive)
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 04:35:42 -04:00
|
|
|
|
(org-export-to-buffer 'html "*Org HTML Export*"
|
|
|
|
|
async subtreep visible-only body-only ext-plist
|
|
|
|
|
(lambda () (set-auto-mode t))))
|
2012-07-20 07:11:44 -04:00
|
|
|
|
|
2013-04-06 13:09:38 -04:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun org-html-convert-region-to-html ()
|
2016-08-23 16:13:56 -04:00
|
|
|
|
"Assume the current region has Org syntax, and convert it to HTML.
|
2013-04-06 13:09:38 -04:00
|
|
|
|
This can be used in any buffer. For example, you can write an
|
2016-08-23 16:13:56 -04:00
|
|
|
|
itemized list in Org syntax in an HTML buffer and use this command
|
|
|
|
|
to convert it."
|
2013-04-06 13:09:38 -04:00
|
|
|
|
(interactive)
|
|
|
|
|
(org-export-replace-region-by 'html))
|
|
|
|
|
|
2023-06-29 15:18:01 -04:00
|
|
|
|
(defalias 'org-export-region-to-html #'org-html-convert-region-to-html)
|
|
|
|
|
|
2012-05-30 14:30:56 -04:00
|
|
|
|
;;;###autoload
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-export-to-html
|
2021-09-29 03:22:47 -04:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Export current buffer to a HTML file.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 11:24:19 -05:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
2012-07-20 07:11:44 -04:00
|
|
|
|
between \"<body>\" and \"</body>\" tags.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
|
(interactive)
|
2020-02-11 03:26:20 -05:00
|
|
|
|
(let* ((extension (concat
|
|
|
|
|
(when (> (length org-html-extension) 0) ".")
|
|
|
|
|
(or (plist-get ext-plist :html-extension)
|
|
|
|
|
org-html-extension
|
|
|
|
|
"html")))
|
2012-11-29 15:52:43 -05:00
|
|
|
|
(file (org-export-output-file-name extension subtreep))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-export-coding-system org-html-coding-system))
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 04:35:42 -04:00
|
|
|
|
(org-export-to-file 'html file
|
|
|
|
|
async subtreep visible-only body-only ext-plist)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-10-08 08:20:56 -04:00
|
|
|
|
;;;###autoload
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-publish-to-html (plist filename pub-dir)
|
2012-10-08 08:20:56 -04:00
|
|
|
|
"Publish an org file to HTML.
|
|
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
|
|
Return output file name."
|
2013-04-03 07:25:11 -04:00
|
|
|
|
(org-publish-org-to 'html filename
|
2020-02-11 03:26:20 -05:00
|
|
|
|
(concat (when (> (length org-html-extension) 0) ".")
|
|
|
|
|
(or (plist-get plist :html-extension)
|
|
|
|
|
org-html-extension
|
|
|
|
|
"html"))
|
2013-04-03 07:25:11 -04:00
|
|
|
|
plist pub-dir))
|
2012-10-08 08:20:56 -04:00
|
|
|
|
|
2012-07-12 17:53:57 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(provide 'ox-html)
|
|
|
|
|
|
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "org-loaddefs.el"
|
|
|
|
|
;; End:
|
|
|
|
|
|
|
|
|
|
;;; ox-html.el ends here
|