%s
")
(italic . "%s")
(strike-through . "%s
"))
"Alist of HTML expressions to convert text markup.
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.
If no association can be found for a given markup, text will be
returned as-is."
:group 'org-export-html
:type '(alist :key-type (symbol :tag "Markup type")
:value-type (string :tag "Format string"))
:options '(bold code italic strike-through underline verbatim))
(defcustom org-html-indent nil
"Non-nil means to indent the generated HTML.
Warning: non-nil may break indentation of source code blocks."
:group 'org-export-html
:version "24.4"
:package-version '(Org . "8.0")
:type 'boolean)
(defcustom org-html-use-unicode-chars nil
"Non-nil means to use unicode characters instead of HTML entities."
:group 'org-export-html
:version "24.4"
:package-version '(Org . "8.0")
:type 'boolean)
;;;; Drawers
(defcustom org-html-format-drawer-function nil
"Function called to format a drawer in HTML code.
The function must accept two parameters:
NAME the drawer name, like \"LOGBOOK\"
CONTENTS the contents of the drawer.
The function should return the string to be exported.
For example, the variable could be set to the following function
in order to mimic default behaviour:
\(defun org-html-format-drawer-default \(name contents\)
\"Format a drawer element for HTML export.\"
contents\)"
:group 'org-export-html
:type 'function)
;;;; Footnotes
(defcustom org-html-footnotes-section "Date: %d
%c
%v
")) "Alist of languages and format strings for the HTML postamble. The first element of each list is the language code, as used for the LANGUAGE keyword. See `org-export-default-language'. The second element of each list is a format string to format the postamble itself. This format string can contain these elements: %t stands for the title. %a stands for the author's name. %e stands for the author's email. %d stands for the date. %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. %T will be replaced by the export time. %C will be replaced by the last modification time. If you need to use a \"%\" character, you need to escape it like that: \"%%\"." :group 'org-export-html :type '(alist :key-type (string :tag "Language") :value-type (string :tag "Format string"))) (defcustom org-html-validation-link "Validate" "Link to HTML validation service." :group 'org-export-html :type 'string) (defcustom org-html-creator-string (format "Emacs %s (Org mode %s)" emacs-version (if (fboundp 'org-version) (org-version) "unknown version")) "Information about the creator of the HTML document. This option can also be set on with the CREATOR keyword." :group 'org-export-html :type '(string :tag "Creator string")) ;;;; Template :: Preamble (defcustom org-html-preamble t "Non-nil means insert a preamble in HTML export. 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). 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. Setting :html-preamble in publishing projects will take precedence over this variable." :group 'org-export-html :type '(choice (const :tag "No preamble" nil) (const :tag "Default preamble" t) (string :tag "Custom formatting string") (function :tag "Function (must return a string)"))) (defcustom org-html-preamble-format '(("en" "")) "Alist of languages and format strings for the HTML preamble. The first element of each list is the language code, as used for the LANGUAGE keyword. See `org-export-default-language'. 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. %a stands for the author's name. %e stands for the author's email. %d stands for the date. %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. %T will be replaced by the export time. %C will be replaced by the last modification time. If you need to use a \"%\" character, you need to escape it like that: \"%%\". See the default value of `org-html-postamble-format' for an example." :group 'org-export-html :type '(alist :key-type (string :tag "Language") :value-type (string :tag "Format string"))) (defcustom org-html-link-up "" "Where should the \"UP\" link of exported HTML pages lead?" :group 'org-export-html :type '(string :tag "File or URL")) (defcustom org-html-link-home "" "Where should the \"HOME\" link of exported HTML pages lead?" :group 'org-export-html :type '(string :tag "File or URL")) (defcustom org-html-home/up-format "" "Snippet used to insert the HOME and UP links. This is a format string, the first %s will receive the UP link, the second the HOME link. If both `org-html-link-up' and `org-html-link-home' are empty, the entire snippet will be ignored." :group 'org-export-html :type 'string) ;;;; Template :: Scripts (define-obsolete-variable-alias 'org-html-style-include-scripts 'org-html-head-include-scripts "24.4") (defcustom org-html-head-include-scripts t "Non-nil means include the JavaScript snippets in exported HTML files. The actual script is defined in `org-html-scripts' and should not be modified." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") :type 'boolean) ;;;; Template :: Styles (define-obsolete-variable-alias 'org-html-style-include-default 'org-html-head-include-default-style "24.4") (defcustom org-html-head-include-default-style t "Non-nil means include the default style in exported HTML files. The actual style is defined in `org-html-style-default' and should not be modified. Use `org-html-head' to use your own style information." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") :type 'boolean) ;;;###autoload (put 'org-html-head-include-default-style 'safe-local-variable 'booleanp) (define-obsolete-variable-alias 'org-html-style 'org-html-head "24.4") (defcustom org-html-head "" "Org-wide head definitions for exported HTML files. 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. For example, a valid value would be: If you want to refer to an external style, use something like As the value of this option simply gets inserted into the HTML header, you can use it to add any arbitrary text to the header. You can set this on a per-file basis using #+HTML_HEAD:, or for publication projects using the :html-head property." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") :type 'string) ;;;###autoload (put 'org-html-head 'safe-local-variable 'stringp) (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) ;;;; Todos (defcustom org-html-todo-kwd-class-prefix "" "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." :group 'org-export-html :type 'string) ;;; Internal Functions (defun org-html-xhtml-p (info) (let ((dt (downcase (plist-get info :html-doctype)))) (string-match-p "xhtml" dt))) (defun org-html-html5-p (info) (let ((dt (downcase (plist-get info :html-doctype)))) (member dt '("html5" "xhtml5" "")))) (defun org-html-close-tag (tag attr info) (concat "<" tag (or attr "") (if (org-html-xhtml-p info) " />" ">"))) (defun org-html--make-attribute-string (attributes) "Return a list of attributes, as a string. ATTRIBUTES is a plist where values are either strings or nil. An attributes with a nil value will be omitted from the result." (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)))))))) (defun org-html-format-inline-image (src info &optional caption label attr standalone-p) "Format an inline image from SRC. CAPTION, LABEL and ATTR are optional arguments providing the caption, the label and the attribute of the image. When STANDALONE-P is t, wrap the%s
" img) (if (and caption (not (string= caption ""))) (format (if html5-fancy "\n%s
") caption) "")))) (t (org-html-close-tag "img" (concat attr id) info))))) (defun org-html--textarea-block (element) "Transcode ELEMENT into a textarea block. ELEMENT is either a src block or an example block." (let* ((code (car (org-export-unravel-code element))) (attr (org-export-read-attribute :attr_html element))) (format "\n\n
" (or (plist-get attr :width) 80) (or (plist-get attr :height) (org-count-lines code)) code))) ;;;; Bibliography (defun org-html-bibliography () "Find bibliography, cut it out and return it." (catch 'exit (let (beg end (cnt 1) bib) (save-excursion (goto-char (point-min)) (when (re-search-forward "^[ \t]*