summaryrefslogtreecommitdiff
path: root/lisp/org/ox-html.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/ox-html.el')
-rw-r--r--lisp/org/ox-html.el377
1 files changed, 195 insertions, 182 deletions
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el
index 03145e35c53..a150b1fdb87 100644
--- a/lisp/org/ox-html.el
+++ b/lisp/org/ox-html.el
@@ -2,8 +2,9 @@
;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
-;; Author: Carsten Dominik <carsten at orgmode dot org>
+;; Author: Carsten Dominik <carsten.dominik@gmail.com>
;; Jambunathan K <kjambunathan at gmail dot com>
+;; Maintainer: TEC <tecosaur@gmail.com>
;; Keywords: outlines, hypermedia, calendar, wp
;; This file is part of GNU Emacs.
@@ -113,6 +114,7 @@
:options-alist
'((:html-doctype "HTML_DOCTYPE" nil org-html-doctype)
(:html-container "HTML_CONTAINER" nil org-html-container-element)
+ (:html-content-class "HTML_CONTENT_CLASS" nil org-html-content-class)
(:description "DESCRIPTION" nil nil newline)
(:keywords "KEYWORDS" nil nil space)
(:html-html5-fancy nil "html5-fancy" org-html-html5-fancy)
@@ -192,7 +194,7 @@
(defvar htmlize-buffer-places) ; from htmlize.el
(defvar org-html--pre/postamble-class "status"
- "CSS class used for pre/postamble")
+ "CSS class used for pre/postamble.")
(defconst org-html-doctype-alist
'(("html4-strict" . "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"
@@ -231,10 +233,9 @@ property on the headline itself.")
("\\.\\.\\." . "&#x2026;")) ; hellip
"Regular expressions for special string conversion.")
-(defconst org-html-scripts
- "<script type=\"text/javascript\">
-// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
-<!--/*--><![CDATA[/*><!--*/
+(defcustom org-html-scripts
+ "<script>
+// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
@@ -251,14 +252,16 @@ property on the headline itself.")
target.classList.remove(\"code-highlighted\");
}
}
- /*]]>*///-->
// @license-end
</script>"
- "Basic JavaScript that is needed by HTML files produced by Org mode.")
+ "Basic JavaScript to allow highlighting references in code blocks."
+ :group 'org-export-html
+ :package-version '(Org . "9.5")
+ :type 'string)
-(defconst org-html-style-default
- "<style type=\"text/css\">
- <!--/*--><![CDATA[/*><!--*/
+(defcustom org-html-style-default
+ "<style>
+ #content { max-width: 60em; margin: auto; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
@@ -279,8 +282,9 @@ property on the headline itself.")
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
- border: 1px solid #ccc;
- box-shadow: 3px 3px 3px #eee;
+ border: 1px solid #e6e6e6;
+ border-radius: 3px;
+ background-color: #f2f2f2;
padding: 8pt;
font-family: monospace;
overflow: auto;
@@ -289,21 +293,21 @@ property on the headline itself.")
pre.src {
position: relative;
overflow: auto;
- padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
- background-color: white;
- top: -10px;
- right: 10px;
+ top: -8px;
+ right: 12px;
padding: 3px;
- border: 1px solid black;
+ color: #555;
+ background-color: #f2f2f299;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
+ pre.src-authinfo::before { content: 'Authinfo'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
@@ -439,12 +443,14 @@ property on the headline itself.")
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
- /*]]>*/-->
</style>"
"The default style specification for exported HTML files.
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,
-customize `org-html-head-include-default-style'.")
+customize `org-html-head-include-default-style'."
+ :group 'org-export-html
+ :package-version '(Org . "9.5")
+ :type 'string)
;;; User Configuration Variables
@@ -508,17 +514,15 @@ means to use the maximum value consistent with other options."
org-html-infojs-opts-table)))
(defcustom org-html-infojs-template
- "<script type=\"text/javascript\" src=\"%SCRIPT_PATH\">
+ "<script src=\"%SCRIPT_PATH\">
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
// @license-end
</script>
-<script type=\"text/javascript\">
+<script>
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
-<!--/*--><![CDATA[/*><!--*/
%MANAGER_OPTIONS
org_html_manager.setup(); // activate after the parameters are set
-/*]]>*///-->
// @license-end
</script>"
"The template for the export style additions when org-info.js is used.
@@ -653,9 +657,6 @@ The function must accept two parameters:
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 behavior:
-
The default value simply returns the value of CONTENTS."
:group 'org-export-html
:version "24.4"
@@ -782,7 +783,7 @@ The function should return the string to be exported."
"The MathJax command to use when referencing equations.
This is a format control string that expects a single string argument
-specifying the label that is being referenced. The argument is
+specifying the label that is being referenced. The argument is
generated automatically on export.
The default is to wrap equations in parentheses (using \"\\eqref{%s}\)\".
@@ -794,7 +795,7 @@ Most common values are:
:group 'org-export-html
:package-version '(Org . "9.4")
:type 'string
- :safe t)
+ :safe #'stringp)
(defcustom org-html-with-latex org-export-with-latex
"Non-nil means process LaTeX math snippets.
@@ -825,13 +826,13 @@ e.g. \"tex:mathjax\". Allowed values are:
;;;; Links :: Generic
(defcustom org-html-link-org-files-as-html t
- "Non-nil means make file links to `file.org' point to `file.html'.
-When `org-mode' is exporting an `org-mode' file to HTML, links to
-non-html files are directly put into a href tag in HTML.
-However, links to other Org files (recognized by the extension
-\".org\") should become links to the corresponding HTML
-file, assuming that the linked `org-mode' file will also be
-converted to HTML.
+ "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
+(recognized by the extension \".org\") should become links to the corresponding
+HTML file, assuming that the linked Org file will also be converted to HTML.
+
When nil, the links still point to the plain \".org\" file."
:group 'org-export-html
:type 'boolean)
@@ -848,16 +849,15 @@ link to the image."
:type 'boolean)
(defcustom org-html-inline-image-rules
- `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg")))
- ("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg")))
- ("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg"))))
+ `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp")))
+ ("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp")))
+ ("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".webp"))))
"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
link's path."
:group 'org-export-html
- :version "24.4"
- :package-version '(Org . "8.0")
+ :package-version '(Org . "9.5")
:type '(alist :key-type (string :tag "Type")
:value-type (regexp :tag "Path")))
@@ -874,7 +874,7 @@ link's path."
(defcustom org-html-htmlize-output-type 'inline-css
"Output type to be used by htmlize when formatting code snippets.
Choices are `css' to export the CSS selectors only,`inline-css'
-to export the CSS attribute values inline in the HTML or `nil' to
+to export the CSS attribute values inline in the HTML or nil to
export plain text. We use as default `inline-css', in order to
make the resulting HTML self-containing.
@@ -903,7 +903,7 @@ numbers are enabled."
:group 'org-export-html
:package-version '(Org . "9.3")
:type 'boolean
- :safe t)
+ :safe #'booleanp)
;;;; Table
@@ -1060,13 +1060,7 @@ publishing, with :html-doctype."
(defcustom org-html-html5-fancy nil
"Non-nil means using new HTML5 elements.
-This variable is ignored for anything other than HTML5 export.
-
-For compatibility with Internet Explorer, it's probably a good
-idea to download some form of the html5shiv (for instance
-https://code.google.com/p/html5shiv/) and add it to your
-HTML_HEAD_EXTRA, so that your pages don't break for users of IE
-versions 8 and below."
+This variable is ignored for anything other than HTML5 export."
:group 'org-export-html
:version "24.4"
:package-version '(Org . "8.0")
@@ -1084,6 +1078,16 @@ org-info.js for your website."
:package-version '(Org . "8.0")
:type 'string)
+(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)
+
+
(defcustom org-html-divs
'((preamble "div" "preamble")
(content "div" "content")
@@ -1110,15 +1114,15 @@ org-info.js for your website."
(defconst org-html-checkbox-types
'((unicode .
- ((on . "&#x2611;") (off . "&#x2610;") (trans . "&#x2610;")))
+ ((on . "&#x2611;") (off . "&#x2610;") (trans . "&#x2610;")))
(ascii .
- ((on . "<code>[X]</code>")
- (off . "<code>[&#xa0;]</code>")
- (trans . "<code>[-]</code>")))
+ ((on . "<code>[X]</code>")
+ (off . "<code>[&#xa0;]</code>")
+ (trans . "<code>[-]</code>")))
(html .
((on . "<input type='checkbox' checked='checked' />")
- (off . "<input type='checkbox' />")
- (trans . "<input type='checkbox' />"))))
+ (off . "<input type='checkbox' />")
+ (trans . "<input type='checkbox' />"))))
"Alist of checkbox types.
The cdr of each entry is an alist list three checkbox types for
HTML export: `on', `off' and `trans'.
@@ -1129,7 +1133,7 @@ The choices are:
`html' HTML checkboxes
Note that only the ascii characters implement tri-state
-checkboxes. The other two use the `off' checkbox for `trans'.")
+checkboxes. The other two use the `off' checkbox for `trans'.")
(defcustom org-html-checkbox-type 'ascii
"The type of checkboxes to use for HTML export.
@@ -1192,7 +1196,7 @@ You can also customize this for each buffer, using something like
For further information about MathJax options, see the MathJax documentation:
- http://docs.mathjax.org/"
+ https://docs.mathjax.org/"
:group 'org-export-html
:package-version '(Org . "8.3")
:type '(list :greedy t
@@ -1252,8 +1256,7 @@ For further information about MathJax options, see the MathJax documentation:
}
});
</script>
-<script type=\"text/javascript\"
- src=\"%PATH\"></script>"
+<script src=\"%PATH\"></script>"
"The MathJax template. See also `org-html-mathjax-options'."
:group 'org-export-html
:type 'string)
@@ -1414,10 +1417,9 @@ ignored."
;;;; Template :: Scripts
-(defcustom org-html-head-include-scripts t
+(defcustom org-html-head-include-scripts nil
"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."
+The actual script is defined in `org-html-scripts'."
:group 'org-export-html
:version "24.4"
:package-version '(Org . "8.0")
@@ -1425,6 +1427,23 @@ not be modified."
;;;; Template :: Styles
+(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))
+
(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
@@ -1447,14 +1466,12 @@ done, timestamp, timestamp-kwd, tag, target.
For example, a valid value would be:
- <style type=\"text/css\">
- /*<![CDATA[*/
+ <style>
p { font-weight: normal; color: gray; }
h1 { color: black; }
.title { text-align: center; }
.todo, .timestamp-kwd { color: red; }
.done { color: green; }
- /*]]>*/
</style>
If you want to refer to an external style, use something like
@@ -1588,7 +1605,7 @@ CSS classes, then this prefix can be very useful."
(defun org-html-html5-p (info)
(let ((dt (downcase (plist-get info :html-doctype))))
- (member dt '("html5" "xhtml5" "<!doctype html>"))))
+ (member dt '("html5" "xhtml5" "<!doctype html>"))))
(defun org-html--html5-fancy-p (info)
"Non-nil when exporting to HTML5 with fancy elements.
@@ -1680,43 +1697,20 @@ 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."
- (if (string= "svg" (file-name-extension source))
- (org-html--svg-image source attributes info)
- (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)))
- attributes))
- info)))
-
-(defun org-html--svg-image (source attributes info)
- "Return \"object\" embedding svg file SOURCE with given ATTRIBUTES.
-INFO is a plist used as a communication channel.
-
-The special attribute \"fallback\" can be used to specify a
-fallback image file to use if the object embedding is not
-supported. CSS class \"org-svg\" is assigned as the class of the
-object unless a different class is specified with an attribute."
- (let ((fallback (plist-get attributes :fallback))
- (attrs (org-html--make-attribute-string
- (org-combine-plists
- ;; Remove fallback attribute, which is not meant to
- ;; appear directly in the attributes string, and
- ;; provide a default class if none is set.
- '(:class "org-svg") attributes '(:fallback nil)))))
- (format "<object type=\"image/svg+xml\" data=\"%s\" %s>\n%s</object>"
- source
- attrs
- (if fallback
- (org-html-close-tag
- "img" (format "src=\"%s\" %s" fallback attrs) info)
- "Sorry, your browser does not support SVG."))))
+ (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)))
+ (if (string= "svg" (file-name-extension source))
+ (org-combine-plists '(:class "org-svg") attributes '(:fallback nil))
+ attributes)))
+ info))
(defun org-html--textarea-block (element)
"Transcode ELEMENT into a textarea block.
@@ -1820,12 +1814,12 @@ INFO is a plist used as a communication channel."
(anchor (org-html--anchor
(format "fn.%d" n)
n
- (format " class=\"footnum\" href=\"#fnr.%d\"" n)
+ (format " class=\"footnum\" href=\"#fnr.%d\" role=\"doc-backlink\"" n)
info))
(contents (org-trim (org-export-data def info))))
(format "<div class=\"footdef\">%s %s</div>\n"
(format (plist-get info :html-footnote-format) anchor)
- (format "<div class=\"footpara\">%s</div>"
+ (format "<div class=\"footpara\" role=\"doc-footnote\">%s</div>"
(if (not inline?) contents
(format "<p class=\"footpara\">%s</p>"
contents))))))))
@@ -1835,78 +1829,93 @@ INFO is a plist used as a communication channel."
;;; Template
+(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"))))
+
+(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
+ "\"" "&quot;"
+ (org-html-encode-plain-text
+ (if content-formatters
+ (apply #'format content-format content-formatters)
+ content-format)))))
+ "\" />\n"))
+
(defun org-html--build-meta-info (info)
"Return meta tags for exported document.
INFO is a plist used as a communication channel."
- (let* ((protect-string
- (lambda (str)
- (replace-regexp-in-string
- "\"" "&quot;" (org-html-encode-plain-text str))))
- (title (org-export-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 "&lrm;"))
- (author (and (plist-get info :with-author)
- (let ((auth (plist-get info :author)))
- ;; Return raw Org syntax.
- (and auth (org-element-interpret-data auth)))))
- (description (plist-get info :description))
- (keywords (plist-get info :keywords))
- (charset (or (and org-html-coding-system
- (fboundp 'coding-system-get)
- (coding-system-get org-html-coding-system
- 'mime-charset))
- "iso-8859-1")))
+ (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 "&lrm;"))
+ (charset (or (and org-html-coding-system
+ (fboundp 'coding-system-get)
+ (symbol-name
+ (coding-system-get org-html-coding-system
+ 'mime-charset)))
+ "iso-8859-1")))
(concat
(when (plist-get info :time-stamp-file)
(format-time-string
(concat "<!-- "
(plist-get info :html-metadata-timestamp-format)
" -->\n")))
- (format
- (if (org-html-html5-p info)
- (org-html-close-tag "meta" "charset=\"%s\"" info)
- (org-html-close-tag
- "meta" "http-equiv=\"Content-Type\" content=\"text/html;charset=%s\""
- info))
- charset) "\n"
+
+ (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)))
+
(let ((viewport-options
(cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
(plist-get info :html-viewport))))
- (and viewport-options
- (concat
- (org-html-close-tag
- "meta"
- (format "name=\"viewport\" content=\"%s\""
- (mapconcat
- (lambda (elm) (format "%s=%s" (car elm) (cadr elm)))
- viewport-options ", "))
- info)
- "\n")))
+ (if viewport-options
+ (org-html--build-meta-entry "name" "viewport"
+ (mapconcat
+ (lambda (elm)
+ (format "%s=%s" (car elm) (cadr elm)))
+ viewport-options ", "))))
+
(format "<title>%s</title>\n" title)
- (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\"" info)
- "\n"
- (and (org-string-nw-p author)
- (concat
- (org-html-close-tag "meta"
- (format "name=\"author\" content=\"%s\""
- (funcall protect-string author))
- info)
- "\n"))
- (and (org-string-nw-p description)
- (concat
- (org-html-close-tag "meta"
- (format "name=\"description\" content=\"%s\"\n"
- (funcall protect-string description))
- info)
- "\n"))
- (and (org-string-nw-p keywords)
- (concat
- (org-html-close-tag "meta"
- (format "name=\"keywords\" content=\"%s\""
- (funcall protect-string keywords))
- info)
- "\n")))))
+
+ (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))
+ ""))))
(defun org-html--build-head (info)
"Return information for the <head>..</head> of the HTML output.
@@ -2088,7 +2097,10 @@ holding export options."
(org-html--build-pre/postamble 'preamble info)
;; Document contents.
(let ((div (assq 'content (plist-get info :html-divs))))
- (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
+ (format "<%s id=\"%s\" class=\"%s\">\n"
+ (nth 1 div)
+ (nth 2 div)
+ (plist-get info :html-content-class)))
;; Document title.
(when (plist-get info :with-title)
(let ((title (and (plist-get info :with-title)
@@ -2104,7 +2116,7 @@ holding export options."
(if subtitle
(format
(if html5-fancy
- "<p class=\"subtitle\">%s</p>\n"
+ "<p class=\"subtitle\" role=\"doc-subtitle\">%s</p>\n"
(concat "\n" (org-html-close-tag "br" nil info) "\n"
"<span class=\"subtitle\">%s</span>\n"))
(org-export-data subtitle info))
@@ -2232,7 +2244,7 @@ is the language used for CODE, as a string, or nil."
(if (and beg end) (substring code beg end) code)))))))))
(defun org-html-do-format-code
- (code &optional lang refs retain-labels num-start wrap-lines)
+ (code &optional lang refs retain-labels num-start wrap-lines)
"Format CODE string as source code.
Optional arguments LANG, REFS, RETAIN-LABELS, NUM-START, WRAP-LINES
are, respectively, the language of the source code, as a string, an
@@ -2305,14 +2317,14 @@ of contents as a string, or nil if it is empty."
(org-export-get-relative-level headline info)))
(org-export-collect-headlines info depth scope))))
(when toc-entries
- (let ((toc (concat "<div id=\"text-table-of-contents\">"
+ (let ((toc (concat "<div id=\"text-table-of-contents\" role=\"doc-toc\">"
(org-html--toc-text toc-entries)
"</div>\n")))
(if scope toc
(let ((outer-tag (if (org-html--html5-fancy-p info)
"nav"
"div")))
- (concat (format "<%s id=\"table-of-contents\">\n" outer-tag)
+ (concat (format "<%s id=\"table-of-contents\" role=\"doc-toc\">\n" outer-tag)
(let ((top-level (plist-get info :html-toplevel-hlevel)))
(format "<h%d>%s</h%d>\n"
top-level
@@ -2585,7 +2597,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
(format
(plist-get info :html-footnote-format)
(org-html--anchor
- id n (format " class=\"footref\" href=\"#fn.%d\"" n) info)))))
+ id n (format " class=\"footref\" href=\"#fn.%d\" role=\"doc-backlink\"" n) info)))))
;;;; Headline
@@ -2650,7 +2662,7 @@ holding contextual information."
(format
"<span class=\"section-number-%d\">%s</span> "
level
- (mapconcat #'number-to-string numbers ".")))
+ (concat (mapconcat #'number-to-string numbers ".") ".")))
formatted-text)
level)
;; When there is no section, pretend there is an
@@ -2720,7 +2732,7 @@ holding contextual information."
todo todo-type priority text tags contents info)))
(defun org-html-format-inlinetask-default-function
- (todo todo-type priority text tags contents info)
+ (todo todo-type priority text tags contents info)
"Default format function for inlinetasks.
See `org-html-format-inlinetask-function' for details."
(format "<div class=\"inlinetask\">\n<b>%s</b>%s\n%s</div>"
@@ -3020,7 +3032,8 @@ images, set it to:
(`paragraph element)
(`link (org-export-get-parent element)))))
(and (eq (org-element-type paragraph) 'paragraph)
- (or (not (fboundp 'org-html-standalone-image-predicate))
+ (or (not (and (boundp 'org-html-standalone-image-predicate)
+ (fboundp org-html-standalone-image-predicate)))
(funcall org-html-standalone-image-predicate paragraph))
(catch 'exit
(let ((link-count 0))
@@ -3464,12 +3477,12 @@ contextual information."
(if (org-export-read-attribute :attr_html src-block :textarea)
(org-html--textarea-block src-block)
(let* ((lang (org-element-property :language src-block))
- (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")))))
+ (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")))))
(if (not lang) (format "<pre class=\"example\"%s>\n%s</pre>" label code)
(format "<div class=\"org-src-container\">\n%s%s\n</div>"
;; Build caption.
@@ -3773,7 +3786,7 @@ contextual information."
;;;###autoload
(defun org-html-export-as-html
- (&optional async subtreep visible-only body-only ext-plist)
+ (&optional async subtreep visible-only body-only ext-plist)
"Export current buffer to an HTML buffer.
If narrowing is active in the current buffer, only export its
@@ -3818,7 +3831,7 @@ to convert it."
;;;###autoload
(defun org-html-export-to-html
- (&optional async subtreep visible-only body-only ext-plist)
+ (&optional async subtreep visible-only body-only ext-plist)
"Export current buffer to a HTML file.
If narrowing is active in the current buffer, only export its