13.9.3 HTML doctypes
Org can export to various (X)HTML flavors.
Set the org-html-doctype
variable for different (X)HTML variants. Depending on the variant, the HTML exporter adjusts the syntax of HTML conversion accordingly. Org includes the following ready-made variants:
"html4-strict"
"html4-transitional"
"html4-frameset"
"xhtml-strict"
"xhtml-transitional"
"xhtml-frameset"
"xhtml-11"
"html5"
"xhtml5"
See the variable org-html-doctype-alist
for details. The default is "xhtml-strict"
.
Orgβs HTML exporter does not by default enable new block elements introduced with the HTML5 standard. To enable them, set org-html-html5-fancy
to non-nil
. Or use an βOPTIONS
β line in the file to set βhtml5-fancy
β.
HTML5 documents can now have arbitrary β#+BEGIN
β β¦ β#+END
β blocks. For example:
#+BEGIN_aside
Lorem ipsum
#+END_aside
exports to:
<aside>
<p>Lorem ipsum</p>
</aside>
while this:
#+ATTR_HTML: :controls controls :width 350
#+BEGIN_video
#+HTML: <source src="movie.mp4" type="video/mp4">
#+HTML: <source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
#+END_video
exports to:
<video controls="controls" width="350">
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
<p>Your browser does not support the video tag.</p>
</video>
When special blocks do not have a corresponding HTML5 element, the HTML exporter reverts to standard translation (see org-html-html5-elements
). For example, β#+BEGIN_lederhosen
β exports to <div class="lederhosen">
.
Special blocks cannot have headlines. For the HTML exporter to wrap the headline and its contents in <section>
or <article>
tags, set the βHTML_CONTAINER
β property for the headline.