[gtksourceview: 2/3] asciidoc.lang: Improve styling/highlighting



commit 93fa32535b834ebc3865ff835075d76fdf3f7d15
Author: Jeffery To <jeffery to gmail com>
Date:   Thu Nov 28 00:57:35 2019 +0800

    asciidoc.lang: Improve styling/highlighting
    
    * Unify styles for inline and block passthrough text
    * Unify styles for attribute list and attribute entries
    * Improve highlighting for links, cross links, and macros
    * Add highlighting for anchor, link and xref macros
    * Add highlighting for ruler lines and page breaks
    * Highlight admonition style in attribute list
    * Handle escaped characters
    * Remove unused regexes
    * Remove trailing whitespace

 data/language-specs/asciidoc.lang       | 150 +++++++--
 tests/syntax-highlighting/file.asciidoc | 529 ++++++++++++++++++++++++++++++++
 2 files changed, 649 insertions(+), 30 deletions(-)
---
diff --git a/data/language-specs/asciidoc.lang b/data/language-specs/asciidoc.lang
index 2c1f986b..b39eccd3 100644
--- a/data/language-specs/asciidoc.lang
+++ b/data/language-specs/asciidoc.lang
@@ -23,46 +23,53 @@
   <metadata>
     <property name="mimetypes">text/asciidoc</property>
     <property name="globs">*.asciidoc;*.adoc</property>
-    <property name="line-comment-start">// </property>
+    <property name="line-comment-start">//</property>
   </metadata>
 
   <styles>
+    <style id="passthrough"       name="Passthrough Text"    map-to="def:special-char"/>
+    <style id="attribute"         name="Attribute"           map-to="def:preprocessor"/>
     <style id="markup-monospace"  name="Monospaced Text"     map-to="def:inline-code"/>
     <style id="markup-emphasis"   name="Emphasized Text"     map-to="def:emphasis"/>
     <style id="markup-strong"     name="Strong Text"         map-to="def:strong-emphasis"/>
-    <style id="markup-pass"       name="Passthrough Text"    map-to="def:special-char"/>
+    <style id="markup-pass"       name="Inline Passthrough"  map-to="asciidoc:passthrough"/>
     <style id="markup-replace"    name="Replacement"         map-to="def:special-char"/>
     <style id="markup-linebreak"  name="Line Break"          map-to="def:special-char"/>
     <style id="markup-admonition" name="Admonition"          map-to="def:note"/>
-    <style id="markup-anchor"     name="Anchor"              map-to="def:identifier"/>
-    <style id="markup-crosslink"  name="Link"                map-to="def:identifier"/>
+    <style id="markup-anchor"     name="Anchor"              map-to="asciidoc:attribute"/>
+    <style id="markup-crosslink"  name="Link"                map-to="def:link-text"/>
     <style id="markup-url"        name="URL"                 map-to="def:link-destination"/>
-    <style id="markup-att-entry"  name="Attribute Entry Invocation"     map-to="def:preprocessor"/>
+    <style id="markup-link-text"  name="Link Text"           map-to="def:link-text"/>
+    <style id="markup-att-entry"  name="Attribute Entry Invocation"     map-to="asciidoc:attribute"/>
     <style id="struct-title"      name="Title"               map-to="def:heading"/>
-    <style id="struct-blocktitle" name="Block Title"         map-to="def:identifier"/>
-    <style id="struct-style"      name="Style"               map-to="def:identifier"/>
+    <style id="struct-blocktitle" name="Block Title"         map-to="def:heading"/>
+    <style id="struct-style"      name="Style"               map-to="asciidoc:attribute"/>
+    <style id="struct-ruler-line" name="Ruler Line"          map-to="def:thematic-break"/>
+    <style id="struct-page-break" name="Page Break"          map-to="def:operator"/>
     <style id="par-literal"       name="Literal"             map-to="def:preformatted-section"/>
     <style id="block-listing"     name="Listing"             map-to="def:preformatted-section"/>
+    <style id="block-pass"        name="Block Passthrough"   map-to="asciidoc:passthrough"/>
     <style id="block-comment"     name="Comment"             map-to="def:comment"/>
     <style id="block-boundary"    name="Block Boundary"      map-to="def:identifier"/>
     <style id="macro"             name="Macro"               map-to="def:keyword"/>
+    <style id="macro-arg"         name="Macro Argument"      map-to="def:string"/>
+    <style id="macro-att-list"    name="Macro Attribute List" map-to="asciidoc:attribute"/>
     <style id="preprocessor"      name="Preprocessor"        map-to="def:preprocessor"/>
+    <style id="preprocessor-arg"  name="Preprocessor Argument" map-to="def:string"/>
+    <style id="preprocessor-att-list" name="Preprocessor Attribute List" map-to="asciidoc:attribute"/>
     <style id="list-identifier"   name="List Identifier"     map-to="def:list-marker"/>
   </styles>
 
   <definitions>
 
-    <define-regex id="asciidocBackslash">\\</define-regex>
-    <define-regex id="asciidocLineBreak">[ \t]+\s*$</define-regex>
-    <define-regex id="asciidocRuler">^''''\+\s*$</define-regex>
-
     <context id="text_linebreak" style-ref="markup-linebreak" extend-parent="false">
       <match>\+\s*$</match>
     </context>
 
-    <define-regex id="macro-names">\b(image|include|sys|sys2|eval)\b</define-regex>
-    <define-regex 
id="inline-macro-names">\b(pass|latexmath|asciimath|indexterm|indexterm2|footnote|footnoteref)\b</define-regex>
-    <define-regex id="preproc-names">\b(ifdef|ifndef|ifeval|endif|unfloat|template)\b</define-regex>
+    <define-regex id="admonition-names">(?:NOTE|TIP|CAUTION|IMPORTANT|WARNING)</define-regex>
+    <define-regex id="macro-names">(?:image|include|sys|sys2|eval)</define-regex>
+    <define-regex 
id="inline-macro-names">(?:pass|latexmath|asciimath|indexterm|indexterm2|footnote|footnoteref)</define-regex>
+    <define-regex id="preproc-names">(?:ifdef|ifndef|ifeval|endif|unfloat|template)</define-regex>
 
     <!-- TITLES -->
     <context id="title">
@@ -89,6 +96,7 @@
           <end>(?=\|)</end>
           <include>
             <context sub-pattern="0" where="start" style-ref="block-boundary" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="markup" />
           </include>
         </context>
@@ -105,7 +113,7 @@
         <context id="theComment" style-ref="block-comment" extend-parent="false">
           <match>^\/\/.*$</match>
         </context>
-        <context id="passthroughBlock" style-ref="block-listing" extend-parent="false">
+        <context id="passthroughBlock" style-ref="block-pass" extend-parent="false">
           <start>^(\+\+\+\++)\s*$</start>
           <end>^(\%{1@start})\s*$</end>
         </context>
@@ -123,6 +131,7 @@
           <include>
             <context sub-pattern="1" where="start" style-ref="block-boundary" />
             <context sub-pattern="1" where="end" style-ref="block-boundary" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="blockMacro" />
             <context ref="theLists" />
             <context ref="parIndented" />
@@ -135,6 +144,7 @@
           <include>
             <context sub-pattern="1" where="start" style-ref="block-boundary" />
             <context sub-pattern="1" where="end" style-ref="block-boundary" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="blockMacro" />
             <context ref="theLists" />
             <context ref="parIndented" />
@@ -147,6 +157,7 @@
           <include>
             <context sub-pattern="1" where="start" style-ref="block-boundary" />
             <context sub-pattern="1" where="end" style-ref="block-boundary" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="blockMacro" />
             <context ref="theLists" />
             <context ref="parIndented" />
@@ -176,22 +187,48 @@
           <end>&gt;&gt;</end>
         </context>
 
+        <context id="crosslinkMacro" style-ref="markup-crosslink" extend-parent="false" style-inside="true">
+          <start>\b(xref:)([^\s\[\]]*)(\[)</start>
+          <end>\]</end>
+          <include>
+            <context sub-pattern="1" where="start" style-ref="macro" />
+            <context sub-pattern="2" where="start" style-ref="markup-crosslink" />
+            <context sub-pattern="3" where="start" style-ref="markup-crosslink" />
+            <context sub-pattern="0" where="end" style-ref="markup-crosslink" />
+          </include>
+        </context>
+
+        <context id="linkMacro" style-ref="markup-link-text" extend-parent="false" style-inside="true">
+          <start>\b(link:)([^\s\[\]]*)(\[)</start>
+          <end>\]</end>
+          <include>
+            <context sub-pattern="1" where="start" style-ref="macro" />
+            <context sub-pattern="2" where="start" style-ref="macro-arg" />
+            <context sub-pattern="3" where="start" style-ref="markup-link-text" />
+            <context sub-pattern="0" where="end" style-ref="markup-link-text" />
+          </include>
+        </context>
+
         <!-- url with [] -->
-        <context id="url1" style-ref="markup-url" extend-parent="false"> 
-          <start>(http(s?):\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+\[</start>
+        <context id="url1" style-ref="markup-link-text" style-inside="true" extend-parent="false">
+          <start>((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[)</start>
           <end>\]</end>
+          <include>
+            <context sub-pattern="1" where="start" style-ref="markup-url" />
+            <context sub-pattern="2" where="start" style-ref="markup-link-text" />
+            <context sub-pattern="0" where="end" style-ref="markup-link-text" />
+          </include>
         </context>
 
-        <!-- url without [] -->            
+        <!-- url without [] -->
         <context id="url2" style-ref="markup-url" extend-parent="false">
-          <match>(http(s?):\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+</match>
+          <match>(https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+</match>
         </context>
 
         <context id="email" style-ref="markup-url" extend-parent="false">
           <match>\b[\w\.\/-]+@[\w\.\/-]+\b</match>
         </context>
 
-
         <!-- PASSTHROUGH -->
         <context id="Pass" style-ref="markup-pass" extend-parent="false">
           <match>\$\$.+?\$\$</match>
@@ -203,10 +240,10 @@
           <match>\(C\)|\(TM\)|\(R\)|(?&lt;!-)--(?!-)|\.{3}|-&gt;|&lt;-|=&gt;|&lt;=</match>
         </context>
         <context id="Admonition" style-ref="markup-admonition" extend-parent="false">
-          <match>^(NOTE|TIP|CAUTION|IMPORTANT|WARNING|TESTME):(?=\s)</match>
+          <match>^\%{admonition-names}:(?=\s)</match>
         </context>
 
-        <!-- MONOSPACED --> 
+        <!-- MONOSPACED -->
         <context id="MonospacePlus" style-ref="markup-monospace" extend-parent="false">
           <start>(?&lt;=^|[ \t\(\[.,\-])\+(?![\)])</start>
           <end>(\+(?=[ \t\(\)\],.?!;:\-]|$)|$(?=^$))</end>
@@ -245,9 +282,15 @@
         </context>
 
         <!-- INLINE MACROS -->
-        <context id="inlineMacro" style-ref="macro" extend-parent="false">
-          <start>(\%{macro-names}|\%{inline-macro-names}):[^\s\[\]]*\[</start>
+        <context id="inlineMacro" style-ref="macro-att-list" style-inside="true" extend-parent="false">
+          <start>\b((?:\%{macro-names}|\%{inline-macro-names}):)([^\s\[\]]*)(\[)</start>
           <end>\]</end>
+          <include>
+            <context sub-pattern="1" where="start" style-ref="macro" />
+            <context sub-pattern="2" where="start" style-ref="macro-arg" />
+            <context sub-pattern="3" where="start" style-ref="macro-att-list" />
+            <context sub-pattern="0" where="end" style-ref="macro-att-list" />
+          </include>
         </context>
 
         <!-- CALLOUTS -->
@@ -260,6 +303,17 @@
           <match>\[\[[^\]]+\]\]</match>
         </context>
 
+        <context id="anchorMacro" style-ref="markup-anchor" extend-parent="false" style-inside="true">
+          <start>\b(anchor:)([^\s\[\]]*)(\[)</start>
+          <end>\]</end>
+          <include>
+            <context sub-pattern="1" where="start" style-ref="macro" />
+            <context sub-pattern="2" where="start" style-ref="markup-anchor" />
+            <context sub-pattern="3" where="start" style-ref="markup-anchor" />
+            <context sub-pattern="0" where="end" style-ref="markup-anchor" />
+          </include>
+        </context>
+
         <!-- FIXME: Not exactly sure what the proper character set for an attribute entry is. -->
         <context id="markup-att-entry" style-ref="markup-att-entry" extend-parent="false">
           <match>\{[^\s{}:]+\}</match>
@@ -269,14 +323,26 @@
     </context>
 
     <!-- BLOCK MACROS / PREPROCESSOR -->
-    <context id="blockMacro" end-at-line-end="true" style-ref="macro">
-      <start>^(\%{macro-names})::[^\s\[\]]*\[</start>
+    <context id="blockMacro" end-at-line-end="true" style-ref="macro-att-list" style-inside="true">
+      <start>^(\%{macro-names}::)([^\s\[\]]*)(\[)</start>
       <end>\]$</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="macro" />
+        <context sub-pattern="2" where="start" style-ref="macro-arg" />
+        <context sub-pattern="3" where="start" style-ref="macro-att-list" />
+        <context sub-pattern="0" where="end" style-ref="macro-att-list" />
+      </include>
     </context>
 
-    <context id="blockPreproc" end-at-line-end="true" style-ref="preprocessor">
-      <start>^(\%{preproc-names})::[^\s\[\]]*\[</start>
+    <context id="blockPreproc" end-at-line-end="true" style-ref="preprocessor-att-list" style-inside="true">
+      <start>^(\%{preproc-names}::)([^\s\[\]]*)(\[)</start>
       <end>\]$</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="preprocessor" />
+        <context sub-pattern="2" where="start" style-ref="preprocessor-arg" />
+        <context sub-pattern="3" where="start" style-ref="preprocessor-att-list" />
+        <context sub-pattern="0" where="end" style-ref="preprocessor-att-list" />
+      </include>
     </context>
 
     <context id="setAttr" end-at-line-end="true" style-ref="preprocessor">
@@ -291,7 +357,13 @@
     </context>
 
     <context id="theStyle" style-ref="struct-style">
-      <match>^\[[^\[\]]+\]$</match>
+      <start>^\[(?=[^\[\]]+\]$)</start>
+      <end>\]</end>
+      <include>
+        <context style-ref="markup-admonition">
+          <match>\b\%{admonition-names}\b</match>
+        </context>
+      </include>
     </context>
 
     <!-- Anchor -->
@@ -299,6 +371,15 @@
       <match>^\[\[[^\]]+\]\]$</match>
     </context>
 
+    <!-- RULER LINES -->
+    <context id="rulerLine" style-ref="struct-ruler-line" extend-parent="false">
+      <match>^'''+\s*$</match>
+    </context>
+
+    <!-- PAGE BREAKS -->
+    <context id="pageBreak" style-ref="struct-page-break" extend-parent="false">
+      <match>^&lt;&lt;&lt;+\s*$</match>
+    </context>
 
     <!-- PARAGRAPHS -->
     <context id="parIndented" extend-parent="false" style-ref="par-literal">
@@ -310,6 +391,7 @@
       <start>^(?=\S)</start>
       <end>^\s*$</end>
       <include>
+        <context ref="def:escape" ignore-style="true" />
 
         <!-- Underlines inside paragraphs FIXME! -->
         <context id="titleline0" style-ref="struct-title" end-parent="true">
@@ -334,7 +416,7 @@
         <context ref="setAttr" />
 
       </include>
-    </context>    
+    </context>
 
     <!-- LISTS -->
     <context id="theLists">
@@ -344,6 +426,7 @@
           <end>^\s*$</end>
           <include>
             <context sub-pattern="1" where="start" style-ref="list-identifier" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="text_linebreak" />
             <context ref="theLists" />
             <context ref="markup" />
@@ -356,6 +439,7 @@
           <end>^\s*$</end>
           <include>
             <context sub-pattern="1" where="start" style-ref="list-identifier" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="text_linebreak" />
             <context ref="theLists" />
             <context ref="markup" />
@@ -368,6 +452,7 @@
           <end>^\s*$</end>
           <include>
             <context sub-pattern="1" where="start" style-ref="list-identifier" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="text_linebreak" />
             <context ref="theLists" />
             <context ref="markup" />
@@ -380,6 +465,7 @@
           <end>^\s*$</end>
           <include>
             <context sub-pattern="0" where="start" style-ref="list-identifier" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="theLists" />
             <context ref="markup" />
             <context ref="blockPreproc" />
@@ -395,6 +481,7 @@
           <include>
             <context sub-pattern="0" where="start" style-ref="list-identifier" />
             <context sub-pattern="0" where="end" style-ref="list-identifier" />
+            <context ref="def:escape" ignore-style="true" />
             <context ref="bulletedList" />
             <context ref="numberedListExplicit" />
             <context ref="numberedListImplicit" />
@@ -411,6 +498,7 @@
     -->
     <context id="asciidoc">
       <include>
+        <context ref="def:escape" ignore-style="true" />
         <context ref="blockMacro" />
         <context ref="blockPreproc" />
         <context ref="setAttr" />
@@ -422,6 +510,8 @@
         <context ref="title" />
         <context ref="parIndented" />
         <context ref="theTable" />
+        <context ref="rulerLine" />
+        <context ref="pageBreak" />
         <context ref="paragraph" />
       </include>
     </context>
diff --git a/tests/syntax-highlighting/file.asciidoc b/tests/syntax-highlighting/file.asciidoc
index 4760e756..6ef46e49 100644
--- a/tests/syntax-highlighting/file.asciidoc
+++ b/tests/syntax-highlighting/file.asciidoc
@@ -45,3 +45,532 @@ block
 
 This paragraph includes {an-attribute}.
 
+
+
+// from https://powerman.name/doc/asciidoc
+
+// Document header
+
+Main Header
+===========
+Optional Author Name <optional@author.email>
+Optional version, optional date
+:Author:    AlternativeWayToSetOptional Author Name
+:Email:     <AlternativeWayToSetOptional@author.email>
+:Date:      AlternativeWayToSetOptional date
+:Revision:  AlternativeWayToSetOptional version
+
+
+// Attributes
+
+Author is {author}
+
+Version is {revision}
+
+:My name: Alex Efros
+My name is {myname}
+
+Line
+with bad attribute {qwe} will be
+deleted
+
+Escaped: \{qwe} and +++{qwe}+++
+
+
+// Headers
+
+Level 1
+-------
+Text.
+
+Level 2
+~~~~~~~
+Text.
+
+Level 3
+^^^^^^^
+Text.
+
+Level 4
++++++++
+Text.
+
+== Level 1
+Text.
+
+=== Level 2
+Text.
+
+==== Level 3
+Text.
+
+===== Level 4
+Text.
+
+
+// Paragraphs
+
+.Optional Title
+
+Usual
+paragraph.
+
+.Optional Title
+
+ Literal paragraph.
+  Must be indented.
+
+.Optional Title
+
+[source,perl]
+die 'connect: '.$dbh->errstr;
+
+Not a code in next paragraph.
+
+.Optional Title
+NOTE: This is an example
+      single-paragraph note.
+
+.Optional Title
+[NOTE]
+This is an example
+single-paragraph note.
+
+TIP: Tip.
+
+IMPORTANT: Important.
+
+WARNING: Warning.
+
+CAUTION: Caution.
+
+
+// Blocks
+
+.Optional Title
+----
+*Listing* Block
+
+Use: code or file listings
+----
+
+.Optional Title
+[source,perl]
+----
+# *Source* block
+# Use: highlight code listings
+# (require `source-highlight` or `pygmentize`)
+use DBI;
+my $dbh = DBI->connect('...',$u,$p)
+    or die "connect: $dbh->errstr";
+----
+
+.Optional Title
+****
+*Sidebar* Block
+
+Use: sidebar notes :)
+****
+
+.Optional Title
+==========================
+*Example* Block
+
+Use: examples :)
+
+Default caption "Example:"
+can be changed using
+
+ [caption="Custom: "]
+
+before example block.
+==========================
+
+.Optional Title
+[NOTE]
+===============================
+*NOTE* Block
+
+Use: multi-paragraph notes.
+===============================
+
+////
+*Comment* block
+
+Use: hide comments
+////
+
+++++
+*Passthrough* Block
+<p>
+Use: backend-specific markup like
+<table border="1">
+<tr><td>1<td>2
+</table>
+++++
+
+ .Optional Title
+ ....
+ *Literal* Block
+
+ Use: workaround when literal
+ paragraph (indented) like
+   1. First.
+   2. Second.
+ incorrectly processed as list.
+ ....
+
+.Optional Title
+[quote, cite author, cite source]
+____
+*Quote* Block
+
+Use: cite somebody
+____
+
+
+// Text
+
+forced +
+line break
+
+normal, _italic_, *bold*, +mono+.
+
+``double quoted'', `single quoted'.
+
+normal, ^super^, ~sub~.
+
+Command: `ls -al`
+
++mono *bold*+
+
+`passthru *bold*`
+
+Path: '/some/filez.txt', '.b'
+
+[red]#red text# [yellow-background]#on yellow#
+[big]#large# [red yellow-background big]*all bold*
+
+Chars: n__i__**b**++m++[red]##r##
+
+// Comment
+
+(C) (R) (TM) -- ... -> <- => <= &#182;
+
+''''
+
+Escaped:
+\_italic_, +++_italic_+++,
+t\__e\__st, +++t__e__st+++,
++++<b>bold</b>+++, $$<b>normal</b>$$
+\&#182;
+\`not single quoted'
+\`\`not double quoted''
+
+
+// Macros: links, images & include
+
+[[anchor-1]]
+Paragraph or block 1.
+
+anchor:anchor-2[]
+Paragraph or block 2.
+
+<<anchor-1>>,
+<<anchor-1,First anchor>>,
+xref:anchor-2[],
+xref:anchor-2[Second anchor].
+
+link:asciidoc[This document]
+link:asciidoc.html[]
+link:/index.html[This site root]
+
+http://google.com
+http://google.com[Google Search]
+mailto:root@localhost[email admin]
+
+First home
+image:images/icons/home.png[]
+, second home
+image:images/icons/home.png[Alt text]
+.
+
+.Block image
+image::images/icons/home.png[]
+image::images/icons/home.png[Alt text]
+
+.Thumbnail linked to full image
+image:/images/font/640-screen2.gif[
+"My screenshot",width=128,
+link="/images/font/640-screen2.gif"]
+
+This is example how files
+can be included.
+It's commented because
+there no such files. :)
+
+// include::footer.txt[]
+
+// [source,perl]
+// ----
+// include::script.pl[]
+// ----
+
+
+// Lists
+
+.Bulleted
+* bullet
+* bullet
+  - bullet
+  - bullet
+* bullet
+** bullet
+** bullet
+*** bullet
+*** bullet
+**** bullet
+**** bullet
+***** bullet
+***** bullet
+**** bullet
+*** bullet
+** bullet
+* bullet
+
+.Bulleted 2
+- bullet
+  * bullet
+
+.Ordered
+. number
+. number
+  .. letter
+  .. letter
+. number
+.. loweralpha
+.. loweralpha
+... lowerroman
+... lowerroman
+.... upperalpha
+.... upperalpha
+..... upperroman
+..... upperroman
+.... upperalpha
+... lowerroman
+.. loweralpha
+. number
+
+.Ordered 2
+a. letter
+b. letter
+   .. letter2
+   .. letter2
+       .  number
+       .  number
+           1. number2
+           2. number2
+           3. number2
+           4. number2
+       .  number
+   .. letter2
+c. letter
+
+.Labeled
+Term 1::
+    Definition 1
+Term 2::
+    Definition 2
+    Term 2.1;;
+        Definition 2.1
+    Term 2.2;;
+        Definition 2.2
+Term 3::
+    Definition 3
+Term 4:: Definition 4
+Term 4.1::: Definition 4.1
+Term 4.2::: Definition 4.2
+Term 4.2.1:::: Definition 4.2.1
+Term 4.2.2:::: Definition 4.2.2
+Term 4.3::: Definition 4.3
+Term 5:: Definition 5
+
+.Labeled 2
+Term 1;;
+    Definition 1
+    Term 1.1::
+        Definition 1.1
+
+[horizontal]
+.Labeled horizontal
+Term 1:: Definition 1
+Term 2:: Definition 2
+[horizontal]
+    Term 2.1;;
+        Definition 2.1
+    Term 2.2;;
+        Definition 2.2
+Term 3::
+    Definition 3
+Term 4:: Definition 4
+[horizontal]
+Term 4.1::: Definition 4.1
+Term 4.2::: Definition 4.2
+[horizontal]
+Term 4.2.1:::: Definition 4.2.1
+Term 4.2.2:::: Definition 4.2.2
+Term 4.3::: Definition 4.3
+Term 5:: Definition 5
+
+[qanda]
+.Q&A
+Question 1::
+    Answer 1
+Question 2:: Answer 2
+
+.Indent is optional
+- bullet
+    * another bullet
+        1. number
+        .  again number
+            a. letter
+            .. again letter
+
+.. letter
+. number
+
+* bullet
+- bullet
+
+.Break two lists
+. number
+. number
+
+Independent paragraph break list.
+
+. number
+
+.Header break list too
+. number
+
+--
+. List block define list boundary too
+. number
+. number
+--
+
+--
+. number
+. number
+--
+
+.Continuation
+- bullet
+continuation
+. number
+  continuation
+* bullet
+
+  literal continuation
+
+.. letter
++
+Non-literal continuation.
++
+----
+any block can be
+
+included in list
+----
++
+Last continuation.
+
+.List block allow sublist inclusion
+- bullet
+  * bullet
++
+--
+    - bullet
+      * bullet
+--
+  * bullet
+- bullet
+  . number
+    .. letter
++
+--
+      . number
+        .. letter
+--
+    .. letter
+  . number
+
+
+// Tables
+
+.An example table
+[options="header,footer"]
+|=======================
+|Col 1|Col 2      |Col 3
+|1    |Item 1     |a
+|2    |Item 2     |b
+|3    |Item 3     |c
+|6    |Three items|d
+|=======================
+
+.CSV data, 15% each column
+[format="csv",width="60%",cols="4"]
+[frame="topbot",grid="none"]
+|======
+1,2,3,4
+a,b,c,d
+A,B,C,D
+|======
+
+[grid="rows",format="csv"]
+[options="header",cols="^,<,<s,<,>m"]
+|===========================
+ID,FName,LName,Address,Phone
+1,Vasya,Pupkin,London,+123
+2,X,Y,"A,B",45678
+|===========================
+
+.Multiline cells, row/col span
+|====
+|Date |Duration |Avg HR |Notes
+
+|22-Aug-08 .2+^.^|10:24 | 157 |
+Worked out MSHR (max sustainable
+heart rate) by going hard
+for this interval.
+
+|22-Aug-08 | 152 |
+Back-to-back with previous interval.
+
+|24-Aug-08 3+^|none
+
+|====
+
+
+// System macros
+
+include::chapter1.txt[tabsize=4]
+
+ifdef::revnumber[Version number 42]
+
+ifdef::revnumber[]
+Version number 42
+endif::revnumber[]
+
+ifeval::[{rs458}==2]
+:
+endif::[]
+
+sys::[ls -l *.txt]
+
+template::[admonitionblock]
+
+
+// Page break
+
+<<<


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]