mizuho 0.9.6 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -2
- data/Rakefile +0 -37
- data/asciidoc/BUGS +9 -18
- data/asciidoc/BUGS.txt +5 -14
- data/asciidoc/CHANGELOG +1433 -266
- data/asciidoc/CHANGELOG.txt +2821 -1810
- data/asciidoc/COPYING +339 -339
- data/asciidoc/COPYRIGHT +18 -18
- data/asciidoc/INSTALL +189 -30
- data/asciidoc/INSTALL.txt +175 -19
- data/asciidoc/MANIFEST +88 -0
- data/asciidoc/Makefile.in +29 -13
- data/asciidoc/README +16 -17
- data/asciidoc/README.txt +35 -36
- data/asciidoc/a2x.py +902 -0
- data/asciidoc/asciidoc.conf +610 -455
- data/asciidoc/asciidoc.py +1965 -1061
- data/asciidoc/asciidocapi.py +257 -0
- data/asciidoc/common.aap +2 -2
- data/asciidoc/configure +1170 -1023
- data/asciidoc/configure.ac +1 -1
- data/asciidoc/dblatex/asciidoc-dblatex.xsl +42 -0
- data/asciidoc/doc/a2x.1 +559 -102
- data/asciidoc/doc/a2x.1.txt +233 -91
- data/asciidoc/doc/article-docinfo.xml +87 -0
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/article.txt +139 -122
- data/asciidoc/doc/asciidoc.1 +157 -46
- data/asciidoc/doc/asciidoc.1.txt +171 -118
- data/asciidoc/doc/asciidoc.conf +7 -8
- data/asciidoc/doc/asciidoc.dict +960 -635
- data/asciidoc/doc/asciidoc.txt +2335 -1464
- data/asciidoc/doc/asciidocapi.txt +189 -0
- data/asciidoc/doc/asciimathml.txt +14 -17
- data/asciidoc/doc/book-multi.txt +181 -155
- data/asciidoc/doc/book.epub +0 -0
- data/asciidoc/doc/book.txt +156 -131
- data/asciidoc/doc/customers.csv +18 -18
- data/asciidoc/doc/epub-notes.txt +210 -0
- data/asciidoc/doc/faq.txt +1122 -547
- data/asciidoc/doc/latex-backend.txt +192 -191
- data/asciidoc/doc/latex-bugs.txt +134 -0
- data/asciidoc/doc/latex-filter.pdf +0 -0
- data/asciidoc/doc/latex-filter.txt +196 -0
- data/asciidoc/doc/latexmath.txt +13 -136
- data/asciidoc/doc/latexmathml.txt +2 -2
- data/asciidoc/doc/main.aap +233 -297
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/music-filter.txt +55 -65
- data/asciidoc/doc/publishing-ebooks-with-asciidoc.txt +398 -0
- data/asciidoc/doc/slidy-example.txt +167 -0
- data/asciidoc/doc/slidy.txt +113 -0
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.txt +45 -20
- data/asciidoc/doc/testasciidoc.txt +231 -0
- data/asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt +30 -8
- data/asciidoc/docbook-xsl/chunked.xsl +17 -19
- data/asciidoc/docbook-xsl/common.xsl +106 -67
- data/asciidoc/docbook-xsl/epub.xsl +35 -0
- data/asciidoc/docbook-xsl/fo.xsl +3 -0
- data/asciidoc/docbook-xsl/htmlhelp.xsl +16 -17
- data/asciidoc/docbook-xsl/manpage.xsl +31 -31
- data/asciidoc/docbook-xsl/text.xsl +6 -1
- data/asciidoc/docbook-xsl/xhtml.xsl +14 -14
- data/asciidoc/docbook45.conf +759 -0
- data/asciidoc/filters/code/code-filter-readme.txt +37 -37
- data/asciidoc/filters/code/code-filter-test.txt +15 -15
- data/asciidoc/filters/code/code-filter.conf +8 -8
- data/asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt +104 -64
- data/asciidoc/filters/graphviz/graphviz-filter.conf +20 -16
- data/asciidoc/filters/graphviz/graphviz2png.py +54 -39
- data/asciidoc/filters/latex/latex-filter.conf +18 -0
- data/asciidoc/filters/latex/latex2png.py +216 -0
- data/asciidoc/filters/music/music-filter.conf +8 -17
- data/asciidoc/filters/music/music2png.py +40 -32
- data/asciidoc/filters/source/source-highlight-filter.conf +40 -34
- data/asciidoc/help.conf +261 -96
- data/asciidoc/html4.conf +505 -460
- data/asciidoc/html5.conf +686 -0
- data/asciidoc/images/highlighter.png +0 -0
- data/asciidoc/images/icons/caution.png +0 -0
- data/asciidoc/images/icons/example.png +0 -0
- data/asciidoc/images/icons/important.png +0 -0
- data/asciidoc/images/icons/note.png +0 -0
- data/asciidoc/images/icons/tip.png +0 -0
- data/asciidoc/images/icons/warning.png +0 -0
- data/asciidoc/images/smallnew.png +0 -0
- data/asciidoc/javascripts/asciidoc.js +189 -0
- data/asciidoc/javascripts/slidy.js +2845 -0
- data/asciidoc/javascripts/toc.js +8 -0
- data/asciidoc/lang-de.conf +57 -0
- data/asciidoc/lang-en.conf +54 -0
- data/asciidoc/lang-es.conf +49 -9
- data/asciidoc/lang-fr.conf +59 -0
- data/asciidoc/lang-hu.conf +55 -0
- data/asciidoc/lang-it.conf +55 -0
- data/asciidoc/lang-nl.conf +57 -0
- data/asciidoc/lang-pt-BR.conf +56 -0
- data/asciidoc/lang-ru.conf +60 -0
- data/asciidoc/lang-uk.conf +60 -0
- data/asciidoc/latex.conf +700 -663
- data/asciidoc/main.aap +77 -0
- data/asciidoc/slidy.conf +136 -0
- data/asciidoc/{examples/website/xhtml11-manpage.css → stylesheets/asciidoc-manpage.css} +1 -1
- data/asciidoc/stylesheets/asciidoc.css +508 -0
- data/asciidoc/stylesheets/docbook-xsl.css +322 -272
- data/asciidoc/stylesheets/flask-manpage.css +1 -0
- data/asciidoc/stylesheets/flask.css +584 -0
- data/asciidoc/stylesheets/pygments.css +66 -0
- data/asciidoc/stylesheets/slidy.css +445 -0
- data/asciidoc/stylesheets/toc2.css +33 -0
- data/asciidoc/stylesheets/volnitsky-manpage.css +1 -0
- data/asciidoc/stylesheets/volnitsky.css +435 -0
- data/asciidoc/stylesheets/xhtml11-quirks.css +5 -3
- data/asciidoc/tests/asciidocapi.py +257 -0
- data/asciidoc/tests/data/deprecated-quotes.txt +12 -0
- data/asciidoc/tests/data/filters-test.txt +90 -0
- data/asciidoc/tests/data/lang-de-test.txt +106 -0
- data/asciidoc/tests/data/lang-en-test.txt +114 -0
- data/asciidoc/tests/data/lang-es-test.txt +106 -0
- data/asciidoc/tests/data/lang-fr-test.txt +106 -0
- data/asciidoc/tests/data/lang-hu-test.txt +106 -0
- data/asciidoc/tests/data/lang-nl-test.txt +94 -0
- data/asciidoc/tests/data/lang-pt-BR-test.txt +106 -0
- data/asciidoc/tests/data/lang-ru-test.txt +106 -0
- data/asciidoc/tests/data/lang-uk-test.txt +106 -0
- data/asciidoc/tests/data/oldtables.txt +64 -0
- data/asciidoc/tests/data/rcs-id-marker-test.txt +6 -0
- data/asciidoc/tests/data/testcases.conf +2 -0
- data/asciidoc/tests/data/testcases.txt +740 -0
- data/asciidoc/tests/data/utf8-bom-test.txt +9 -0
- data/asciidoc/tests/data/utf8-examples.txt +217 -0
- data/asciidoc/tests/testasciidoc.conf +520 -0
- data/asciidoc/tests/testasciidoc.py +411 -0
- data/asciidoc/text.conf +16 -16
- data/asciidoc/vim/syntax/asciidoc.vim +99 -91
- data/asciidoc/wordpress.conf +43 -3
- data/asciidoc/xhtml11-quirks.conf +61 -57
- data/asciidoc/xhtml11.conf +684 -645
- data/lib/mizuho.rb +2 -0
- data/lib/mizuho/generator.rb +2 -2
- data/test/generator_spec.rb +1 -1
- data/test/parser_spec.rb +1 -1
- data/test/spec_helper.rb +3 -4
- metadata +87 -88
- data/asciidoc/a2x +0 -674
- data/asciidoc/doc/article.css-embedded.html +0 -602
- data/asciidoc/doc/article.html +0 -46
- data/asciidoc/doc/asciidoc-revhistory.xml +0 -27
- data/asciidoc/doc/asciidoc.1.css-embedded.html +0 -598
- data/asciidoc/doc/asciidoc.1.css.html +0 -212
- data/asciidoc/doc/asciidoc.1.html +0 -190
- data/asciidoc/doc/asciidoc.css-embedded.html +0 -7853
- data/asciidoc/doc/asciidoc.css.html +0 -7416
- data/asciidoc/doc/asciidoc.html +0 -3339
- data/asciidoc/doc/book-multi.css-embedded.html +0 -575
- data/asciidoc/doc/book-multi.html +0 -55
- data/asciidoc/doc/book.css-embedded.html +0 -607
- data/asciidoc/doc/book.html +0 -43
- data/asciidoc/doc/docbook-xsl.css +0 -272
- data/asciidoc/doc/latex-backend.html +0 -117
- data/asciidoc/doc/music-filter.html +0 -566
- data/asciidoc/doc/source-highlight-filter.html +0 -214
- data/asciidoc/docbook.conf +0 -721
- data/asciidoc/examples/website/ASCIIMathML.js +0 -938
- data/asciidoc/examples/website/CHANGELOG.html +0 -4389
- data/asciidoc/examples/website/CHANGELOG.txt +0 -1810
- data/asciidoc/examples/website/INSTALL.html +0 -161
- data/asciidoc/examples/website/INSTALL.txt +0 -71
- data/asciidoc/examples/website/LaTeXMathML.js +0 -1223
- data/asciidoc/examples/website/README-website.html +0 -118
- data/asciidoc/examples/website/README-website.txt +0 -29
- data/asciidoc/examples/website/README.html +0 -125
- data/asciidoc/examples/website/README.txt +0 -36
- data/asciidoc/examples/website/a2x.1.html +0 -419
- data/asciidoc/examples/website/a2x.1.txt +0 -204
- data/asciidoc/examples/website/asciidoc-docbook-xsl.html +0 -130
- data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +0 -43
- data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +0 -130
- data/asciidoc/examples/website/asciimathml.txt +0 -64
- data/asciidoc/examples/website/build-website.sh +0 -25
- data/asciidoc/examples/website/customers.csv +0 -18
- data/asciidoc/examples/website/downloads.html +0 -257
- data/asciidoc/examples/website/downloads.txt +0 -121
- data/asciidoc/examples/website/faq.html +0 -673
- data/asciidoc/examples/website/faq.txt +0 -547
- data/asciidoc/examples/website/index.html +0 -419
- data/asciidoc/examples/website/index.txt +0 -245
- data/asciidoc/examples/website/latex-backend.html +0 -535
- data/asciidoc/examples/website/latex-backend.txt +0 -191
- data/asciidoc/examples/website/latexmathml.txt +0 -41
- data/asciidoc/examples/website/layout1.conf +0 -161
- data/asciidoc/examples/website/layout1.css +0 -65
- data/asciidoc/examples/website/layout2.conf +0 -158
- data/asciidoc/examples/website/layout2.css +0 -93
- data/asciidoc/examples/website/manpage.html +0 -266
- data/asciidoc/examples/website/manpage.txt +0 -118
- data/asciidoc/examples/website/music-filter.html +0 -242
- data/asciidoc/examples/website/music-filter.txt +0 -158
- data/asciidoc/examples/website/music1.abc +0 -12
- data/asciidoc/examples/website/music1.png +0 -0
- data/asciidoc/examples/website/music2.ly +0 -9
- data/asciidoc/examples/website/music2.png +0 -0
- data/asciidoc/examples/website/newlists.txt +0 -40
- data/asciidoc/examples/website/newtables.txt +0 -397
- data/asciidoc/examples/website/sample1.png +0 -0
- data/asciidoc/examples/website/sample3.png +0 -0
- data/asciidoc/examples/website/sample4.png +0 -0
- data/asciidoc/examples/website/source-highlight-filter.html +0 -286
- data/asciidoc/examples/website/source-highlight-filter.txt +0 -203
- data/asciidoc/examples/website/support.html +0 -78
- data/asciidoc/examples/website/support.txt +0 -5
- data/asciidoc/examples/website/toc.js +0 -69
- data/asciidoc/examples/website/userguide.html +0 -7460
- data/asciidoc/examples/website/userguide.txt +0 -4979
- data/asciidoc/examples/website/version83.txt +0 -37
- data/asciidoc/examples/website/version9.html +0 -143
- data/asciidoc/examples/website/version9.txt +0 -48
- data/asciidoc/examples/website/xhtml11-quirks.css +0 -41
- data/asciidoc/examples/website/xhtml11.css +0 -328
- data/asciidoc/stylesheets/xhtml11-manpage.css +0 -18
- data/asciidoc/stylesheets/xhtml11.css +0 -328
@@ -0,0 +1,411 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
|
3
|
+
USAGE = '''Usage: testasciidoc.py [OPTIONS] COMMAND
|
4
|
+
|
5
|
+
Run AsciiDoc conformance tests specified in configuration FILE.
|
6
|
+
|
7
|
+
Commands:
|
8
|
+
list List tests
|
9
|
+
run [NUMBER] [BACKEND] Execute tests
|
10
|
+
update [NUMBER] [BACKEND] Regenerate and update test data
|
11
|
+
|
12
|
+
Options:
|
13
|
+
-f, --conf-file=CONF_FILE
|
14
|
+
Use configuration file CONF_FILE (default configuration file is
|
15
|
+
testasciidoc.conf in testasciidoc.py directory)
|
16
|
+
--force
|
17
|
+
Update all test data overwriting existing data'''
|
18
|
+
|
19
|
+
|
20
|
+
__version__ = '0.1.1'
|
21
|
+
__copyright__ = 'Copyright (C) 2009 Stuart Rackham'
|
22
|
+
|
23
|
+
|
24
|
+
import os, sys, re, StringIO, difflib
|
25
|
+
import asciidocapi
|
26
|
+
|
27
|
+
|
28
|
+
BACKENDS = ('html4','xhtml11','docbook','wordpress','html5') # Default backends.
|
29
|
+
BACKEND_EXT = {'html4':'.html', 'xhtml11':'.html', 'docbook':'.xml',
|
30
|
+
'wordpress':'.html','slidy':'.html','html5':'.html'}
|
31
|
+
|
32
|
+
|
33
|
+
def iif(condition, iftrue, iffalse=None):
|
34
|
+
"""
|
35
|
+
Immediate if c.f. ternary ?: operator.
|
36
|
+
False value defaults to '' if the true value is a string.
|
37
|
+
False value defaults to 0 if the true value is a number.
|
38
|
+
"""
|
39
|
+
if iffalse is None:
|
40
|
+
if isinstance(iftrue, basestring):
|
41
|
+
iffalse = ''
|
42
|
+
if type(iftrue) in (int, float):
|
43
|
+
iffalse = 0
|
44
|
+
if condition:
|
45
|
+
return iftrue
|
46
|
+
else:
|
47
|
+
return iffalse
|
48
|
+
|
49
|
+
def message(msg=''):
|
50
|
+
print >>sys.stderr, msg
|
51
|
+
|
52
|
+
def strip_end(lines):
|
53
|
+
"""
|
54
|
+
Strip blank strings from the end of list of strings.
|
55
|
+
"""
|
56
|
+
for i in range(len(lines)-1,-1,-1):
|
57
|
+
if not lines[i]:
|
58
|
+
del lines[i]
|
59
|
+
else:
|
60
|
+
break
|
61
|
+
|
62
|
+
def normalize_data(lines):
|
63
|
+
"""
|
64
|
+
Strip comments and trailing blank strings from lines.
|
65
|
+
"""
|
66
|
+
result = [ s for s in lines if not s.startswith('#') ]
|
67
|
+
strip_end(result)
|
68
|
+
return result
|
69
|
+
|
70
|
+
|
71
|
+
class AsciiDocTest(object):
|
72
|
+
|
73
|
+
def __init__(self):
|
74
|
+
self.number = None # Test number (1..).
|
75
|
+
self.name = '' # Optional test name.
|
76
|
+
self.title = '' # Optional test name.
|
77
|
+
self.description = [] # List of lines followoing title.
|
78
|
+
self.source = None # AsciiDoc test source file name.
|
79
|
+
self.options = []
|
80
|
+
self.attributes = {}
|
81
|
+
self.backends = BACKENDS
|
82
|
+
self.datadir = None # Where output files are stored.
|
83
|
+
self.disabled = False
|
84
|
+
|
85
|
+
def backend_filename(self, backend):
|
86
|
+
"""
|
87
|
+
Return the path name of the backend output file that is generated from
|
88
|
+
the test name and output file type.
|
89
|
+
"""
|
90
|
+
return '%s-%s%s' % (
|
91
|
+
os.path.normpath(os.path.join(self.datadir, self.name)),
|
92
|
+
backend,
|
93
|
+
BACKEND_EXT[backend])
|
94
|
+
|
95
|
+
def parse(self, lines, confdir, datadir):
|
96
|
+
"""
|
97
|
+
Parse conf file test section from list of text lines.
|
98
|
+
"""
|
99
|
+
self.__init__()
|
100
|
+
self.confdir = confdir
|
101
|
+
self.datadir = datadir
|
102
|
+
lines = Lines(lines)
|
103
|
+
while not lines.eol():
|
104
|
+
l = lines.read_until(r'^%')
|
105
|
+
if l:
|
106
|
+
if not l[0].startswith('%'):
|
107
|
+
if l[0][0] == '!':
|
108
|
+
self.disabled = True
|
109
|
+
self.title = l[0][1:]
|
110
|
+
else:
|
111
|
+
self.title = l[0]
|
112
|
+
self.description = l[1:]
|
113
|
+
continue
|
114
|
+
reo = re.match(r'^%\s*(?P<directive>[\w_-]+)', l[0])
|
115
|
+
if not reo:
|
116
|
+
raise (ValueError, 'illegal directive: %s' % l[0])
|
117
|
+
directive = reo.groupdict()['directive']
|
118
|
+
data = normalize_data(l[1:])
|
119
|
+
if directive == 'source':
|
120
|
+
if data:
|
121
|
+
self.source = os.path.normpath(os.path.join(
|
122
|
+
self.confdir, os.path.normpath(data[0])))
|
123
|
+
elif directive == 'options':
|
124
|
+
self.options = eval(' '.join(data))
|
125
|
+
for i,v in enumerate(self.options):
|
126
|
+
if isinstance(v, basestring):
|
127
|
+
self.options[i] = (v,None)
|
128
|
+
elif directive == 'attributes':
|
129
|
+
self.attributes = eval(' '.join(data))
|
130
|
+
elif directive == 'backends':
|
131
|
+
self.backends = eval(' '.join(data))
|
132
|
+
elif directive == 'name':
|
133
|
+
self.name = data[0].strip()
|
134
|
+
else:
|
135
|
+
raise (ValueError, 'illegal directive: %s' % l[0])
|
136
|
+
if not self.title:
|
137
|
+
self.title = self.source
|
138
|
+
if not self.name:
|
139
|
+
self.name = os.path.basename(os.path.splitext(self.source)[0])
|
140
|
+
|
141
|
+
def is_missing(self, backend):
|
142
|
+
"""
|
143
|
+
Returns True if there is no output test data file for backend.
|
144
|
+
"""
|
145
|
+
return not os.path.isfile(self.backend_filename(backend))
|
146
|
+
|
147
|
+
def is_missing_or_outdated(self, backend):
|
148
|
+
"""
|
149
|
+
Returns True if the output test data file is missing or out of date.
|
150
|
+
"""
|
151
|
+
return self.is_missing(backend) or (
|
152
|
+
os.path.getmtime(self.source)
|
153
|
+
> os.path.getmtime(self.backend_filename(backend)))
|
154
|
+
|
155
|
+
def get_expected(self, backend):
|
156
|
+
"""
|
157
|
+
Return expected test data output for backend.
|
158
|
+
"""
|
159
|
+
f = open(self.backend_filename(backend))
|
160
|
+
try:
|
161
|
+
result = f.readlines()
|
162
|
+
# Strip line terminators.
|
163
|
+
result = [ s.rstrip() for s in result ]
|
164
|
+
finally:
|
165
|
+
f.close()
|
166
|
+
return result
|
167
|
+
|
168
|
+
def generate_expected(self, backend):
|
169
|
+
"""
|
170
|
+
Generate and return test data output for backend.
|
171
|
+
"""
|
172
|
+
asciidoc = asciidocapi.AsciiDocAPI()
|
173
|
+
asciidoc.options.values = self.options
|
174
|
+
asciidoc.attributes = self.attributes
|
175
|
+
infile = self.source
|
176
|
+
outfile = StringIO.StringIO()
|
177
|
+
asciidoc.execute(infile, outfile, backend)
|
178
|
+
return outfile.getvalue().splitlines()
|
179
|
+
|
180
|
+
def update_expected(self, backend):
|
181
|
+
"""
|
182
|
+
Generate and write backend data.
|
183
|
+
"""
|
184
|
+
lines = self.generate_expected(backend)
|
185
|
+
if not os.path.isdir(self.datadir):
|
186
|
+
print('CREATING: %s' % self.datadir)
|
187
|
+
os.mkdir(self.datadir)
|
188
|
+
f = open(self.backend_filename(backend),'w+')
|
189
|
+
try:
|
190
|
+
print('WRITING: %s' % f.name)
|
191
|
+
f.writelines([ s + os.linesep for s in lines])
|
192
|
+
finally:
|
193
|
+
f.close()
|
194
|
+
|
195
|
+
def update(self, backend=None, force=False):
|
196
|
+
"""
|
197
|
+
Regenerate and update expected test data outputs.
|
198
|
+
"""
|
199
|
+
if backend is None:
|
200
|
+
backends = self.backends
|
201
|
+
else:
|
202
|
+
backends = [backend]
|
203
|
+
for backend in backends:
|
204
|
+
if force or self.is_missing_or_outdated(backend):
|
205
|
+
self.update_expected(backend)
|
206
|
+
|
207
|
+
def run(self, backend=None):
|
208
|
+
"""
|
209
|
+
Execute test.
|
210
|
+
Return True if test passes.
|
211
|
+
"""
|
212
|
+
if backend is None:
|
213
|
+
backends = self.backends
|
214
|
+
else:
|
215
|
+
backends = [backend]
|
216
|
+
result = True # Assume success.
|
217
|
+
self.passed = self.failed = self.skipped = 0
|
218
|
+
print('%d: %s' % (self.number, self.title))
|
219
|
+
if self.source and os.path.isfile(self.source):
|
220
|
+
print('SOURCE: asciidoc: %s' % self.source)
|
221
|
+
for backend in backends:
|
222
|
+
fromfile = self.backend_filename(backend)
|
223
|
+
if not self.is_missing(backend):
|
224
|
+
expected = self.get_expected(backend)
|
225
|
+
strip_end(expected)
|
226
|
+
got = self.generate_expected(backend)
|
227
|
+
strip_end(got)
|
228
|
+
lines = []
|
229
|
+
for line in difflib.unified_diff(got, expected, n=0):
|
230
|
+
lines.append(line)
|
231
|
+
if lines:
|
232
|
+
result = False
|
233
|
+
self.failed +=1
|
234
|
+
lines = lines[3:]
|
235
|
+
print('FAILED: %s: %s' % (backend, fromfile))
|
236
|
+
message('+++ %s' % fromfile)
|
237
|
+
message('--- got')
|
238
|
+
for line in lines:
|
239
|
+
message(line)
|
240
|
+
message()
|
241
|
+
else:
|
242
|
+
self.passed += 1
|
243
|
+
print('PASSED: %s: %s' % (backend, fromfile))
|
244
|
+
else:
|
245
|
+
self.skipped += 1
|
246
|
+
print('SKIPPED: %s: %s' % (backend, fromfile))
|
247
|
+
else:
|
248
|
+
self.skipped += len(backends)
|
249
|
+
if self.source:
|
250
|
+
msg = 'MISSING: %s' % self.source
|
251
|
+
else:
|
252
|
+
msg = 'NO ASCIIDOC SOURCE FILE SPECIFIED'
|
253
|
+
print(msg)
|
254
|
+
print('')
|
255
|
+
return result
|
256
|
+
|
257
|
+
|
258
|
+
class AsciiDocTests(object):
|
259
|
+
|
260
|
+
def __init__(self, conffile):
|
261
|
+
"""
|
262
|
+
Parse configuration file.
|
263
|
+
"""
|
264
|
+
self.conffile = os.path.normpath(conffile)
|
265
|
+
# All file names are relative to configuration file directory.
|
266
|
+
self.confdir = os.path.dirname(self.conffile)
|
267
|
+
self.datadir = self.confdir # Default expected files directory.
|
268
|
+
self.tests = [] # List of parsed AsciiDocTest objects.
|
269
|
+
self.globals = {}
|
270
|
+
f = open(self.conffile)
|
271
|
+
try:
|
272
|
+
lines = Lines(f.readlines())
|
273
|
+
finally:
|
274
|
+
f.close()
|
275
|
+
first = True
|
276
|
+
while not lines.eol():
|
277
|
+
s = lines.read_until(r'^%+$')
|
278
|
+
if s:
|
279
|
+
# Optional globals precede all tests.
|
280
|
+
if first and re.match(r'^%\s*globals$',s[0]):
|
281
|
+
self.globals = eval(' '.join(normalize_data(s[1:])))
|
282
|
+
if 'datadir' in self.globals:
|
283
|
+
self.datadir = os.path.join(
|
284
|
+
self.confdir,
|
285
|
+
os.path.normpath(self.globals['datadir']))
|
286
|
+
else:
|
287
|
+
test = AsciiDocTest()
|
288
|
+
test.parse(s[1:], self.confdir, self.datadir)
|
289
|
+
self.tests.append(test)
|
290
|
+
test.number = len(self.tests)
|
291
|
+
first = False
|
292
|
+
|
293
|
+
def run(self, number=None, backend=None):
|
294
|
+
"""
|
295
|
+
Run all tests.
|
296
|
+
If number is specified run test number (1..).
|
297
|
+
"""
|
298
|
+
self.passed = self.failed = self.skipped = 0
|
299
|
+
for test in self.tests:
|
300
|
+
if (not test.disabled or number) and (not number or number == test.number) and (not backend or backend in test.backends):
|
301
|
+
test.run(backend)
|
302
|
+
self.passed += test.passed
|
303
|
+
self.failed += test.failed
|
304
|
+
self.skipped += test.skipped
|
305
|
+
if self.passed > 0:
|
306
|
+
print('TOTAL PASSED: %s' % self.passed)
|
307
|
+
if self.failed > 0:
|
308
|
+
print('TOTAL FAILED: %s' % self.failed)
|
309
|
+
if self.skipped > 0:
|
310
|
+
print('TOTAL SKIPPED: %s' % self.skipped)
|
311
|
+
|
312
|
+
def update(self, number=None, backend=None, force=False):
|
313
|
+
"""
|
314
|
+
Regenerate expected test data and update configuratio file.
|
315
|
+
"""
|
316
|
+
for test in self.tests:
|
317
|
+
if (not test.disabled or number) and (not number or number == test.number):
|
318
|
+
test.update(backend, force=force)
|
319
|
+
|
320
|
+
def list(self):
|
321
|
+
"""
|
322
|
+
Lists tests to stdout.
|
323
|
+
"""
|
324
|
+
for test in self.tests:
|
325
|
+
print '%d: %s%s' % (test.number, iif(test.disabled,'!'), test.title)
|
326
|
+
|
327
|
+
|
328
|
+
class Lines(list):
|
329
|
+
"""
|
330
|
+
A list of strings.
|
331
|
+
Adds eol() and read_until() to list type.
|
332
|
+
"""
|
333
|
+
|
334
|
+
def __init__(self, lines):
|
335
|
+
super(Lines, self).__init__()
|
336
|
+
self.extend([s.rstrip() for s in lines])
|
337
|
+
self.pos = 0
|
338
|
+
|
339
|
+
def eol(self):
|
340
|
+
return self.pos >= len(self)
|
341
|
+
|
342
|
+
def read_until(self, regexp):
|
343
|
+
"""
|
344
|
+
Return a list of lines from current position up until the next line
|
345
|
+
matching regexp.
|
346
|
+
Advance position to matching line.
|
347
|
+
"""
|
348
|
+
result = []
|
349
|
+
if not self.eol():
|
350
|
+
result.append(self[self.pos])
|
351
|
+
self.pos += 1
|
352
|
+
while not self.eol():
|
353
|
+
if re.match(regexp, self[self.pos]):
|
354
|
+
break
|
355
|
+
result.append(self[self.pos])
|
356
|
+
self.pos += 1
|
357
|
+
return result
|
358
|
+
|
359
|
+
|
360
|
+
def usage(msg=None):
|
361
|
+
if msg:
|
362
|
+
message(msg + '\n')
|
363
|
+
message(USAGE)
|
364
|
+
|
365
|
+
|
366
|
+
if __name__ == '__main__':
|
367
|
+
# Process command line options.
|
368
|
+
import getopt
|
369
|
+
try:
|
370
|
+
opts,args = getopt.getopt(sys.argv[1:], 'f:', ['force'])
|
371
|
+
except getopt.GetoptError:
|
372
|
+
usage('illegal command options')
|
373
|
+
sys.exit(1)
|
374
|
+
if len(args) == 0:
|
375
|
+
usage()
|
376
|
+
sys.exit(1)
|
377
|
+
conffile = os.path.join(os.path.dirname(sys.argv[0]), 'testasciidoc.conf')
|
378
|
+
force = False
|
379
|
+
for o,v in opts:
|
380
|
+
if o == '--force':
|
381
|
+
force = True
|
382
|
+
if o in ('-f','--conf-file'):
|
383
|
+
conffile = v
|
384
|
+
if not os.path.isfile(conffile):
|
385
|
+
message('missing CONF_FILE: %s' % conffile)
|
386
|
+
sys.exit(1)
|
387
|
+
tests = AsciiDocTests(conffile)
|
388
|
+
cmd = args[0]
|
389
|
+
number = None
|
390
|
+
backend = None
|
391
|
+
for arg in args[1:3]:
|
392
|
+
try:
|
393
|
+
number = int(arg)
|
394
|
+
except ValueError:
|
395
|
+
backend = arg
|
396
|
+
if backend and backend not in BACKENDS:
|
397
|
+
message('illegal BACKEND: %s' % backend)
|
398
|
+
sys.exit(1)
|
399
|
+
if number is not None and number not in range(1, len(tests.tests)+1):
|
400
|
+
message('illegal test NUMBER: %d' % number)
|
401
|
+
sys.exit(1)
|
402
|
+
if cmd == 'run':
|
403
|
+
tests.run(number, backend)
|
404
|
+
if tests.failed:
|
405
|
+
exit(1)
|
406
|
+
elif cmd == 'update':
|
407
|
+
tests.update(number, backend, force=force)
|
408
|
+
elif cmd == 'list':
|
409
|
+
tests.list()
|
410
|
+
else:
|
411
|
+
usage('illegal COMMAND: %s' % cmd)
|
data/asciidoc/text.conf
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
# text.conf
|
2
|
-
# Used by the AsciiDoc a2x(1) toolchain wrapper utility.
|
3
|
-
# Filters to add leading blank line and margin indent to verbatim
|
4
|
-
# block elements so lynx(1) generated text output looks nicer.
|
5
|
-
|
6
|
-
[paradef-default]
|
7
|
-
verse-style=template="verseparagraph",filter="echo; echo; sed 's/^/ /'"
|
8
|
-
|
9
|
-
[paradef-literal]
|
10
|
-
filter=echo; echo; sed 's/^/ /'
|
11
|
-
|
12
|
-
[blockdef-listing]
|
13
|
-
filter=echo; sed 's/^/ /'
|
14
|
-
|
15
|
-
[blockdef-literal]
|
16
|
-
filter=echo; sed 's/^/ /'
|
1
|
+
# text.conf
|
2
|
+
# Used by the AsciiDoc a2x(1) toolchain wrapper utility.
|
3
|
+
# Filters to add leading blank line and margin indent to verbatim
|
4
|
+
# block elements so lynx(1) generated text output looks nicer.
|
5
|
+
|
6
|
+
[paradef-default]
|
7
|
+
verse-style=template="verseparagraph",filter="echo; echo; sed 's/^/ /'"
|
8
|
+
|
9
|
+
[paradef-literal]
|
10
|
+
filter=echo; echo; sed 's/^/ /'
|
11
|
+
|
12
|
+
[blockdef-listing]
|
13
|
+
filter=echo; sed 's/^/ /'
|
14
|
+
|
15
|
+
[blockdef-literal]
|
16
|
+
filter=echo; sed 's/^/ /'
|
@@ -5,7 +5,7 @@
|
|
5
5
|
" URL: http://www.methods.co.nz/asciidoc/
|
6
6
|
" Licence: GPL (http://www.gnu.org)
|
7
7
|
" Remarks: Vim 6 or greater
|
8
|
-
" Limitations: See 'Appendix
|
8
|
+
" Limitations: See 'Appendix E: Vim Syntax Highlighter' in the AsciiDoc 'User
|
9
9
|
" Guide'.
|
10
10
|
|
11
11
|
if exists("b:current_syntax")
|
@@ -17,7 +17,7 @@ syn sync fromstart
|
|
17
17
|
syn sync linebreaks=1
|
18
18
|
|
19
19
|
" Run :help syn-priority to review syntax matching priority.
|
20
|
-
syn keyword asciidocToDo TODO FIXME XXX ZZZ
|
20
|
+
syn keyword asciidocToDo TODO FIXME CHECK TEST XXX ZZZ DEPRECATED
|
21
21
|
syn match asciidocBackslash /\\/
|
22
22
|
syn region asciidocIdMarker start=/^\$Id:\s/ end=/\s\$$/
|
23
23
|
syn match asciidocCallout /\\\@<!<\d\{1,2}>/
|
@@ -26,140 +26,148 @@ syn match asciidocLineBreak /[ \t]+$/
|
|
26
26
|
syn match asciidocRuler /^'\{3,}$/
|
27
27
|
syn match asciidocPagebreak /^<\{3,}$/
|
28
28
|
syn match asciidocEntityRef /\\\@<!&[#a-zA-Z]\S\{-};/
|
29
|
-
|
30
|
-
" preceeded by blank line, handles only bulleted items (see 'Limitations' above
|
31
|
-
" for workarounds).
|
32
|
-
syn region asciidocLiteralParagraph start=/^\n[ \t]\+\(\([^-*. \t] \)\|\(\S\S\)\)/ end=/\(^+\?\s*$\)\@=/
|
33
|
-
syn match asciidocListBullet /^\s*\zs[-*]\ze\s/
|
34
|
-
syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,2}\|\(\a\.\)\|\([ivxIVX]\+\.\)\)\ze\s\+/
|
29
|
+
syn region asciidocLiteralParagraph start=/\(\%^\|\_^\n\)\@<=\s\+\S\+/ end=/\(^\(+\|--\)\?\s*$\)\@=/ contains=asciidocToDo
|
35
30
|
syn match asciidocURL /\\\@<!\<\(http\|https\|ftp\|file\|irc\):\/\/[^| \t]*\(\w\|\/\)/
|
36
|
-
syn match asciidocEmail
|
37
|
-
syn match asciidocAttributeRef /\\\@<!{\w\(\w
|
38
|
-
syn match asciidocAdmonition /^\u\{3,15}:\(\s\+.*\)\@=/
|
31
|
+
syn match asciidocEmail /[\\.:]\@<!\(\<\|<\)\w\(\w\|[.-]\)*@\(\w\|[.-]\)*\w>\?[0-9A-Za-z_]\@!/
|
32
|
+
syn match asciidocAttributeRef /\\\@<!{\w\(\w\|[-,+]\)*\([=!@#$%?:].*\)\?}/
|
39
33
|
|
40
|
-
" As a damage control measure quoted patterns always terminate at a
|
34
|
+
" As a damage control measure quoted patterns always terminate at a blank
|
41
35
|
" line (see 'Limitations' above).
|
42
|
-
syn match
|
43
|
-
syn match
|
44
|
-
syn match
|
45
|
-
|
46
|
-
syn match
|
47
|
-
syn match
|
48
|
-
syn match
|
49
|
-
|
50
|
-
syn match
|
51
|
-
syn match
|
52
|
-
|
36
|
+
syn match asciidocQuotedAttributeList /\\\@<!\[[a-zA-Z0-9_-][a-zA-Z0-9 _-]*\][+_'`#*]\@=/
|
37
|
+
syn match asciidocQuotedSubscript /\\\@<!\~\S\_.\{-}\(\~\|\n\s*\n\)/ contains=asciidocEntityRef
|
38
|
+
syn match asciidocQuotedSuperscript /\\\@<!\^\S\_.\{-}\(\^\|\n\s*\n\)/ contains=asciidocEntityRef
|
39
|
+
|
40
|
+
syn match asciidocQuotedMonospaced /\(^\|[| \t([.,=\]]\)\@<=+\([ )\n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(+\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
41
|
+
syn match asciidocQuotedMonospaced2 /\(^\|[| \t([.,=\]]\)\@<=`\([ )\n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(`\([| \t)[\],.?!;:=]\|$\)\@=\)/
|
42
|
+
syn match asciidocQuotedUnconstrainedMonospaced /[\\+]\@<!++\S\_.\{-}\(++\|\n\s*\n\)/ contains=asciidocEntityRef
|
43
|
+
|
44
|
+
syn match asciidocQuotedEmphasized /\(^\|[| \t([.,=\]]\)\@<=_\([ )\n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(_\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
45
|
+
syn match asciidocQuotedEmphasized2 /\(^\|[| \t([.,=\]]\)\@<='\([ )\n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\('\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
46
|
+
syn match asciidocQuotedUnconstrainedEmphasized /\\\@<!__\S\_.\{-}\(__\|\n\s*\n\)/ contains=asciidocEntityRef
|
47
|
+
|
48
|
+
syn match asciidocQuotedBold /\(^\|[| \t([.,=\]]\)\@<=\*\([ )\n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(\*\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
49
|
+
syn match asciidocQuotedUnconstrainedBold /\\\@<!\*\*\S\_.\{-}\(\*\*\|\n\s*\n\)/ contains=asciidocEntityRef
|
50
|
+
|
53
51
|
" Don't allow ` in single quoted (a kludge to stop confusion with `monospaced`).
|
54
|
-
syn match asciidocQuotedSingleQuoted /\(^\|[| \t([
|
55
|
-
|
52
|
+
syn match asciidocQuotedSingleQuoted /\(^\|[| \t([.,=\]]\)\@<=`\([ )\n\t]\)\@!\([^`]\|\n\(\s*\n\)\@!\)\{-}[^` \t]\('\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
53
|
+
|
54
|
+
syn match asciidocQuotedDoubleQuoted /\(^\|[| \t([.,=\]]\)\@<=``\([ )\n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(''\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
56
55
|
|
57
56
|
syn match asciidocDoubleDollarPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=\$\$..\{-}\(\$\$\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
|
58
57
|
syn match asciidocTriplePlusPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=+++..\{-}\(+++\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
|
59
58
|
|
59
|
+
syn match asciidocAdmonition /^\u\{3,15}:\(\s\+.*\)\@=/
|
60
|
+
|
60
61
|
syn region asciidocTable_OLD start=/^\([`.']\d*[-~_]*\)\+[-~_]\+\d*$/ end=/^$/
|
61
62
|
syn match asciidocBlockTitle /^\.[^. \t].*[^-~_]$/ contains=asciidocQuoted.*,asciidocAttributeRef
|
62
|
-
syn match asciidocOneLineTitle /^=\{1,5}\s\+\S.*$/ contains=asciidocQuoted.*,asciidocAttributeRef
|
63
|
-
|
64
63
|
syn match asciidocTitleUnderline /[-=~^+]\{2,}$/ transparent contained contains=NONE
|
65
|
-
syn match
|
64
|
+
syn match asciidocOneLineTitle /^=\{1,5}\s\+\S.*$/ contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash
|
65
|
+
syn match asciidocTwoLineTitle /^[^. +/].*[^.]\n[-=~^+]\{2,}$/ contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocTitleUnderline
|
66
66
|
|
67
67
|
syn match asciidocAttributeList /^\[[^[ \t].*\]$/
|
68
68
|
syn match asciidocQuoteBlockDelimiter /^_\{4,}$/
|
69
69
|
syn match asciidocExampleBlockDelimiter /^=\{4,}$/
|
70
70
|
syn match asciidocSidebarDelimiter /^*\{4,}$/
|
71
71
|
|
72
|
-
"See http://vimdoc.sourceforge.net/htmldoc/usr_44.html for excluding region
|
73
|
-
"contents from highlighting.
|
74
|
-
syn match asciidocTablePrefix /\(\
|
72
|
+
" See http://vimdoc.sourceforge.net/htmldoc/usr_44.html for excluding region
|
73
|
+
" contents from highlighting.
|
74
|
+
syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?|/ containedin=asciidocTableBlock contained
|
75
75
|
syn region asciidocTableBlock matchgroup=asciidocTableDelimiter start=/^|=\{3,}$/ end=/^|=\{3,}$/ keepend contains=ALL
|
76
|
-
syn match
|
76
|
+
syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?!/ containedin=asciidocTableBlock contained
|
77
77
|
syn region asciidocTableBlock2 matchgroup=asciidocTableDelimiter2 start=/^!=\{3,}$/ end=/^!=\{3,}$/ keepend contains=ALL
|
78
78
|
|
79
79
|
syn match asciidocListContinuation /^+$/
|
80
|
-
syn region asciidocLiteralBlock start=/^\.\{4,}$/ end=/^\.\{4,}$/ contains=asciidocCallout keepend
|
81
|
-
syn region asciidocListingBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout keepend
|
80
|
+
syn region asciidocLiteralBlock start=/^\.\{4,}$/ end=/^\.\{4,}$/ contains=asciidocCallout,asciidocToDo keepend
|
81
|
+
syn region asciidocListingBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout,asciidocToDo keepend
|
82
82
|
syn region asciidocCommentBlock start="^/\{4,}$" end="^/\{4,}$" contains=asciidocToDo
|
83
83
|
syn region asciidocPassthroughBlock start="^+\{4,}$" end="^+\{4,}$"
|
84
|
+
|
84
85
|
" Allowing leading \w characters in the filter delimiter is to accomodate
|
85
86
|
" the pre version 8.2.7 syntax and may be removed in future releases.
|
86
87
|
syn region asciidocFilterBlock start=/^\w*\~\{4,}$/ end=/^\w*\~\{4,}$/
|
87
88
|
|
88
|
-
syn region asciidocMacroAttributes matchgroup=asciidocRefMacro start=/\\\@<!<<"\{-}\
|
89
|
-
syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{2}\(\w
|
90
|
-
syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{3}\(\w
|
91
|
-
syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/[\\0-9a-zA-Z]\@<!\w\(\w\|-\)*:\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted
|
92
|
-
|
93
|
-
syn region asciidocMacroAttributes matchgroup=
|
89
|
+
syn region asciidocMacroAttributes matchgroup=asciidocRefMacro start=/\\\@<!<<"\{-}\(\w\|-\|_\|:\|\.\)\+"\?,\?/ end=/\(>>\)\|^$/ contains=asciidocQuoted.* keepend
|
90
|
+
syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{2}\(\w\|-\|_\|:\|\.\)\+,\?/ end=/\]\{2}/ keepend
|
91
|
+
syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{3}\(\w\|-\|_\|:\|\.\)\+/ end=/\]\{3}/ keepend
|
92
|
+
syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/[\\0-9a-zA-Z]\@<!\w\(\w\|-\)*:\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.*,asciidocAttributeRef keepend
|
93
|
+
" Highlight macro that starts with an attribute reference (a common idiom).
|
94
|
+
syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/\(\\\@<!{\w\(\w\|[-,+]\)*\([=!@#$%?:].*\)\?}\)\@<=\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.*,asciidocAttributeRef keepend
|
95
|
+
syn region asciidocMacroAttributes matchgroup=asciidocIndexTerm start=/\\\@<!(\{2,3}/ end=/)\{2,3}/ contains=asciidocQuoted.*,asciidocAttributeRef keepend
|
94
96
|
|
95
97
|
syn match asciidocCommentLine "^//\([^/].*\|\)$" contains=asciidocToDo
|
96
98
|
|
97
|
-
syn region asciidocVLabel start=/^\s*/ end=/\(::\|;;\)$/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend
|
98
|
-
syn region asciidocHLabel start=/^\s*/ end=/\(::\|;;\)\(\s\+\|\\$\)/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend
|
99
|
-
|
100
99
|
syn region asciidocAttributeEntry start=/^:\w/ end=/:\(\s\|$\)/ oneline
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
highlight link
|
112
|
-
highlight link
|
113
|
-
highlight link
|
101
|
+
" Lists.
|
102
|
+
syn match asciidocListBullet /^\s*\zs\(-\|\*\{1,5}\)\ze\s/
|
103
|
+
syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\ze\s\+/
|
104
|
+
syn region asciidocListLabel start=/^\s*/ end=/\(:\{2,4}\|;;\)$/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocToDo keepend
|
105
|
+
" DEPRECATED: Horizontal label.
|
106
|
+
syn region asciidocHLabel start=/^\s*/ end=/\(::\|;;\)\(\s\+\|\\$\)/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend
|
107
|
+
" Starts with any of the above.
|
108
|
+
syn region asciidocList start=/^\s*\(-\|\*\{1,5}\)\s/ start=/^\s*\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\s\+/ start=/.\+\(:\{2,4}\|;;\)$/ end=/\(^[=*]\{4,}$\)\@=/ end=/\(^+\?\s*$\)\@=/ contains=asciidocList.\+,asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocCommentLine,asciidocAttributeList,asciidocToDo
|
109
|
+
|
110
|
+
highlight link asciidocAdmonition Special
|
111
|
+
highlight link asciidocAnchorMacro Macro
|
112
|
+
highlight link asciidocAttributeEntry Special
|
113
|
+
highlight link asciidocAttributeList Special
|
114
114
|
highlight link asciidocAttributeMacro Macro
|
115
|
-
highlight link
|
115
|
+
highlight link asciidocAttributeRef Special
|
116
|
+
highlight link asciidocBackslash Special
|
117
|
+
highlight link asciidocBlockTitle Title
|
118
|
+
highlight link asciidocCallout Label
|
119
|
+
highlight link asciidocCommentBlock Comment
|
120
|
+
highlight link asciidocCommentLine Comment
|
121
|
+
highlight link asciidocDoubleDollarPassthrough Special
|
116
122
|
highlight link asciidocEmail Macro
|
117
|
-
highlight link
|
118
|
-
highlight link
|
119
|
-
highlight link
|
123
|
+
highlight link asciidocEntityRef Special
|
124
|
+
highlight link asciidocExampleBlockDelimiter Type
|
125
|
+
highlight link asciidocFilterBlock Type
|
120
126
|
highlight link asciidocHLabel Label
|
121
|
-
highlight link
|
122
|
-
highlight link
|
123
|
-
highlight link
|
124
|
-
highlight link asciidocTablePrefix Label
|
125
|
-
highlight link asciidocTableDelimiter2 Label
|
126
|
-
highlight link asciidocTableBlock2 NONE
|
127
|
-
highlight link asciidocTablePrefix2 Label
|
127
|
+
highlight link asciidocIdMarker Special
|
128
|
+
highlight link asciidocIndexTerm Macro
|
129
|
+
highlight link asciidocLineBreak Special
|
128
130
|
highlight link asciidocListBlockDelimiter Label
|
131
|
+
highlight link asciidocListBullet Label
|
129
132
|
highlight link asciidocListContinuation Label
|
130
|
-
highlight link asciidocLiteralParagraph Identifier
|
131
|
-
highlight link asciidocQuoteBlockDelimiter Type
|
132
|
-
highlight link asciidocExampleBlockDelimiter Type
|
133
|
-
highlight link asciidocSidebarDelimiter Type
|
134
|
-
highlight link asciidocLiteralBlock Identifier
|
135
133
|
highlight link asciidocListingBlock Identifier
|
134
|
+
highlight link asciidocListLabel Label
|
135
|
+
highlight link asciidocListNumber Label
|
136
|
+
highlight link asciidocLiteralBlock Identifier
|
137
|
+
highlight link asciidocLiteralParagraph Identifier
|
138
|
+
highlight link asciidocMacroAttributes Label
|
139
|
+
highlight link asciidocMacro Macro
|
140
|
+
highlight link asciidocOneLineTitle Title
|
141
|
+
highlight link asciidocPagebreak Type
|
136
142
|
highlight link asciidocPassthroughBlock Identifier
|
137
|
-
highlight link
|
138
|
-
highlight link
|
143
|
+
highlight link asciidocQuoteBlockDelimiter Type
|
144
|
+
highlight link asciidocQuotedAttributeList Special
|
139
145
|
highlight link asciidocQuotedBold Special
|
140
|
-
highlight link
|
141
|
-
highlight link asciidocQuotedEmphasized Type
|
146
|
+
highlight link asciidocQuotedDoubleQuoted Label
|
142
147
|
highlight link asciidocQuotedEmphasized2 Type
|
143
|
-
highlight link
|
144
|
-
highlight link asciidocQuotedMonospaced Identifier
|
148
|
+
highlight link asciidocQuotedEmphasized Type
|
145
149
|
highlight link asciidocQuotedMonospaced2 Identifier
|
146
|
-
highlight link
|
150
|
+
highlight link asciidocQuotedMonospaced Identifier
|
147
151
|
highlight link asciidocQuotedSingleQuoted Label
|
148
|
-
highlight link
|
149
|
-
highlight link
|
150
|
-
highlight link
|
151
|
-
highlight link
|
152
|
-
highlight link
|
153
|
-
highlight link
|
154
|
-
highlight link asciidocAttributeEntry Special
|
155
|
-
highlight link asciidocBackslash Special
|
156
|
-
highlight link asciidocEntityRef Special
|
157
|
-
highlight link asciidocCallout Label
|
158
|
-
highlight link asciidocLineBreak Special
|
152
|
+
highlight link asciidocQuotedSubscript Type
|
153
|
+
highlight link asciidocQuotedSuperscript Type
|
154
|
+
highlight link asciidocQuotedUnconstrainedBold Special
|
155
|
+
highlight link asciidocQuotedUnconstrainedEmphasized Type
|
156
|
+
highlight link asciidocQuotedUnconstrainedMonospaced Identifier
|
157
|
+
highlight link asciidocRefMacro Macro
|
159
158
|
highlight link asciidocRuler Type
|
160
|
-
highlight link
|
159
|
+
highlight link asciidocSidebarDelimiter Type
|
160
|
+
highlight link asciidocTableBlock2 NONE
|
161
|
+
highlight link asciidocTableBlock NONE
|
162
|
+
highlight link asciidocTableDelimiter2 Label
|
163
|
+
highlight link asciidocTableDelimiter Label
|
164
|
+
highlight link asciidocTable_OLD Type
|
165
|
+
highlight link asciidocTablePrefix2 Label
|
166
|
+
highlight link asciidocTablePrefix Label
|
167
|
+
highlight link asciidocToDo Todo
|
168
|
+
highlight link asciidocTriplePlusPassthrough Special
|
169
|
+
highlight link asciidocTwoLineTitle Title
|
161
170
|
highlight link asciidocURL Macro
|
162
|
-
|
163
171
|
let b:current_syntax = "asciidoc"
|
164
172
|
|
165
173
|
" vim: wrap et sw=2 sts=2:
|