#
# xhtml11.conf
#
# Asciidoc configuration file.
# xhtml11 backend, generates XHTML 1.1 conformant markup.
#

[miscellaneous]
outfilesuffix=.html

[attributes]
basebackend=html
basebackend-html=

[replacements2]
# Line break.
(?m)^(.*)\s\+$=\1<br />

[replacements]
ifdef::asciidoc7compatible[]
# Superscripts.
\^(.+?)\^=<sup>\1</sup>
# Subscripts.
~(.+?)~=<sub>\1</sub>
endif::asciidoc7compatible[]

[ruler-blockmacro]
<hr />

[pagebreak-blockmacro]
<div style="page-break-after:always"></div>

[blockdef-pass]
asciimath-style=template="asciimathblock",subs=[]
latexmath-style=template="latexmathblock",subs=[]

[macros]
# math macros.
# Special characters are escaped in HTML math markup.
(?su)[\\]?(?P<name>asciimath|latexmath):(?P<subslist>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=[specialcharacters]
(?u)^(?P<name>asciimath|latexmath)::(?P<subslist>\S*?)(\[(?P<passtext>.*?)\])$=#[specialcharacters]

[asciimath-inlinemacro]
`{passtext}`

[asciimath-blockmacro]
<div class="mathblock"{id? id="{id}"}>
<div class="content">
<div class="title">{title}</div>
`{passtext}`
</div></div>

[asciimathblock]
<div class="mathblock"{id? id="{id}"}>
<div class="content">
<div class="title">{title}</div>
`|`
</div></div>

[latexmath-inlinemacro]
{passtext}

[latexmath-blockmacro]
<div class="mathblock"{id? id="{id}"}>
<div class="content">
<div class="title">{title}</div>
{passtext}
</div></div>

[latexmathblock]
<div class="mathblock"{id? id="{id}"}>
<div class="content">
<div class="title">{title}</div>
|
</div></div>

[image-inlinemacro]
<span class="image">
<a class="image" href="{link}">
<img src="{imagesdir=}{imagesdir?/}{target}" alt="{target}"{width? width="{width}"}{height? height="{height}"} />
{link#}</a>
</span>

[image-blockmacro]
<div class="imageblock"{id? id="{id}"}>
<div class="content">
<a class="image" href="{link}">
<img src="{imagesdir=}{imagesdir?/}{target}" alt="{target}"{width? width="{width}"}{height? height="{height}"} />
{link#}</a>
</div>
<div class="title">{caption={figure_caption}}{title}</div>
</div>

[indexterm-inlinemacro]
# Index term.
{empty}

[indexterm2-inlinemacro]
# Index term.
# Single entry index term that is visible in the primary text flow.
{1}

[footnote-inlinemacro]
# Footnote.
<br />[{0}]<br />

[footnoteref-inlinemacro]
# Footnote reference.
{2#}<br />Footnote {1} [{2}]<br />
{2%}<br />[See footnote {1}]<br />

[callout-inlinemacro]
# Callout.
<b>&lt;{index}&gt;</b>

# Comment line macros.
[comment-inlinemacro]
{showcomments#}<br /><span class="comment">{passtext}</span><br />

[comment-blockmacro]
{showcomments#}<p><span class="comment">{passtext}</span></p>

[literal-inlinemacro]
# Inline literal.
<tt>{passtext}</tt>

# List tags.
[listtags-bulleted]
list=<div class="ulist{style? {style}}{compact-option? compact}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ul>|</ul></div>
item=<li>|</li>
text=<p>|</p>

[listtags-numbered]
list=<div class="olist{style? {style}}{compact-option? compact}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ol class="{style}">|</ol></div>
item=<li>|</li>
text=<p>|</p>

[listtags-labeled]
list=<div class="dlist{compact-option? compact}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<dl>|</dl></div>
entry=
label=
term=<dt class="hdlist1{strong-option? strong}">|</dt>
item=<dd>|</dd>
text=<p>|</p>

[listtags-horizontal]
list=<div class="hdlist{compact-option? compact}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<table>{labelwidth?<col width="{labelwidth}%" />}{itemwidth?<col width="{itemwidth}%" />}|</table></div>
label=<td class="hdlist1{strong-option? strong}">|</td>
term=|<br />
entry=<tr>|</tr>
item=<td class="hdlist2">|</td>
text=<p style="margin-top: 0;">|</p>

[listtags-qanda]
list=<div class="qlist{style? {style}}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ol>|</ol></div>
entry=<li>|</li>
label=
term=<p><em>|</em></p>
item=
text=<p>|</p>

[listtags-callout]
list=<div class="colist{style? {style}}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ol>|</ol></div>
item=<li>|</li>
text=<p>|</p>

[listtags-glossary]
list=<div class="dlist{style? {style}}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<dl>|</dl></div>
label=
entry=
term=<dt>|</dt>
item=<dd>|</dd>
text=<p>|</p>

[listtags-bibliography]
list=<div class="ulist{style? {style}}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ul>|</ul></div>
item=<li>|</li>
text=<p>|</p>

[tags]
# Quoted text.
emphasis=<em{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</em>
strong=<strong{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</strong>
monospaced=<tt{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</tt>
singlequoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}{amp}#8216;|{amp}#8217;{0?</span>}
doublequoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}{amp}#8220;|{amp}#8221;{0?</span>}
unquoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}|{0?</span>}
superscript=<sup{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</sup>
subscript=<sub{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</sub>

# Inline macros
[http-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[https-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[ftp-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[file-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[irc-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[mailto-inlinemacro]
<a href="mailto:{target}">{0={target}}</a>
[link-inlinemacro]
<a href="{target}">{0={target}}</a>
[callto-inlinemacro]
<a href="{name}:{target}">{0={target}}</a>
# anchor:id[text]
[anchor-inlinemacro]
<a id="{target}"></a>
# [[id,text]]
[anchor2-inlinemacro]
<a id="{1}"></a>
# [[[id]]]
[anchor3-inlinemacro]
<a id="{1}"></a>[{1}]
# xref:id[text]
[xref-inlinemacro]
<a href="#{target}">{0=[{target}]}</a>
# <<id,text>>
[xref2-inlinemacro]
<a href="#{1}">{2=[{1}]}</a>

# Special word substitution.
[emphasizedwords]
<em>{words}</em>
[monospacedwords]
<tt>{words}</tt>
[strongwords]
<strong>{words}</strong>

# Paragraph substitution.
[paragraph]
<div class="paragraph"{id? id="{id}"}>{title?<div class="title">{title}</div>}<p>
|
</p></div>

[literalparagraph]
# The literal block employs the same markup.
template::[literalblock]

[verseparagraph]
# The verse block employs the same markup.
template::[verseblock]

[admonitionparagraph]
# The admonition block employs the same markup.
template::[admonitionblock]

# Delimited blocks.
[listingblock]
<div class="listingblock"{id? id="{id}"}>
<div class="title">{caption=}{title}</div>
<div class="content">
<pre><tt>
|
</tt></pre>
</div></div>

[literalblock]
<div class="literalblock"{id? id="{id}"}>
<div class="title">{title}</div>
<div class="content">
<pre><tt>
|
</tt></pre>
</div></div>

[sidebarblock]
<div class="sidebarblock"{id? id="{id}"}>
<div class="content">
<div class="title">{title}</div>
|
</div></div>

[abstractblock]
template::[quoteblock]

[quoteblock]
<div class="quoteblock"{id? id="{id}"}>
<div class="title">{title}</div>
<div class="content">
|
</div>
<div class="attribution">
<em>{citetitle}</em>{attribution?<br />}
&#8212; {attribution}
</div></div>

[verseblock]
<div class="verseblock"{id? id="{id}"}>
<div class="title">{title}</div>
<div class="content">
|
</div>
<div class="attribution">
<em>{citetitle}</em>{attribution?<br />}
&#8212; {attribution}
</div></div>

[exampleblock]
<div class="exampleblock"{id? id="{id}"}>
<div class="title">{caption=}{title}</div>
<div class="content">
|
</div></div>

[admonitionblock]
<div class="admonitionblock"{id? id="{id}"}>
<table><tr>
<td class="icon">
{icons#}<img src="{icon={iconsdir}/{name}.png}" alt="{caption}" />
{icons%}<div class="title">{caption}</div>
</td>
<td class="content">
<div class="title">{title}</div>
|
</td>
</tr></table>
</div>

# Tables.
[tabletags-default]
colspec=<col{autowidth-option! width="{colpcwidth}%"} />
bodyrow=<tr>|</tr>
headdata=<th {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }align="{align}" valign="{valign}">|</th>
bodydata=<td {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }align="{align}" valign="{valign}">|</td>
paragraph=<p class="table">|</p>

[tabletags-emphasis]
paragraph=<p class="table"><em>|</em></p>

[tabletags-strong]
paragraph=<p class="table"><strong>|</strong></p>

[tabletags-monospaced]
paragraph=<p class="table"><tt>|</tt></p>

[tabletags-verse]
bodydata=<td {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }align="{align}" valign="{valign}"><div class="verse">|</div></td>
paragraph=

[tabletags-literal]
bodydata=<td {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }align="{align}" valign="{valign}"><div class="literal"><pre><tt>|</tt></pre></div></td>
paragraph=

[tabletags-asciidoc]
bodydata=<td {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }align="{align}" valign="{valign}"><div>|</div></td>
paragraph=

[table]
<div class="tableblock"{id? id="{id}"}>
<table rules="{grid=all}"
{autowidth-option%}width="{tablepcwidth}%"
{autowidth-option#}{width#width="{tablepcwidth}%"}
frame="{frame%border}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
<caption class="title">{caption={table_caption}}{title}</caption>
{colspecs}
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody>
{bodyrows}
</tbody>
</table>
</div>

#--------------------------------------------------------------------
# Deprecated old table definitions.
#

[miscellaneous]
# Screen width in pixels.
pagewidth=800
pageunits=

[old_tabledef-default]
template=old_table
colspec=<col width="{colwidth}{pageunits}" />
bodyrow=<tr>|</tr>
headdata=<th align="{colalign}">|</th>
footdata=<td align="{colalign}">|</td>
bodydata=<td align="{colalign}">|</td>

[old_table]
<div class="tableblock"{id? id="{id}"}>
<table rules="{grid=none}"
frame="{frame%hsides}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
<caption class="title">{caption={table_caption}}{title}</caption>
{colspecs}
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody valign="top">
{bodyrows}
</tbody>
</table>
</div>

# End of deprecated old table definitions.
#--------------------------------------------------------------------

[floatingtitle]
<h{level@1:2}{level@2:3}{level@3:4}{level@4:5}{id? id="{id}"}>{title}</h{level@1:2}{level@2:3}{level@3:4}{level@4:5}>

[preamble]
# Untitled elements between header and first section title.
<div id="preamble"{id? id="{id}"}>
<div class="sectionbody">
|
</div>
</div>

# Document sections.
[sect0]
<h1{id? id="{id}"}>{title}</h1>
|

[sect1]
<h2{id? id="{id}"}>{numbered?{sectnum} }{title}</h2>
<div class="sectionbody">
|
</div>

[sect2]
<h3{id? id="{id}"}>{numbered?{sectnum} }{title}</h3>
|

[sect3]
<h4{id? id="{id}"}>{numbered?{sectnum} }{title}</h4>
|

[sect4]
<h5{id? id="{id}"}>{title}</h5>
|

[header]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}">
<head>
<meta http-equiv="Content-Type" content="{quirks=application/xhtml+xml}{quirks?text/html}; charset={encoding}" />
<meta name="generator" content="AsciiDoc {asciidoc-version}" />
<title>{doctitle=}</title>
ifdef::linkcss[]
<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}.css" type="text/css" />
{doctype-manpage}<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}-manpage.css" type="text/css" />
ifdef::quirks[]
<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}-quirks.css" type="text/css" />
endif::quirks[]
<link rel="stylesheet" href="{stylesdir=.}/{stylesheet}" type="text/css" />
endif::linkcss[]
ifndef::linkcss[]
<style type="text/css">
include1::{stylesdir=./stylesheets}/{theme={backend}}.css[]
ifdef::doctype-manpage[]
include1::{stylesdir=./stylesheets}/{theme={backend}}-manpage.css[]
endif::doctype-manpage[]
ifdef::quirks[]
include1::{stylesdir=./stylesheets}/{theme={backend}}-quirks.css[]
endif::quirks[]
include1::{stylesheet}[]
</style>
endif::linkcss[]
ifdef::toc[]
ifdef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
window.onload = function()\{generateToc({toclevels=2})\}
/*]]>*/
</script>
<script type="text/javascript" src="{scriptsdir=.}/toc.js"></script>
endif::linkcss[]
ifndef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
window.onload = function()\{generateToc({toclevels=2})\}
include1::{scriptsdir=./javascripts}/toc.js[]
/*]]>*/
</script>
endif::linkcss[]
endif::toc[]
ifdef::asciimath[]
ifdef::linkcss[]
<script type="text/javascript" src="{scriptsdir=.}/ASCIIMathML.js"></script>
endif::linkcss[]
ifndef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
include1::{scriptsdir=./javascripts}/ASCIIMathML.js[]
/*]]>*/
</script>
endif::linkcss[]
endif::asciimath[]
ifdef::latexmath[]
ifdef::linkcss[]
<script type="text/javascript" src="{scriptsdir=.}/LaTeXMathML.js"></script>
endif::linkcss[]
ifndef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
include1::{scriptsdir=./javascripts}/LaTeXMathML.js[]
/*]]>*/
</script>
endif::linkcss[]
endif::latexmath[]
</head>
<body>
# Article, book header.
ifndef::doctype-manpage[]
<div id="header">
<h1>{doctitle}</h1>
{doctitle#}<span id="author">{author}</span><br />
{doctitle#}<span id="email"><tt>&lt;<a href="mailto:{email}">{email}</a>&gt;</tt></span><br />
{doctitle#}<span id="revnumber">version {revnumber}{revdate?,}</span>
{doctitle#}<span id="revdate">{revdate}</span>
{doctitle#}<br /><span id="revremark">{revremark}</span>
ifdef::toc[]
<div id="toc">
  <div id="toctitle">{toc_title}</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
endif::toc[]
</div>
endif::doctype-manpage[]
# Man page header.
ifdef::doctype-manpage[]
<div id="header">
<h1>
{doctitle} Manual Page
</h1>
ifdef::toc[]
<div id="toc">
  <div id="toctitle">{toc_title}</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
endif::toc[]
<h2>{manname_title}</h2>
<div class="sectionbody">
<p>{manname} -
   {manpurpose}
</p>
</div>
</div>
endif::doctype-manpage[]

[footer]
<div id="footer">
<div id="footer-text">
Version {revnumber}<br />
Last updated {docdate} {doctime}
</div>
ifdef::badges[]
<div id="footer-badges">
ifndef::icons[]
Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a>
and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.
endif::icons[]
ifdef::icons[]
<a href="http://validator.w3.org/check?uri=referer">
  <img style="border:0;width:88px;height:31px"
    src="http://www.w3.org/Icons/valid-xhtml11-blue"
    alt="Valid XHTML 1.1" height="31" width="88" />
</a>
<a href="http://jigsaw.w3.org/css-validator/">
  <img style="border:0;width:88px;height:31px"
    src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
    alt="Valid CSS!" />
</a>
<a href="http://www.mozilla.org/products/firefox/">
  <img style="border:none; width:110px; height:32px;"
       src="http://www.spreadfirefox.com/community/images/affiliates/Buttons/110x32/safer.gif"
       alt="Get Firefox!" />
</a>
endif::icons[]
</div>
endif::badges[]
</div>
</body>
</html>

ifdef::doctype-manpage[]
[synopsis]
template::[sect1]
endif::doctype-manpage[]

ifdef::quirks[]
include::{backend}-quirks.conf[]
endif::quirks[]

# If data-uri attribute is defined then embed images in HTML pages using the
# data: URI scheme (http://en.wikipedia.org/wiki/Data:_URI_scheme).
ifdef::data-uri[]

[image-inlinemacro]
<span class="image">
<a class="image" href="{link}">
<img alt="{target}"{width? width="{width}"}{height? height="{height}"} src="data:image/{eval:os.path.splitext('{target}')[1][1:]};base64,
{sys:python -uc "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"}" />
{link#}</a>
</span>

[image-blockmacro]
<div class="imageblock"{id? id="{id}"}>
<div class="content">
<a class="image" href="{link}">
<img alt="{target}"{width? width="{width}"}{height? height="{height}"} src="data:image/{eval:os.path.splitext('{target}')[1][1:]};base64,
{sys:python -uc "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}"}" />
{link#}</a>
</div>
<div class="title">{caption={figure_caption}}{title}</div>
</div>

[admonitionblock]
<div class="admonitionblock"{id? id="{id}"}>
<table><tr>
<td class="icon">
{icons%}<div class="title">{caption}</div>
{icons#}<img alt="{caption}" src="data:image/png;base64,
{icons#}{sys:python -uc "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{outdir={indir}}/{icon={iconsdir}/{name}.png}"}" />
</td>
<td class="content">
<div class="title">{title}</div>
|
</td>
</tr></table>
</div>

endif::data-uri[]
