# This file is an AsciiDoc configuration file that makes # AsciiDoc conform with Asciidoctor's fixes and customizations. # # Place this file in the same directory as your AsciiDoc document and the # AsciiDoc processor (asciidoc) will automatically use it. # Copied from from https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/compat/asciidoc.conf # AsciiDoctor is available under the MIT license. [miscellaneous] newline=\n [attributes] # make html5 the default html backend backend-alias-html=html5 apostrophe=' asterisk=* backtick=` brvbar=¦ caret=^ # plus introduced in AsciiDoc 8.6.9 plus=+ space=" " tilde=~ user-home={eval:os.path.expanduser('~')} vbar=| # NOTE use -a no-inline-literal to set compat-mode to default when using AsciiDoc Python ifndef::no-inline-literal[] compat-mode=legacy endif::[] [replacements] # right single quote (?[\S].*?)(?: +\1)?$ sect1=^(==|##) +(?P[\S].*?)(?: +\1)?$ sect2=^(===|###) +(?P<title>[\S].*?)(?: +\1)?$ sect3=^(====|####) +(?P<title>[\S].*?)(?: +\1)?$ sect4=^(=====|#####) +(?P<title>[\S].*?)(?: +\1)?$ sect5=^(======|######) +(?P<title>[\S].*?)(?: +\1)?$ # Disable subs on pass block by default [blockdef-pass] subs=none # enables fenced code blocks # FIXME I haven't sorted out yet how to do syntax highlighting [blockdef-fenced-code] delimiter=^```(?:\w+(?:,numbered)?)?$ ifdef::language[] style=source template::[source-filter-style] endif::language[] ifndef::language[] template=listingblock subs=verbatim posattrs=style endif::language[] # enables blockquotes to be defined using two double quotes [blockdef-air-quote] template::[blockdef-quote] delimiter=^""$ # 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 source block [blockdef-literal] template::[source-filter-style] # enables source block when source-highlighter is not defined ifndef::source-highlighter[] [source-filter-style] source-style=template="listingblock",subs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab") [paradef-default] template::[source-filter-style] [paradef-literal] template::[source-filter-style] [blockdef-open] template::[source-filter-style] [blockdef-listing] template::[source-filter-style] endif::source-highlighter[] [tabledef-csv] template::[tabledef-default] delimiter=^,={3,}$ format=csv [tabledef-dsv] template::[tabledef-default] delimiter=^:={3,}$ format=dsv [macros] ifdef::no-inline-literal[] (?su)\\?\+\+(?P<passtext>.*?)\+\+=pass[specialcharacters] (?su)(?<![+\w])(\\?\+(?P<passtext>\S|\S.*?\S)\+)(?![+\w])=pass[specialcharacters] endif::no-inline-literal[] # additional callout match behind line comments #(?://|#|;;) ?\((?P<index>\d+)\)=callout # additional callout match for XML [\\]?<!--(?P<index>\d+)-->=callout # --- or *** or ___ or - - - or * * * or _ _ _ (in addition to the built-in ''') ^ {0,3}([-\*_])( *)\1\2\1$=#ruler # button:[Save] (?su)(?<!\w)\\?button:\[(?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[] [sect5] <div class="sect5{style? {style}}{role? {role}}"> <h6{id? id="{id}"}>{title}</h6> | </div> [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> mark={1=<mark>}{1?<span class="{1}">}|{1?</span>}{1=</mark>} [monospacedwords] <code>{words}</code> ifdef::linkattrs[] [http-inlinemacro] <a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a> [https-inlinemacro] <a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a> [ftp-inlinemacro] <a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a> [file-inlinemacro] <a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a> [irc-inlinemacro] <a href="{name}:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={name}:{target}}</a> [mailto-inlinemacro] <a href="mailto:{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={target}}</a> [link-inlinemacro] <a href="{target}"{id? id="{id}"}{role? class="{role}"}{window? target="{window}"}>{1={target}}</a> endif::linkattrs[] [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}}"> <h2{id? id="{id}"}>{numbered?{sectnum} }{title}</h2> <div class="sectionbody"> | </div> </div> endif::[] # override to add the admonition name to the class attribute of the outer element [admonitionblock] <div class="admonitionblock {name}{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}> <table><tr> <td class="icon"> {data-uri%}{icons#}<img src="{icon={iconsdir}/{name}.png}" alt="{caption}"> {data-uri#}{icons#}<img alt="{caption}" src="data:image/png;base64, {data-uri#}{icons#}{sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/{name}.png}")}"}"> {icons%}<div class="title">{caption}</div> </td> <td class="content"> <div class="title">{title}</div> | </td> </tr></table> </div> # modified so that: # a. imagesdir is only prepended if target is not a uri or absolute path (relative path only) # b. automatic alt text is calculated from basename of target without extension # note that the escaped_target attribute must be set in order to use a uri in the conditional attribute reference [image-inlinemacro] <span class="image{role? {role}}"{float? style="float: {float}"}>{set2:escaped_target:{eval:'{target}'.replace(':','\:')}} <a class="image" href="{link}"> {data-uri%}<img src="{target@^(/|https?\://).*:{escaped_target}:{imagesdir?{imagesdir}}{imagesdir?/}{escaped_target}}" alt="{alt={eval:os.path.splitext(os.path.basename('{target}'))[0]}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"}> {data-uri#}<img alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"} {data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print 'src=\"data:'+mimetypes.guess_type(r'{target}')[0]+';base64,'; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}"> {link#}</a> </span> # modified so that: # a. imagesdir is only prepended if target is not a uri or absolute path (relative path only) # b. automatic alt text is calculated from basename of target without extension # note that the escaped_target attribute must be set in order to use a uri in the conditional attribute reference [image-blockmacro] <div class="imageblock{style? {style}}{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}{align? style="text-align:{align};"}{float? style="float: {float}"}> <div class="content">{set2:escaped_target:{eval:'{target}'.replace(':','\:')}} <a class="image" href="{link}"> {data-uri%}<img src="{target@^(/|https?\://).*:{escaped_target}:{imagesdir?{imagesdir}}{imagesdir?/}{escaped_target}}" alt="{alt={eval:os.path.splitext(os.path.basename('{target}'))[0]}}"{width? width="{width}"}{height? height="{height}"}> {data-uri#}<img alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"} {data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print 'src=\"data:'+mimetypes.guess_type(r'{target}')[0]+';base64,'; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}"> {link#}</a> </div> <div class="title">{caption={figure-caption} {counter:figure-number}. }{title}</div> </div> # a common template for emitting the attribute for a quote or verse block # don't output attribution div if attribution or citetitle are both empty [attribution] {attribution,citetitle#}<div class="attribution"> — {attribution}{citetitle?<br>} <cite>{citetitle}</cite> {attribution,citetitle#}</div> # override to use blockquote element for content and cite element for cite title [quoteblock] <div class="quoteblock{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}> <div class="title">{title}</div> <blockquote> | </blockquote> template::[attribution] </div> # override to use cite element for cite title [verseblock] <div class="verseblock{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}> <div class="title">{title}</div> <pre class="content"> | </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> # override header cells to use th [tabletags-header] bodydata=<th class="tableblock halign-{halign=left} valign-{valign=top}" {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }>|</th> paragraph=<p class="tableblock">|</p> [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[] [sect5] <section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}> <title>{title} | [tags] monospaced=| subscript=| superscript=| [button-inlinemacro] {1} [keyboard-inlinemacro] {set2:keys:{eval:re.split(r'(?{1} {2%}{eval:len({keys}) == 2}{eval:{keys}[0].strip()}{eval:{keys}[1].strip()} {2%}{eval:len({keys}) == 3}{eval:{keys}[0].strip()}{eval:{keys}[1].strip()}{eval:{keys}[2].strip()} {2#}{3%}{1}{2} {3#}{1}{2}{3} [menu-inlinemacro] {1%}{target} {1#}{2%}{target} {1} {2#}{3%}{target} {1} {2} {3#}{target} {1} {2} {3} # override tabletags to support cellbgcolor [tabletags-default] headdata={cellbgcolor?}| bodydata={cellbgcolor?}| [docinfo] ifndef::notitle[] {set2:subtitle_offset:{eval:'{doctitle}'.rfind(': ')}} {eval:{subtitle_offset} != -1}{eval:'{doctitle}'[0:{subtitle_offset}]} {eval:{subtitle_offset} != -1}{eval:'{doctitle}'[{subtitle_offset} + 2:]} {eval:{subtitle_offset} < 0}{doctitle} endif::notitle[] {revdate} # To ensure valid articleinfo/bookinfo when there is no AsciiDoc header. {doctitle%}{revdate%}{docdate} {authored#} {firstname} {middlename} {lastname} {email} {authored#} {authorinitials} {revnumber?{revnumber}}{revdate}{authorinitials?{authorinitials}}{revremark?{revremark}} {docinfo1,docinfo2#}{include:{docdir}/docinfo.xml} {docinfo,docinfo2#}{include:{docdir}/{docname}-docinfo.xml} {orgname} endif::basebackend-docbook[]