compat/asciidoc.conf in asciidoctor-0.1.2 vs compat/asciidoc.conf in asciidoctor-0.1.3
- old
+ new
@@ -18,42 +18,120 @@
# plus introduced in AsciiDoc 8.6.9
plus=+
space=" "
tilde=~
+# enables markdown-style headings
+[titles]
+sect0=^(=|#) +(?P<title>[\S].*?)(?: +\1)?$
+sect1=^(==|##) +(?P<title>[\S].*?)(?: +\1)?$
+sect2=^(===|###) +(?P<title>[\S].*?)(?: +\1)?$
+sect3=^(====|####) +(?P<title>[\S].*?)(?: +\1)?$
+sect4=^(=====|#####) +(?P<title>[\S].*?)(?: +\1)?$
+
# enables fenced code blocks
-# I haven't sorted out yet how to do syntax highlighting
+# FIXME I haven't sorted out yet how to do syntax highlighting
[blockdef-fenced-code]
delimiter=^```\w*$
template::[blockdef-listing]
+# enables blockquotes to be defined using two double quotes
+[blockdef-air-quote]
+delimiter=^""$
+template::[blockdef-quote]
+
+# markdown-style blockquote (paragraph only)
+# FIXME does not strip leading > on subsequent lines
+[paradef-markdown-quote]
+delimiter=(?s)>\s*(?P<text>\S.*)
+style=quote
+quote-style=template="quoteparagraph",posattrs=("style","attribution","citetitle")
+
+# fix regex for callout list to require number; also makes markdown-style blockquote work
+[listdef-callout]
+posattrs=style
+delimiter=^<?(?P<index>\d+>) +(?P<text>.+)$
+type=callout
+tags=callout
+style=arabic
+
# enables literal block to be used as code block
[blockdef-literal]
template::[source-filter-style]
+[tabledef-csv]
+template::[tabledef-default]
+delimiter=^,={3,}$
+format=csv
+
+[tabledef-dsv]
+template::[tabledef-default]
+delimiter=^:={3,}$
+format=dsv
+
+[macros]
+# btn:[Save]
+(?su)(?<!\w)\\?btn:\[(?P<attrlist>(?:\\\]|[^\]])+?)\]=button
+
+# kbd:[F11] or kbd:[Ctrl+T] or kbd:[Ctrl,T]
+(?su)(?<!\w)\\?kbd:\[(?P<attrlist>(?:\\\]|[^\]])+?)\]=keyboard
+
+# menu:Search[] or menu:File[New...] or menu:View[Page Style, No Style]
+# TODO implement menu:View[Page Style > No Style] syntax
+(?su)(?<!\w)[\\]?(?P<name>menu):(?P<target>\w|\w.*?\S)?\[(?P<attrlist>.*?)\]=
+
ifdef::basebackend-html[]
+[button-inlinemacro]
+<b class="button">{1}</b>
+
+[keyboard-inlinemacro]
+{set2:keys:{eval:re.split(r'(?<!\+ |.\+)\+', '{1}')}}
+{2%}{eval:len({keys}) == 1}<kbd>{1}</kbd>
+{2%}{eval:len({keys}) == 2}<kbd class="combo"><kbd>{eval:{keys}[0].strip()}</kbd>+<kbd>{eval:{keys}[1].strip()}</kbd></kbd>
+{2%}{eval:len({keys}) == 3}<kbd class="combo"><kbd>{eval:{keys}[0].strip()}</kbd>+<kbd>{eval:{keys}[1].strip()}</kbd>+<kbd>{eval:{keys}[2].strip()}</kbd></kbd>
+{2#}{3%}<kbd class="combo"><kbd>{1}</kbd>+<kbd>{2}</kbd></kbd>
+{3#}<kbd class="combo"><kbd>{1}</kbd>+<kbd>{2}</kbd>+<kbd>{3}</kbd></kbd>
+
+[menu-inlinemacro]
+{1%}<span class="menu">{target}</span>
+{1#}{2%}<span class="menuseq"><span class="menu">{target}</span> ▸ <span class="menuitem">{1}</span></span>
+{2#}{3%}<span class="menuseq"><span class="menu">{target}</span> ▸ <span class="submenu">{1}</span> ▸ <span class="menuitem">{2}</span></span>
+{3#}<span class="menuseq"><span class="menu">{target}</span> ▸ <span class="submenu">{1}</span> ▸ <span class="submenu">{2}</span> ▸ <span class="menuitem">{3}</span></span>
+
[literal-inlinemacro]
<code>{passtext}</code>
[tags]
+emphasis=<em{1? class="{1}"}>|</em>
+strong=<strong{1? class="{1}"}>|</strong>
monospaced=<code{1? class="{1}"}>|</code>
+superscript=<sup{1? class="{1}"}>|</sup>
+subscript=<sub{1? class="{1}"}>|</sub>
[monospacedwords]
<code>{words}</code>
+[listtags-numbered]
+list=<div class="olist{style? {style}}{compact-option? compact}{role? {role}}"{id? id="{id}"}>{title?<div class="title">{title}</div>}<ol class="{style}"{style@loweralpha: type="a"}{style@lowerroman: type="i"}{style@upperalpha: type="A"}{style@upperroman: type="I"}{start? start="{start}"}>|</ol></div>
+
[tabletags-monospaced]
paragraph=<p class="tableblock"><code>|</code></p>
+[sect0]
+<h1{id? id="{id}"} class="sect0">{title}</h1>
+|
+
# support for document title in embedded documents
ifeval::[not config.header_footer]
[preamble]
<h1>{title={doctitle}}</h1>{set:title-rendered:}
<div id="preamble">
<div class="sectionbody">
|
</div>
+{toc,toc2#}{toc-placement$preamble:}{template:toc}
</div>
[sect1]
{title-rendered%}<h1>{doctitle}</h1>
<div class="sect1{style? {style}}{role? {role}}">
@@ -107,31 +185,70 @@
|
</pre>
template::[attribution]
</div>
+# override tabletags to support cellbgcolor
+[tabletags-default]
+headdata=<th class="tableblock halign-{halign=left} valign-{valign=top}"{colspan@1:: colspan="{colspan}"}{rowspan@1:: rowspan="{rowspan}"}{cellbgcolor? style="background-color:{cellbgcolor};"}>|</th>
+bodydata=<td class="tableblock halign-{halign=left} valign-{valign=top}"{colspan@1:: colspan="{colspan}"}{rowspan@1:: rowspan="{rowspan}"}{cellbgcolor? style="background-color:{cellbgcolor};"}>|</td>
+
+[toc]
+<div id="toc">
+<div id="toctitle">{toc-title}</div>
+ifdef::toc2[]
+<script type="text/javascript">
+document.body.className += ' toc2';
+document.getElementById('toc').className = 'toc2';
+</script>
+endif::toc2[]
+<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
+</div>
+
endif::basebackend-html[]
# Override docinfo to support subtitle
ifdef::basebackend-docbook[]
+[button-inlinemacro]
+<guibutton>{1}</guibutton>
+
+[keyboard-inlinemacro]
+{set2:keys:{eval:re.split(r'(?<!\+ |.\+)\+', '{1}')}}
+{2%}{eval:len({keys}) == 1}<keycap>{1}</keycap>
+{2%}{eval:len({keys}) == 2}<keycombo><keycap>{eval:{keys}[0].strip()}</keycap><keycap>{eval:{keys}[1].strip()}</keycap></keycombo>
+{2%}{eval:len({keys}) == 3}<keycombo><keycap>{eval:{keys}[0].strip()}</keycap><keycap>{eval:{keys}[1].strip()}</keycap><keycap>{eval:{keys}[2].strip()}</keycap></keycombo>
+{2#}{3%}<keycombo><keycap>{1}</keycap><keycap>{2}</keycap></keycombo>
+{3#}<keycombo><keycap>{1}</keycap><keycap>{2}</keycap><keycap>{3}</keycap></keycombo>
+
+[menu-inlinemacro]
+{1%}<guimenu>{target}</guimenu>
+{1#}{2%}<menuchoice><guimenu>{target}</guimenu> <guimenuitem>{1}</guimenuitem></menuchoice>
+{2#}{3%}<menuchoice><guimenu>{target}</guimenu> <guisubmenu>{1}</guisubmenu> <guimenuitem>{2}</guimenuitem></menuchoice>
+{3#}<menuchoice><guimenu>{target}</guimenu> <guisubmenu>{1}</guisubmenu> <guisubmenu>{2}</guisubmenu> <guimenuitem>{3}</guimenuitem></menuchoice>
+
+# override tabletags to support cellbgcolor
+[tabletags-default]
+headdata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}>{cellbgcolor?<?dbfo bgcolor="{cellbgcolor}"?>}|</entry>
+bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}>{cellbgcolor?<?dbfo bgcolor="{cellbgcolor}"?>}|</entry>
+
[docinfo]
ifndef::notitle[]
{set2:subtitle_offset:{eval:'{doctitle}'.rfind(': ')}}
-{eval:{subtitle_offset} != -1} <title>{eval:'{doctitle}'[0:{subtitle_offset}]}</title>
-{eval:{subtitle_offset} != -1} <subtitle>{eval:'{doctitle}'[{subtitle_offset} + 2:]}</subtitle>
-{eval:{subtitle_offset} < 0} <title>{doctitle}</title>
+{eval:{subtitle_offset} != -1}<title>{eval:'{doctitle}'[0:{subtitle_offset}]}</title>
+{eval:{subtitle_offset} != -1}<subtitle>{eval:'{doctitle}'[{subtitle_offset} + 2:]}</subtitle>
+{eval:{subtitle_offset} < 0}<title>{doctitle}</title>
endif::notitle[]
- <date>{revdate}</date>
+<date>{revdate}</date>
# To ensure valid articleinfo/bookinfo when there is no AsciiDoc header.
- {doctitle%}{revdate%}<date>{docdate}</date>
- {authored#}<author>
- <firstname>{firstname}</firstname>
- <othername>{middlename}</othername>
- <surname>{lastname}</surname>
- <email>{email}</email>
- {authored#}</author>
- <authorinitials>{authorinitials}</authorinitials>
+{doctitle%}{revdate%}<date>{docdate}</date>
+{authored#}<author>
+<firstname>{firstname}</firstname>
+<othername>{middlename}</othername>
+<surname>{lastname}</surname>
+<email>{email}</email>
+{authored#}</author>
+<authorinitials>{authorinitials}</authorinitials>
<revhistory><revision>{revnumber?<revnumber>{revnumber}</revnumber>}<date>{revdate}</date>{authorinitials?<authorinitials>{authorinitials}</authorinitials>}{revremark?<revremark>{revremark}</revremark>}</revision></revhistory>
{docinfo1,docinfo2#}{include:{docdir}/docinfo.xml}
{docinfo,docinfo2#}{include:{docdir}/{docname}-docinfo.xml}
<orgname>{orgname}</orgname>