#
# asciidoc.conf
#
# Asciidoc global configuration file.
# Contains backend independent configuration settings that are applied to all
# AsciiDoc documents.
#

[miscellaneous]
tabsize=8
textwidth=70
newline=\r\n

[attributes]
lang=en
sectids=
iconsdir=./images/icons
encoding=UTF-8
quirks=
empty=
# Attribute and AttributeList element patterns.
attributeentry-pattern=^:(?P<attrname>\w[^.]*?)(\.(?P<attrname2>.*?))?:(\s+(?P<attrvalue>.*))?$
attributelist-pattern=(?u)(^\[\[(?P<id>[\w\-_]+)(,(?P<reftext>.*?))?\]\]$)|(^\[(?P<attrlist>.*)\]$)
# Substitution attributes for escaping AsciiDoc processing.
amp=&
lt=<
gt=>
brvbar=|
nbsp=&#160;
wj=&#8288;
deg=&#176;
backslash=\
two_colons=::
two_semicolons=;;

[titles]
subs=specialcharacters,quotes,replacements,macros,attributes,replacements2
# Double-line title pattern and underlines.
sectiontitle=^(?P<title>.*?)$
underlines="==","--","~~","^^","++"
# Single-line title patterns.
sect0=^= +(?P<title>[\S].*?)( +=)?$
sect1=^== +(?P<title>[\S].*?)( +==)?$
sect2=^=== +(?P<title>[\S].*?)( +===)?$
sect3=^==== +(?P<title>[\S].*?)( +====)?$
sect4=^===== +(?P<title>[\S].*?)( +=====)?$
blocktitle=^\.(?P<title>([^.\s].*)|(\.[^.\s].*))$

[specialcharacters]
&=&amp;
<=&lt;
>=&gt;

[quotes]
# The order is important, quotes are processed in conf file order.
**=#strong
*=strong
``|''=doublequoted
'=emphasis
`|'=singlequoted
ifdef::no-inline-literal[]
`=monospaced
endif::no-inline-literal[]
# +++ and $$ quoting is applied to the +++ and $$ inline passthrough
# macros to allow quoted attributes to be used.
# This trick only works with inline passthrough macros.
+++=#unquoted
$$=#unquoted
++=#monospaced
+=monospaced
__=#emphasis
_=emphasis
\##=#unquoted
\#=unquoted
^=#superscript
~=#subscript

[specialwords]
emphasizedwords=
strongwords=
monospacedwords=

[replacements]
# Replacements performed in order of configuration file entry.  The first entry
# of each replacement pair performs the (non-escaped) replacement, the second
# strips the backslash from the escaped replacement.

# (C) Copyright (entity reference &copy;)
(?<!\\)\(C\)=&#169;
\\\(C\)=(C)

# (R) registered trade mark (entity reference &reg;
(?<!\\)\(R\)=&#174;
\\\(R\)=(R)

# (TM) Trademark (entity reference &trade;)
(?<!\\)\(TM\)=&#8482;
\\\(TM\)=(TM)

# -- Spaced and unspaced em dashes (entity reference &mdash;).
# Space on both sides is translated to thin space characters.
(^-- )=&#8212;&#8201;
(\n-- )|( -- )|( --\n)=&#8201;&#8212;&#8201;
(\w)--(\w)=\1&#8212;\2
\\--(?!-)=--

# Replace vertical typewriter apostrophe with punctuation apostrophe.
(\w)'(\w)=\1&#8217;\2
(\w)\\'(\w)=\1'\2

# ... Ellipsis (entity reference &hellip;)
(?<!\\)\.\.\.=&#8230;
\\\.\.\.=...

# Arrows from the Arrows block of Unicode.
# -> right arrow
(?<!\\)-&gt;=&#8594;
\\-&gt;=-&gt;
# => right double arrow
(?<!\\)\=&gt;=&#8658;
\\\=&gt;==&gt;
# <- left arrow
(?<!\\)&lt;-=&#8592;
\\&lt;-=&lt;-
# <= left double arrow
(?<!\\)&lt;\==&#8656;
\\&lt;\==&lt;=

# Arbitrary entity references.
(?<!\\)&amp;([:_#a-zA-Z][:_.\-\w]*?;)=&\1
\\(&amp;[:_#a-zA-Z][:_.\-\w]*?;)=\1

#-----------
# Paragraphs
#-----------
[paradef-default]
delimiter=(?s)(?P<text>\S.*)
posattrs=style
style=default
default-style=template="paragraph"
verse-style=template="verseparagraph"
literal-style=template="literalparagraph",subs=["verbatim"]
NOTE-style=template="admonitionparagraph",name="note",caption="{note_caption}"
TIP-style=template="admonitionparagraph",name="tip",caption="{tip_caption}"
IMPORTANT-style=template="admonitionparagraph",name="important",caption="{important_caption}"
WARNING-style=template="admonitionparagraph",name="warning",caption="{warning_caption}"
CAUTION-style=template="admonitionparagraph",name="caution",caption="{caution_caption}"

[paradef-literal]
delimiter=(?s)(?P<text>\s+.*)
options=listelement
template=literalparagraph
subs=verbatim

[paradef-admonition]
delimiter=(?s)^\s*(?P<style>NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+(?P<text>.+)
NOTE-style=template="admonitionparagraph",name="note",caption="{note_caption}"
TIP-style=template="admonitionparagraph",name="tip",caption="{tip_caption}"
IMPORTANT-style=template="admonitionparagraph",name="important",caption="{important_caption}"
WARNING-style=template="admonitionparagraph",name="warning",caption="{warning_caption}"
CAUTION-style=template="admonitionparagraph",name="caution",caption="{caution_caption}"

[macros]
#--------------
# Inline macros
#--------------
# Backslash prefix required for escape processing.
# (?s) re flag for line spanning.

# Macros using default syntax.
(?su)(?<!\w)[\\]?(?P<name>http|https|ftp|file|irc|mailto|callto|image|link|anchor|xref|footnote|footnoteref|indexterm):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=

# These URL types don't require any special attribute list formatting.
(?su)(?<!\S)[\\]?(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])=
# Allow a leading parenthesis.
(?su)(?<\=\()[\\]?(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])=
# Allow <> brackets.
(?su)[\\]?&lt;(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])&gt;=

# Email addresses don't require special attribute list formatting.
# The before ">: and after "< character exclusions stop multiple substitution.
(?su)(?<![">:\w._/-])[\\]?(?P<target>\w[\w._-]*@[\w._-]*\w)(?!["<\w_-])=mailto

# Anchor: [[[id]]]. Bibliographic anchor.
(?su)[\\]?\[\[\[(?P<attrlist>[\w][\w-]*?)\]\]\]=anchor3
# Anchor: [[id,xreflabel]]
(?su)[\\]?\[\[(?P<attrlist>[\w"].*?)\]\]=anchor2
# Link: <<id,text>>
(?su)[\\]?&lt;&lt;(?P<attrlist>[\w"].*?)&gt;&gt;=xref2

ifdef::asciidoc7compatible[]
# Index term: ++primary,secondary,tertiary++
(?su)(?<!\S)[\\]?\+\+(?P<attrlist>[^+].*?)\+\+(?!\+)=indexterm
# Index term: +primary+
# Follows ++...++ macro otherwise it will match them.
(?<!\S)[\\]?\+(?P<attrlist>[^\s\+][^+].*?)\+(?!\+)=indexterm2
endif::asciidoc7compatible[]

ifndef::asciidoc7compatible[]
# Index term: (((primary,secondary,tertiary)))
(?su)(?<!\()[\\]?\(\(\((?P<attrlist>[^(].*?)\)\)\)(?!\))=indexterm
# Index term: ((primary))
# Follows (((...))) macro otherwise it will match them.
(?<!\()[\\]?\(\((?P<attrlist>[^\s\(][^(].*?)\)\)(?!\))=indexterm2
endif::asciidoc7compatible[]

# Callout
[\\]?&lt;(?P<index>\d+)&gt;=callout

# Passthrough macros.
(?su)[\\]?(?P<name>pass):(?P<subslist>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=[]

# Triple-plus and double-dollar inline passthroughs.
(?su)[\\]?\+\+\+(?P<passtext>.*?)\+\+\+=pass[]
(?su)[\\]?\$\$(?P<passtext>.*?)\$\$=pass[specialcharacters]

# Inline literal.
ifndef::no-inline-literal[]
(?su)(?<!\w)([\\]?`(?P<passtext>\S|\S.*?\S)`)(?!\w)=literal[specialcharacters]
endif::no-inline-literal[]

# Inline comment.
(?mu)^[\\]?//(?P<passtext>[^/].*|)$=comment[normal]

# Default (catchall) inline macro is not implemented so there is no ambiguity
# with previous definition that could result in double substitution of escaped
# references.
#(?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=

#-------------
# Block macros
#-------------
# Macros using default syntax.
(?u)^(?P<name>image)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$=#

# Passthrough macros.
(?u)^(?P<name>pass)::(?P<subslist>\S*?)(\[(?P<passtext>.*?)\])$=#

^'{3,}$=#ruler
^<{3,}$=#pagebreak
^//(?P<passtext>[^/].*|)$=#comment[normal]

#-----------------
# Delimited blocks
#-----------------
[blockdef-comment]
delimiter=^/{4,}$
options=skip

[blockdef-sidebar]
delimiter=^\*{4,}$
template=sidebarblock
options=sectionbody
posattrs=style
abstract-style=template="abstractblock"

[blockdef-open]
# A block without opening or closing tags.
delimiter=^--$
template=openblock
options=sectionbody

[openblock]
|

[blockdef-pass]
delimiter=^\+{4,}$
template=passblock
# Default subs choosen for backward compatibility.
subs=attributes,macros
posattrs=style
pass-style=template="passblock",subs=[]

[blockdef-listing]
delimiter=^-{4,}$
template=listingblock
subs=verbatim
posattrs=style

[blockdef-literal]
delimiter=^\.{4,}$
template=literalblock
subs=verbatim
posattrs=style
listing-style=template="listingblock"
# DEPRECATED: Use verse style on quote blocks instead.
verse-style=template="verseblock",subs="normal"

[blockdef-quote]
delimiter=^_{4,}$
subs=normal
style=quote
posattrs=style,attribution,citetitle
quote-style=template="quoteblock",options=("sectionbody",)
verse-style=template="verseblock"

[blockdef-example]
delimiter=^={4,}$
template=exampleblock
options=sectionbody
posattrs=style
NOTE-style=template="admonitionblock",name="note",caption="{note_caption}"
TIP-style=template="admonitionblock",name="tip",caption="{tip_caption}"
IMPORTANT-style=template="admonitionblock",name="important",caption="{important_caption}"
WARNING-style=template="admonitionblock",name="warning",caption="{warning_caption}"
CAUTION-style=template="admonitionblock",name="caution",caption="{caution_caption}"

# For use by custom filters.
# NOTE: No longer used, a styled listing block (blockdef-listing) is preferable.
[blockdef-filter]
delimiter=^~{4,}$
template=listingblock
subs=none
posattrs=style

#-------
# Lists
#-------
[listdef-bulleted]
# - bullets.
delimiter=^\s*- +(?P<text>.+)$
posattrs=style
type=bulleted
tags=bulleted
callout-style=tags="callout"
bibliography-style=tags="bibliography"

[listdef-bulleted1]
# * bullets.
template::[listdef-bulleted]
delimiter=^\s*\* +(?P<text>.+)$

[listdef-bulleted2]
# ** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{2} +(?P<text>.+)$

[listdef-bulleted3]
# *** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{3} +(?P<text>.+)$

[listdef-bulleted4]
# **** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{4} +(?P<text>.+)$

[listdef-bulleted5]
# ***** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{5} +(?P<text>.+)$

[listdef-arabic]
# Arabic numbering.
delimiter=^\s*(?P<index>\d+\.) +(?P<text>.+)$
posattrs=style
type=numbered
tags=numbered
style=arabic

[listdef-loweralpha]
# Lower alpha numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[a-z]\.) +(?P<text>.+)$
style=loweralpha

[listdef-upperalpha]
# Upper alpha numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[A-Z]\.) +(?P<text>.+)$
style=upperalpha

[listdef-lowerroman]
# Lower roman numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[ivx]+\)) +(?P<text>.+)$
style=lowerroman

[listdef-upperroman]
# Upper roman numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[IVX]+\)) +(?P<text>.+)$
style=upperroman

[listdef-numbered1]
# . numbering.
template::[listdef-arabic]
delimiter=^\s*\. +(?P<text>.+)$

[listdef-numbered2]
# .. numbering.
template::[listdef-loweralpha]
delimiter=^\s*\.{2} +(?P<text>.+)$

[listdef-numbered3]
# ... numbering.
template::[listdef-lowerroman]
delimiter=^\s*\.{3} +(?P<text>.+)$

[listdef-numbered4]
# .... numbering.
template::[listdef-upperalpha]
delimiter=^\s*\.{4} +(?P<text>.+)$

[listdef-numbered5]
# ..... numbering.
template::[listdef-upperroman]
delimiter=^\s*\.{5} +(?P<text>.+)$

[listdef-labeled]
# label:: item.
delimiter=^\s*(?P<label>.*[^:])::(\s+(?P<text>.+))?$
posattrs=style
type=labeled
tags=labeled
vertical-style=tags="labeled"
horizontal-style=tags="horizontal"
glossary-style=tags="glossary"
qanda-style=tags="qanda"

[listdef-labeled2]
# label;; item.
template::[listdef-labeled]
delimiter=^\s*(?P<label>.*[^;]);;(\s+(?P<text>.+))?$

[listdef-labeled3]
# label::: item.
template::[listdef-labeled]
delimiter=^\s*(?P<label>.*[^:]):{3}(\s+(?P<text>.+))?$

[listdef-labeled4]
# label:::: item.
template::[listdef-labeled]
delimiter=^\s*(?P<label>.*[^:]):{4}(\s+(?P<text>.+))?$

[listdef-callout]
posattrs=style
delimiter=^<?(?P<index>\d*>) +(?P<text>.+)$
type=callout
tags=callout
style=arabic

# DEPRECATED: Old list syntax.
[listdef-qanda]
posattrs=style
delimiter=^\s*(?P<label>.*\S)\?\?$
type=labeled
tags=qanda

# DEPRECATED: Old list syntax.
[listdef-bibliography]
posattrs=style
delimiter=^\+ +(?P<text>.+)$
type=bulleted
tags=bibliography

# DEPRECATED: Old list syntax.
[listdef-glossary]
delimiter=^(?P<label>.*\S):-$
posattrs=style
type=labeled
tags=glossary

#-------
# Tables
#-------
[tabledef-default]
delimiter=^\|={3,}$
posattrs=style
template=table
default-style=tags="default"
verse-style=tags="verse"
literal-style=tags="literal",subs=["specialcharacters"]
emphasis-style=tags="emphasis"
strong-style=tags="strong"
monospaced-style=tags="monospaced"
asciidoc-style=tags="asciidoc",subs=[],filter='python "{asciidoc-file}" -b {backend} -s -'

[tabledef-nested]
# Same as [tabledef-default] but with different delimiter and separator.
delimiter=^!={3,}$
separator=((?<!\S)((?P<span>[\d.]+)(?P<op>[*+]))?(?P<align>[<\^>.]{,3})?(?P<style>[a-z])?)?!
posattrs=style
template=table
verse-style=tags="verse"
literal-style=tags="literal",subs=["specialcharacters"]
emphasis-style=tags="emphasis"
strong-style=tags="strong"
monospaced-style=tags="monospaced"
asciidoc-style=tags="asciidoc",subs=[],filter='python "{asciidoc-file}" -b {backend} -s -'

#----------------------------------------
# Common block and macro markup templates
#----------------------------------------
[comment-inlinemacro]
# Outputs nothing.

[comment-blockmacro]
# Outputs nothing.

[pass-blockmacro]
{passtext}

[pass-inlinemacro]
template::[pass-blockmacro]

[passblock]
|

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

[old_tabledef-default]
fillchar=-
format=fixed

[old_tabledef-csv]
fillchar=~
format=csv

[old_tabledef-dsv]
fillchar=_
format=dsv

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