summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2008-11-07 11:46:58 +0000
committermurphy <murphy@rubychan.de>2008-11-07 11:46:58 +0000
commitbca06f1ec361537c4c7f1368ca8838be2940dafe (patch)
treee9c4d15d4e6cc8bb0978cbe306b668eea94eb8f7
parent3d8ad7f53879f4f7c31c3ad16beb547f74711465 (diff)
downloadcoderay-bca06f1ec361537c4c7f1368ca8838be2940dafe.tar.gz
Improved YAML Scanner (ticket #34).
* Added more YAML example files (website, database). * Minor code cleanup in Scanner.
-rw-r--r--lib/coderay/scanner.rb4
-rw-r--r--lib/coderay/scanners/yaml.rb42
-rw-r--r--test/scanners/yaml/basic.expected.raydebug710
-rw-r--r--test/scanners/yaml/database.expected.raydebug52
-rw-r--r--test/scanners/yaml/database.in.yml52
-rw-r--r--test/scanners/yaml/faq.expected.raydebug496
-rw-r--r--test/scanners/yaml/gemspec.expected.raydebug12
-rw-r--r--test/scanners/yaml/latex_entities.expected.raydebug62
-rw-r--r--test/scanners/yaml/threshold.expected.raydebug490
-rw-r--r--test/scanners/yaml/website.expected.raydebug70
-rw-r--r--test/scanners/yaml/website.in.yml70
11 files changed, 1164 insertions, 896 deletions
diff --git a/lib/coderay/scanner.rb b/lib/coderay/scanner.rb
index a28f70f..831fc39 100644
--- a/lib/coderay/scanner.rb
+++ b/lib/coderay/scanner.rb
@@ -233,8 +233,8 @@ surrounding code:
tokens.last(10).map { |t| t.inspect }.join("\n"),
line, pos,
matched, state, bol?, eos?,
- string[pos-ambit,ambit],
- string[pos,ambit],
+ string[pos - ambit, ambit],
+ string[pos, ambit],
]
end
diff --git a/lib/coderay/scanners/yaml.rb b/lib/coderay/scanners/yaml.rb
index d24993b..3ecd7e1 100644
--- a/lib/coderay/scanners/yaml.rb
+++ b/lib/coderay/scanners/yaml.rb
@@ -12,14 +12,23 @@ module Scanners
def scan_tokens tokens, options
value_expected = nil
- states = :initial
+ state = :initial
+ indent = 0
until eos?
kind = nil
match = nil
- if match = scan(/\s+/)
+ if bol?
+ indent = matched.size if check(/ +/)
+ # tokens << [indent.to_s, :debug]
+ end
+
+ if match = scan(/ +[\t ]*/)
+ kind = :space
+
+ elsif match = scan(/\n+/)
kind = :space
state = :initial if match.index(?\n)
@@ -27,25 +36,36 @@ module Scanners
kind = :comment
elsif bol? and case
- when scan(/---/)
- kind = :tag
+ when match = scan(/---|\.\.\./)
+ tokens << [:open, :head]
+ tokens << [match, :head]
+ tokens << [:close, :head]
+ next
end
elsif state == :value and case
- when scan(/(?![!*&]).+(?=$|\s+#)/)
+ when !check(/(?:"[^"]*")(?=: |:$)/) && scan(/"/)
+ tokens << [:open, :string]
+ tokens << [matched, :delimiter]
+ tokens << [matched, :content] if scan(/ [^"\\]* (?: \\. [^"\\]* )* /mx)
+ tokens << [matched, :delimiter] if scan(/"/)
+ tokens << [:close, :string]
+ next
+ when scan(/(?![!"*&]).+?(?=$|\s+#)/)
kind = :string
end
elsif case
- when match = scan(/[-:](?= )/)
+ when match = scan(/[-:](?= |$)/)
state = :value if state == :colon && (match == ':' || match == '-')
+ state = :value if state == :initial && match == '-'
kind = :operator
when match = scan(/[,{}\[\]]/)
kind = :operator
- when state == :initial && scan(/\w+(?=:)/)
+ when state == :initial && scan(/[\w.() ]*\S(?=: |:$)/)
kind = :key
state = :colon
- when state == :initial && match = scan(/(?:"[^"]*"|'[^']*')(?=:)/)
+ when match = scan(/(?:"[^"]*"|'[^']*')(?=: |:$)/)
tokens << [:open, :key]
tokens << [match[0,1], :delimiter]
tokens << [match[1..-2], :content]
@@ -64,13 +84,17 @@ module Scanners
kind = :variable
when scan(/\*\w+/)
kind = :global_variable
+ when scan(/<</)
+ kind = :class_variable
when scan(/\d\d:\d\d:\d\d/)
kind = :oct
when scan(/\d\d\d\d-\d\d-\d\d\s\d\d:\d\d:\d\d(\.\d+)? [-+]\d\d:\d\d/)
kind = :oct
when scan(/:\w+/)
kind = :symbol
- when scan(/[^:\s]+/)
+ when scan(/[^:\s]+(:(?! |$)[^:\s]*)* .*/)
+ kind = :string
+ when scan(/[^:\s]+(:(?! |$)[^:\s]*)*/)
kind = :string
# when scan(/>-?/)
# kind = :punct
diff --git a/test/scanners/yaml/basic.expected.raydebug b/test/scanners/yaml/basic.expected.raydebug
index b4f776b..6ffde52 100644
--- a/test/scanners/yaml/basic.expected.raydebug
+++ b/test/scanners/yaml/basic.expected.raydebug
@@ -1,435 +1,435 @@
-tag(---)
+head<head(---)>
key(name)operator(:) string(paragraphs)
key(desc)operator(:) string(Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph.)
key(in)operator(:) string(|-)
- string(A) string(single) string(paragraph.)
+ string(A single paragraph.)
- string(Followed) string(by) string(another.)
+ string(Followed by another.)
key(html)operator(:) string(|-)
- string(<p>A) string(single) string(paragraph.</p>)
- string(<p>Followed) string(by) string(another.</p>)
-tag(---)
+ string(<p>A single paragraph.</p>)
+ string(<p>Followed by another.</p>)
+head<head(---)>
key(name)operator(:) string(block containing block start)
key(in)operator(:) string(|-)
- string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(I saw a ship. It ate my elephant.)
key(html)operator(:) string(|-)
- string(<p>I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.</p>)
-tag(---)
+ string(<p>I saw a ship. It ate my elephant.</p>)
+head<head(---)>
key(name)operator(:) string(extended block containing block start)
key(in)operator(:) string(|-)
- string(p..) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(p.. I saw a ship. It ate my elephant.)
- string(When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you...)
+ string(When the elephant comes to take a p. you...)
key(html)operator(:) string(|-)
- string(<p>I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.</p>)
- string(<p>When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you&#8230;</p>)
-tag(---)
+ string(<p>I saw a ship. It ate my elephant.</p>)
+ string(<p>When the elephant comes to take a p. you&#8230;</p>)
+head<head(---)>
key(name)operator(:) string(blockquote containing block start)
key(in)operator(:) string(|-)
- string(bq.) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(bq. I saw a ship. It ate my elephant.)
key(html)operator(:) string(|-)
string(<blockquote>)
- string(<p>I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.</p>)
+ string(<p>I saw a ship. It ate my elephant.</p>)
string(</blockquote>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(extended blockquote containing block start)
key(in)operator(:) string(|-)
- string(bq..) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(bq.. I saw a ship. It ate my elephant.)
- string(When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you...)
+ string(When the elephant comes to take a p. you...)
key(html)operator(:) string(|-)
string(<blockquote>)
- string(<p>I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.</p>)
- string(<p>When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you&#8230;</p>)
+ string(<p>I saw a ship. It ate my elephant.</p>)
+ string(<p>When the elephant comes to take a p. you&#8230;</p>)
string(</blockquote>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(notextile block containing block start)
key(in)operator(:) string(|-)
- string(notextile.) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(notextile. I saw a ship. It ate my elephant.)
key(html)operator(:) string(|-)
- string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(I saw a ship. It ate my elephant.)
key(valid_html)operator(:) string(false)
-tag(---)
+head<head(---)>
key(name)operator(:) string(extended notextile block containing block start)
key(in)operator(:) string(|-)
- string(notextile..) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(notextile.. I saw a ship. It ate my elephant.)
- string(When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you...)
+ string(When the elephant comes to take a p. you...)
key(html)operator(:) string(|-)
- string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(I saw a ship. It ate my elephant.)
- string(When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you...)
+ string(When the elephant comes to take a p. you...)
key(valid_html)operator(:) string(false)
-tag(---)
+head<head(---)>
key(name)operator(:) string(pre block containing block start)
key(in)operator(:) string(|-)
- string(pre.) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(pre. I saw a ship. It ate my elephant.)
key(html)operator(:) string(|-)
- string(<pre>I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.</pre>)
-tag(---)
+ string(<pre>I saw a ship. It ate my elephant.</pre>)
+head<head(---)>
key(name)operator(:) string(extended pre block containing block start)
key(in)operator(:) string(|-)
- string(pre..) string(I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.)
+ string(pre.. I saw a ship. It ate my elephant.)
- string(When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you...)
+ string(When the elephant comes to take a p. you...)
key(html)operator(:) string(|-)
- string(<pre>I) string(saw) string(a) string(ship.) string(It) string(ate) string(my) string(elephant.</pre>)
+ string(<pre>I saw a ship. It ate my elephant.</pre>)
- string(<pre>When) string(the) string(elephant) string(comes) string(to) string(take) string(a) string(p.) string(you&#8230;</pre>)
- string(---)
+ string(<pre>When the elephant comes to take a p. you&#8230;</pre>)
+ string(--- )
key(name)operator(:) string(html tags)
key(desc)operator(:) string(You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it&#8217;s found in a <code>pre</code> or <code>code</code> block.)
key(in)operator(:) string(|-)
- string(I) string(am) string(<b>very</b>) string(serious.)
+ string(I am <b>very</b> serious.)
string(<pre>)
- string(I) string(am) string(<b>very</b>) string(serious.)
+ string(I am <b>very</b> serious.)
string(</pre>)
key(html)operator(:) string(|-)
- string(<p>I) string(am) string(<b>very</b>) string(serious.</p>)
+ string(<p>I am <b>very</b> serious.</p>)
string(<pre>)
- string(I) string(am) variable(&lt;b&gt;very&lt;/b&gt;) string(serious.)
+ string(I am &lt;b&gt;very&lt;/b&gt; serious.)
string(</pre>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(line breaks)
key(desc)operator(:) string(Line breaks are converted to HTML breaks.)
key(in)operator(:) string(|-)
- string(I) string(spoke.)
- string(And) string(none) string(replied.)
+ string(I spoke.)
+ string(And none replied.)
key(html)operator(:) string(|-)
- string(<p>I) string(spoke.<br) string(/>)
- string(And) string(none) string(replied.</p>)
+ string(<p>I spoke.<br />)
+ string(And none replied.</p>)
key(html_no_breaks)operator(:) string(|-)
- string(<p>I) string(spoke.)
- string(And) string(none) string(replied.</p>)
+ string(<p>I spoke.)
+ string(And none replied.</p>)
key(lite_mode_html)operator(:) string(|-)
- string(I) string(spoke.<br) string(/>)
- string(And) string(none) string(replied.)
-tag(---)
+ string(I spoke.<br />)
+ string(And none replied.)
+head<head(---)>
key(name)operator(:) string(curly quotes)
key(desc)operator(:) string(Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye.)
-key(in)operator(:) string("\\"Observe!\\"")
+key(in)operator(:) string<delimiter(")content(\\"Observe!\\")delimiter(")>
key(html)operator(:) string(<p>&#8220;Observe!&#8221;</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(quotes contained in multi-paragraph quotes)
key(in)operator(:) string(|-)
- string("I) string(first) string(learned) string(about) string(this) string(thing) string(called) string("Redcloth") string(several) string(years) string(ago.)
+ string("I first learned about this thing called "Redcloth" several years ago.)
- string("It's) string(wonderful.")
+ string("It's wonderful.")
key(html)operator(:) string(|-)
- string(<p>&#8220;I) string(first) string(learned) string(about) string(this) string(thing) string(called) variable(&#8220;Redcloth&#8221;) string(several) string(years) string(ago.</p>)
- string(<p>&#8220;It&#8217;s) string(wonderful.&#8221;</p>)
-tag(---)
+ string(<p>&#8220;I first learned about this thing called &#8220;Redcloth&#8221; several years ago.</p>)
+ string(<p>&#8220;It&#8217;s wonderful.&#8221;</p>)
+head<head(---)>
key(name)operator(:) string(double hyphens)
key(desc)operator(:) string(Double hyphens are replaced with an em-dash.)
key(in)operator(:) string(Observe--very nice!)
key(html)operator(:) string(<p>Observe&#8212;very nice!</p>)
-key(latex)operator(:) string("Observe---very nice!\\n\\n")
-tag(---)
+key(latex)operator(:) string<delimiter(")content(Observe---very nice!\\n\\n)delimiter(")>
+head<head(---)>
key(name)operator(:) string(double hyphens with spaces)
key(desc)operator(:) string(Double hyphens are replaced with an em-dash and surrounding spaces are preserved.)
key(in)operator(:) string(Observe -- very nice!)
key(html)operator(:) string(<p>Observe &#8212; very nice!</p>)
-key(latex)operator(:) string("Observe --- very nice!\\n\\n")
-tag(---)
+key(latex)operator(:) string<delimiter(")content(Observe --- very nice!\\n\\n)delimiter(")>
+head<head(---)>
key(name)operator(:) string(parenthetical phrase set off with em dashes)
key(desc)operator(:) string(Sentences with two em dashes should not turn them into strikethroughs)
key(in)operator(:) string(An emdash indicates a parenthetical thought--like this one--which is set apart from the rest of a sentence.)
-key(html)operator(:) string("<p>An emdash indicates a parenthetical thought&#8212;like this one&#8212;which is set apart from the rest of a sentence.</p>")
-key(latex)operator(:) string("An emdash indicates a parenthetical thought---like this one---which is set apart from the rest of a sentence.\\n\\n")
-tag(---)
+key(html)operator(:) string<delimiter(")content(<p>An emdash indicates a parenthetical thought&#8212;like this one&#8212;which is set apart from the rest of a sentence.</p>)delimiter(")>
+key(latex)operator(:) string<delimiter(")content(An emdash indicates a parenthetical thought---like this one---which is set apart from the rest of a sentence.\\n\\n)delimiter(")>
+head<head(---)>
key(name)operator(:) string(parenthetical phrase set off with em dashes surrounded by spaces)
key(desc)operator(:) string(Sentences with two em dashes should not turn them into strikethroughs)
key(in)operator(:) string(An emdash indicates a parenthetical thought -- like this one -- which is set apart from the rest of a sentence.)
-key(html)operator(:) string("<p>An emdash indicates a parenthetical thought &#8212; like this one &#8212; which is set apart from the rest of a sentence.</p>")
-key(latex)operator(:) string("An emdash indicates a parenthetical thought --- like this one --- which is set apart from the rest of a sentence.\\n\\n")
-tag(---)
+key(html)operator(:) string<delimiter(")content(<p>An emdash indicates a parenthetical thought &#8212; like this one &#8212; which is set apart from the rest of a sentence.</p>)delimiter(")>
+key(latex)operator(:) string<delimiter(")content(An emdash indicates a parenthetical thought --- like this one --- which is set apart from the rest of a sentence.\\n\\n)delimiter(")>
+head<head(---)>
key(name)operator(:) string(single hyphens with spaces)
key(desc)operator(:) string(Single hyphens are replaced with en-dashes if they are surrounded by spaces.)
key(in)operator(:) string(Observe - tiny and brief.)
key(html)operator(:) string(<p>Observe &#8211; tiny and brief.</p>)
-key(latex)operator(:) string("Observe--tiny and brief.\\n\\n")
-tag(---)
+key(latex)operator(:) string<delimiter(")content(Observe--tiny and brief.\\n\\n)delimiter(")>
+head<head(---)>
key(name)operator(:) string(midword hyphens )
key(desc)operator(:) string(Single hyphens are left alone if not surrounded by spaces.)
key(in)operator(:) string(Observe the nicely-done hyphen.)
key(html)operator(:) string(<p>Observe the nicely-done hyphen.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(ellipses)
key(desc)operator(:) string(Triplets of periods become an ellipsis.)
key(in)operator(:) string(Observe...)
key(html)operator(:) string(<p>Observe&#8230;</p>)
key(lite_mode_html)operator(:) string(Observe&#8230;)
-tag(---)
+head<head(---)>
key(name)operator(:) string(dimension sign)
key(desc)operator(:) string(The letter 'x' becomes a dimension sign when used between digits.)
-key(in)operator(:) string("Observe: 2x3.")
-key(html)operator(:) string("<p>Observe: 2&#215;3.</p>")
-tag(---)
+key(in)operator(:) string<delimiter(")content(Observe: 2x3.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p>Observe: 2&#215;3.</p>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(dimension sign with space after)
-key(in)operator(:) string("The room is 2x3 inches big.")
-key(html)operator(:) string("<p>The room is 2&#215;3 inches big.</p>")
-tag(---)
+key(in)operator(:) string<delimiter(")content(The room is 2x3 inches big.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p>The room is 2&#215;3 inches big.</p>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(dimension sign with spaces)
-key(in)operator(:) string("Observe: 2 x 4.")
-key(html)operator(:) string("<p>Observe: 2 &#215; 4.</p>")
-tag(---)
+key(in)operator(:) string<delimiter(")content(Observe: 2 x 4.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p>Observe: 2 &#215; 4.</p>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(dimension signs chained)
-key(in)operator(:) string("Observe: 2x3x4.")
-key(html)operator(:) string("<p>Observe: 2&#215;3&#215;4.</p>")
-key(lite_mode_html)operator(:) string("Observe: 2&#215;3&#215;4.")
-tag(---)
+key(in)operator(:) string<delimiter(")content(Observe: 2x3x4.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p>Observe: 2&#215;3&#215;4.</p>)delimiter(")>
+key(lite_mode_html)operator(:) string<delimiter(")content(Observe: 2&#215;3&#215;4.)delimiter(")>
+head<head(---)>
key(name)operator(:) string(dimension signs with double primes)
key(in)operator(:) string('My mouse: 2.5" x 4".')
key(html)operator(:) string('<p>My mouse: 2.5&#8243; &#215; 4&#8243;.</p>')
-tag(---)
+head<head(---)>
key(name)operator(:) string(dimension signs with single primes)
-key(in)operator(:) string("My office: 5' x 4.5'.")
-key(html)operator(:) string("<p>My office: 5&#8242; &#215; 4.5&#8242;.</p>")
-tag(---)
+key(in)operator(:) string<delimiter(")content(My office: 5' x 4.5'.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p>My office: 5&#8242; &#215; 4.5&#8242;.</p>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(trademark and copyright)
key(desc)operator(:) string(Conversion of trademark and copyright symbols.)
key(in)operator(:) string(one(TM\), two(R\), three(C\).)
key(html)operator(:) string(<p>one&#8482;, two&#174;, three&#169;.</p>)
key(lite_mode_html)operator(:) string(one&#8482;, two&#174;, three&#169;.)
-tag(---)
+head<head(---)>
key(name)operator(:) string(headers)
key(desc)operator(:) string(To make an entire paragraph into a Header, place “h<em>n</em>.” at its beginning, where <em>n</em> is a number from 1-6.)
key(in)operator(:) string(h3. Header 3)
key(html)operator(:) string(<h3>Header 3</h3>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(blockquote)
key(desc)operator(:) string(To make an entire paragraph into a block quotation, place “bq.” before it.)
key(in)operator(:) string(|-)
- string(Any) string(old) string(text)
+ string(Any old text)
- string(bq.) string(A) string(block) string(quotation.)
+ string(bq. A block quotation.)
- string(Any) string(old) string(text)
+ string(Any old text)
key(html)operator(:) string(|-)
- string(<p>Any) string(old) string(text</p>)
+ string(<p>Any old text</p>)
string(<blockquote>)
- string(<p>A) string(block) string(quotation.</p>)
+ string(<p>A block quotation.</p>)
string(</blockquote>)
- string(<p>Any) string(old) string(text</p>)
-tag(---)
+ string(<p>Any old text</p>)
+head<head(---)>
key(name)operator(:) string(footnote reference)
key(desc)operator(:) string(Numeric references within text to footnotes appear between square brackets.)
key(in)operator(:) string(This is covered elsewhere[1].)
key(html)operator(:) string(<p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(footnote)
key(desc)operator(:) string(To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote&#8217;s number, followed by a dot and a space.)
key(in)operator(:) string(fn1. Down here, in fact.)
key(html)operator(:) string(<p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(em)
key(desc)operator(:) string(Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as <em>italics</em>.)
key(in)operator(:) string(I _believe_ every word.)
key(html)operator(:) string(<p>I <em>believe</em> every word.</p>)
-key(lite_mode_html)operator(:) string("I <em>believe</em> every word.")
-tag(---)
+key(lite_mode_html)operator(:) string<delimiter(")content(I <em>believe</em> every word.)delimiter(")>
+head<head(---)>
key(name)operator(:) string(strong)
key(desc)operator(:) string(Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as <strong>bold</strong>.)
key(in)operator(:) string(And then? She *fell*!)
key(html)operator(:) string(<p>And then? She <strong>fell</strong>!</p>)
-key(lite_mode_html)operator(:) string("And then? She <strong>fell</strong>!")
-tag(---)
+key(lite_mode_html)operator(:) string<delimiter(")content(And then? She <strong>fell</strong>!)delimiter(")>
+head<head(---)>
key(name)operator(:) string(strong phrase beginning with a number)
key(desc)operator(:) string(A strong phrase at the beginning of a line that begins with a number should not be recognized as a ul with a start value (no such thing\))
-key(in)operator(:) string("*10 times as many*")
-key(html)operator(:) string("<p><strong>10 times as many</strong></p>")
-tag(---)
+key(in)operator(:) string<delimiter(")content(*10 times as many*)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p><strong>10 times as many</strong></p>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(force bold italics)
key(desc)operator(:) string(Both italics and bold can be forced by doubling the underscores or asterisks.)
key(in)operator(:) string(|-)
- string(I) string(__know__.)
- string(I) string(**really**) string(__know__.)
+ string(I __know__.)
+ string(I **really** __know__.)
key(html)operator(:) string(|-)
- string(<p>I) string(<i>know</i>.<br) string(/>)
- string(I) string(<b>really</b>) string(<i>know</i>.</p>)
-tag(---)
+ string(<p>I <i>know</i>.<br />)
+ string(I <b>really</b> <i>know</i>.</p>)
+head<head(---)>
key(name)operator(:) string(citation)
key(desc)operator(:) string(Use double question marks to indicate <em>citation</em>. The title of a book, for instance.)
key(in)operator(:) string(??Cat's Cradle?? by Vonnegut)
key(html)operator(:) string(<p><cite>Cat&#8217;s Cradle</cite> by Vonnegut</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(code phrases)
key(desc)operator(:) string(Code phrases can be surrounded by at-symbols.)
key(in)operator(:) string(Convert with @r.to_html@)
key(html)operator(:) string(<p>Convert with <code>r.to_html</code></p>)
key(lite_mode_html)operator(:) string(Convert with <code>r.to_html</code>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(code phrases not created with multiple email addresses)
key(in)operator(:) string(Please email why@domain.com or jason@domain.com.)
key(html)operator(:) string(<p>Please email why@domain.com or jason@domain.com.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(del)
key(desc)operator(:) string(To indicate a passage which has been deleted, surround the passage with hypens.)
key(in)operator(:) string(I'm -sure- not sure.)
key(html)operator(:) string(<p>I&#8217;m <del>sure</del> not sure.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(ins)
key(desc)operator(:) string(Pluses around a passage indicate its insertion.)
key(in)operator(:) string(You are a +pleasant+ child.)
key(html)operator(:) string(<p>You are a <ins>pleasant</ins> child.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(superscript)
key(desc)operator(:) string(To superscript a phrase, surround with carets.)
key(in)operator(:) string(a ^2^ + b ^2^ = c ^2^)
key(html)operator(:) string(<p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(parenthetical superscript phrase)
key(in)operator(:) string('^(image courtesy NASA\)^')
key(html)operator(:) string('<p><sup>(image courtesy <span class="caps">NASA</span>\)</sup></p>')
-tag(---)
+head<head(---)>
key(name)operator(:) string(subscript)
key(desc)operator(:) string(To subscript, surround with tildes.)
key(in)operator(:) string(log ~2~ x)
key(html)operator(:) string(<p>log <sub>2</sub> x</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(parenthetical subscript phrase)
key(in)operator(:) string('~(image courtesy NASA\)~')
key(html)operator(:) string('<p><sub>(image courtesy <span class="caps">NASA</span>\)</sub></p>')
-tag(---)
+head<head(---)>
key(name)operator(:) string(tight superscript and subscript)
key(desc)operator(:) string(if you want your superscript or subscript to not be surrounded by spaces, you must use square brackets)
key(in)operator(:) string(f(x, n\) = log[~4~]x[^n^])
key(html)operator(:) string('<p>f(x, n\) = log<sub>4</sub>x<sup>n</sup></p>')
-tag(---)
+head<head(---)>
key(name)operator(:) string(span)
key(desc)operator(:) string(Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span.)
key(in)operator(:) string(I'm %unaware% of most soft drinks.)
key(html)operator(:) string(<p>I&#8217;m <span>unaware</span> of most soft drinks.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(style span)
key(desc)operator(:) string(This way, you can apply style settings, as described in the next section to arbitrary phrases.)
key(in)operator(:) string(|-)
- string(I'm) string(%{color)symbol(:red)operator(})string(unaware%)
- string(of) string(most) string(soft) string(drinks.)
+ string(I'm %{color:red}unaware%)
+ string(of most soft drinks.)
key(html)operator(:) string(|-)
- string(<p>I&#8217;m) string(<span) string(style="color)symbol(:red)string(;">unaware</span><br) string(/>)
- string(of) string(most) string(soft) string(drinks.</p>)
+ string(<p>I&#8217;m <span style="color:red;">unaware</span><br />)
+ string(of most soft drinks.</p>)
key(lite_mode_html)operator(:) string(|-)
- string(I&#8217;m) string(<span) string(style="color)symbol(:red)string(;">unaware</span><br) string(/>)
- string(of) string(most) string(soft) string(drinks.)
-tag(---)
+ string(I&#8217;m <span style="color:red;">unaware</span><br />)
+ string(of most soft drinks.)
+head<head(---)>
key(name)operator(:) string(percent sign)
key(desc)operator(:) string(though percent signs indicate a span, they shouldn't be overly greedy.)
key(in)operator(:) string(|-)
- key(http)error(:)string(//blah.com/one%20two%20three)
+ string(http://blah.com/one%20two%20three)
string((min\)5%-95%(max\))
key(html)operator(:) string(|-)
- string(<p>http)error(:)string(//blah.com/one%20two%20three<br) string(/>)
+ string(<p>http://blah.com/one%20two%20three<br />)
string((min\)5%-95%(max\)</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(css class)
key(desc)operator(:) string(A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block.)
key(in)operator(:) string(p(example1\). An example)
key(html)operator(:) string(<p class="example1">An example</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(css id)
key(desc)operator(:) string(An element ID can be given by prefixing the ID with a pound symbol and using it in place of the class.)
key(in)operator(:) string(p(#big-red\). Red here)
key(html)operator(:) string(<p id="big-red">Red here</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(class and id combined)
key(desc)operator(:) string(Class and ID can be combined by placing the class first.)
key(in)operator(:) string(p(example1#big-red2\). Red here)
key(html)operator(:) string(<p class="example1" id="big-red2">Red here</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(css style)
key(desc)operator(:) string(Style settings can be provided directly by surrounding them in curly braces.)
key(in)operator(:) string(p{color:blue;margin:30px}. Spacey blue)
key(html)operator(:) string(<p style="color:blue;margin:30px;">Spacey blue</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(language designations)
key(desc)operator(:) string(Language designations can be given between angel brackets.)
key(in)operator(:) string(p[fr]. rouge)
key(html)operator(:) string(<p lang="fr">rouge</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(block attributes on phrase modifiers)
key(desc)operator(:) string(All block attributes can be applied to phrases as well by placing them just inside the opening modifier.)
key(in)operator(:) string(|-)
- string(I) string(seriously) string(*{color)symbol(:red)operator(})string(blushed*)
- string(when) string(I) string(_(big\)sprouted_) string(that)
- string(corn) string(stalk) string(from) string(my)
+ string(I seriously *{color:red}blushed*)
+ string(when I _(big\)sprouted_ that)
+ string(corn stalk from my)
string(%[es]cabeza%.)
key(html)operator(:) string(|-)
- string(<p>I) string(seriously) string(<strong) string(style="color)symbol(:red)string(;">blushed</strong><br) string(/>)
- string(when) string(I) string(<em) string(class="big">sprouted</em>) string(that<br) string(/>)
- string(corn) string(stalk) string(from) string(my<br) string(/>)
- string(<span) string(lang="es">cabeza</span>.</p>)
-tag(---)
+ string(<p>I seriously <strong style="color:red;">blushed</strong><br />)
+ string(when I <em class="big">sprouted</em> that<br />)
+ string(corn stalk from my<br />)
+ string(<span lang="es">cabeza</span>.</p>)
+head<head(---)>
key(name)operator(:) string(inline attributes preceded by text are treated as literal)
key(desc)operator(:) string(modifiers must come first, without anything before them)
key(in)operator(:) string(|-)
- string(I) global_variable(*seriously) operator({)key(color)symbol(:red)operator(})string(blushed*)
- string(when) string(I) string(_first) string((big\)sprouted_) string(that)
- string(corn) string(stalk) string(from) string(my)
- string(%grande) operator([)string(es]cabeza%.)
+ string(I *seriously {color:red}blushed*)
+ string(when I _first (big\)sprouted_ that)
+ string(corn stalk from my)
+ string(%grande [es]cabeza%.)
key(html)operator(:) string(|-)
- string(<p>I) string(<strong>seriously) operator({)key(color)symbol(:red)operator(})string(blushed</strong><br) string(/>)
- string(when) string(I) string(<em>first) string((big\)sprouted</em>) string(that<br) string(/>)
- string(corn) string(stalk) string(from) string(my<br) string(/>)
- string(<span>grande) operator([)string(es]cabeza</span>.</p>)
-tag(---)
+ string(<p>I <strong>seriously {color:red}blushed</strong><br />)
+ string(when I <em>first (big\)sprouted</em> that<br />)
+ string(corn stalk from my<br />)
+ string(<span>grande [es]cabeza</span>.</p>)
+head<head(---)>
key(name)operator(:) string(align justified)
key(desc)operator(:) string(Text inside blocks can be aligned in four basic ways.)
key(in)operator(:) string(p<>. justified)
key(html)operator(:) string(<p style="text-align:justify;">justified</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(indentation)
key(desc)operator(:) string(Indentation can also be specified by provide a single left paren for every 1em to the left. A single right paren for every 1em to the right.)
key(in)operator(:) string(p\)\)\). right ident 3em)
key(html)operator(:) string(<p style="padding-right:3em;">right ident 3em</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(indentation and alignment)
key(desc)operator(:) string(Identation may be coupled with alignment.)
key(in)operator(:) string(h2(\)>. Bingo.)
key(html)operator(:) string(<h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(many modifiers combined)
key(desc)operator(:) string(And, furthermore, coupled with language settings and CSS styles.)
key(in)operator(:) string(h3(\)>[no]{color:red}. Bingo)
key(html)operator(:) string(<h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(code blocks)
key(desc)operator(:) string(For example, long code blocks belong between <code>pre</code> and <code>code</code> tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents.)
key(in)operator(:) string(|)
string(<pre>)
string(<code>)
- string(a.gsub!() string(/</,) string('') string(\))
+ string(a.gsub!( /</, '' \))
string(</code>)
string(</pre>)
key(html)operator(:) string(|-)
string(<pre>)
string(<code>)
- string(a.gsub!() string(/&lt;/,) string('') string(\))
+ string(a.gsub!( /&lt;/, '' \))
string(</code>)
string(</pre>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(div tags)
key(desc)operator(:) string(You may also choose to surround sections with <code>div</code> tags to separate your document into sections. <a href="http://www.instiki.org/">Instiki</a> uses this technique to float a sidebar to the right.)
key(in)operator(:) string(|)
- string(<div) string(style="float)symbol(:right)string(;">)
+ string(<div style="float:right;">)
- string(h3.) string(Sidebar)
+ string(h3. Sidebar)
- key<delimiter(")content(Hobix)delimiter(")>symbol(:http)error(:)string(//hobix.com/)
- key<delimiter(")content(Ruby)delimiter(")>symbol(:http)error(:)string(//ruby-lang.org/)
+ string("Hobix":http://hobix.com/)
+ string("Ruby":http://ruby-lang.org/)
string(</div>)
- string(The) string(main) string(text) string(of) string(the) string(page) string(goes) string(here) string(and) string(will) string(stay) string(to) string(the) string(left) string(of) string(the) string(sidebar.)
+ string(The main text of the page goes here and will stay to the left of the sidebar.)
key(html)operator(:) string(|-)
- string(<div) string(style="float)symbol(:right)string(;">)
+ string(<div style="float:right;">)
string(<h3>Sidebar</h3>)
- string(<p><a) string(href="http)error(:)string(//hobix.com/">Hobix</a><br) string(/>)
- string(<a) string(href="http)error(:)string(//ruby-lang.org/">Ruby</a></p>)
+ string(<p><a href="http://hobix.com/">Hobix</a><br />)
+ string(<a href="http://ruby-lang.org/">Ruby</a></p>)
string(</div>)
- string(<p>The) string(main) string(text) string(of) string(the) string(page) string(goes) string(here) string(and) string(will) string(stay) string(to) string(the) string(left) string(of) string(the) string(sidebar.</p>)
-tag(---)
+ string(<p>The main text of the page goes here and will stay to the left of the sidebar.</p>)
+head<head(---)>
key(name)operator(:) string(numbered list)
key(desc)operator(:) string(To make a numbered list, place each item in its own paragraph, preceded by &#8221;#&#8221;.)
key(in)operator(:) string(|-)
@@ -438,11 +438,11 @@ key(in)operator(:) string(|-)
comment(# A third)
key(html)operator(:) string(|-)
string(<ol>)
- string(<li>A) string(first) string(item</li>)
- string(<li>A) string(second) string(item</li>)
- string(<li>A) string(third</li>)
+ string(<li>A first item</li>)
+ string(<li>A second item</li>)
+ string(<li>A third</li>)
string(</ol>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(nested numbered lists)
key(desc)operator(:) string(These lists may be nested by increasing the number of pound symbols preceding child entries.)
key(in)operator(:) string(|-)
@@ -455,262 +455,262 @@ key(in)operator(:) string(|-)
comment(## Protein)
key(html)operator(:) string(|-)
string(<ol>)
- string(<li>Fuel) string(could) key(be)error(:)
+ string(<li>Fuel could be:)
string(<ol>)
string(<li>Coal</li>)
string(<li>Gasoline</li>)
string(<li>Electricity</li>)
string(</ol></li>)
- string(<li>Humans) string(need) key(only)error(:)
+ string(<li>Humans need only:)
string(<ol>)
string(<li>Water</li>)
string(<li>Protein</li>)
string(</ol></li>)
string(</ol>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(bulleted list)
key(desc)operator(:) string(Bulleted lists use an asterisk in place of the pound.)
key(in)operator(:) string(|-)
- string(*) string(A) string(first) string(item)
- string(*) string(A) string(second) string(item)
- string(*) string(A) string(third)
+ string(* A first item)
+ string(* A second item)
+ string(* A third)
key(html)operator(:) string(|-)
string(<ul>)
- string(<li>A) string(first) string(item</li>)
- string(<li>A) string(second) string(item</li>)
- string(<li>A) string(third</li>)
+ string(<li>A first item</li>)
+ string(<li>A second item</li>)
+ string(<li>A third</li>)
string(</ul>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(nested bulleted lists)
key(desc)operator(:) string(These lists may be nested in like manner.)
key(in)operator(:) string(|-)
- string(*) string(Fuel) string(could) key(be)error(:)
- string(**) string(Coal)
- string(**) string(Gasoline)
- string(**) string(Electricity)
- string(*) string(Humans) string(need) key(only)error(:)
- string(**) string(Water)
- string(**) string(Protein)
+ string(* Fuel could be:)
+ string(** Coal)
+ string(** Gasoline)
+ string(** Electricity)
+ string(* Humans need only:)
+ string(** Water)
+ string(** Protein)
key(html)operator(:) string(|-)
string(<ul>)
- string(<li>Fuel) string(could) key(be)error(:)
+ string(<li>Fuel could be:)
string(<ul>)
string(<li>Coal</li>)
string(<li>Gasoline</li>)
string(<li>Electricity</li>)
string(</ul></li>)
- string(<li>Humans) string(need) key(only)error(:)
+ string(<li>Humans need only:)
string(<ul>)
string(<li>Water</li>)
string(<li>Protein</li>)
string(</ul></li>)
string(</ul>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(links)
key(desc)operator(:) string(Basic links are comprised of a phrase which is linked to a <acronym title="Universal Resource Locator">URL</acronym>. Place the descriptive phrase in quotation marks. Follow it immediately by a colon and the URL.)
key(in)operator(:) string(I searched "Google":http://google.com.)
key(html)operator(:) string(<p>I searched <a href="http://google.com">Google</a>.</p>)
key(lite_mode_html)operator(:) string(I searched <a href="http://google.com">Google</a>.)
-tag(---)
+head<head(---)>
key(name)operator(:) string(link aliases)
key(desc)operator(:) string(If you are using the same link several times in your document, or you’d just like to be a tad more organized, you can use a link alias. Place the URL anywhere in your document, beginning with its alias in square brackets. Then, use the alias in place of the URL, using the link format above.)
key(in)operator(:) string(|-)
- string(I) string(am) string(crazy) string(about) key<delimiter(")content(Hobix)delimiter(")>symbol(:hobix)
- string(and) key<delimiter(")content(it's)delimiter(")>symbol(:hobix) string("all")symbol(:hobix) string(I) string(ever)
- key<delimiter(")content(link to)delimiter(")>symbol(:hobix)string(!)
+ string(I am crazy about "Hobix":hobix)
+ string(and "it's":hobix "all":hobix I ever)
+ string("link to":hobix!)
- operator([)string(hobix]http)error(:)string(//hobix.com)
+ operator([)string(hobix]http://hobix.com)
key(html)operator(:) string(|-)
- string(<p>I) string(am) string(crazy) string(about) string(<a) string(href="http)error(:)string(//hobix.com">Hobix</a><br) string(/>)
- string(and) string(<a) string(href="http)error(:)string(//hobix.com">it&#8217;s</a>) string(<a) string(href="http)error(:)string(//hobix.com">all</a>) string(I) string(ever<br) string(/>)
- string(<a) string(href="http)error(:)string(//hobix.com">link) string(to</a>!</p>)
-tag(---)
+ string(<p>I am crazy about <a href="http://hobix.com">Hobix</a><br />)
+ string(and <a href="http://hobix.com">it&#8217;s</a> <a href="http://hobix.com">all</a> I ever<br />)
+ string(<a href="http://hobix.com">link to</a>!</p>)
+head<head(---)>
key(name)operator(:) string(image)
key(desc)operator(:) string(You can embed an image in your Textile document by surrounding its URL with exclamation marks.)
-key(in)operator(:) string("!http://hobix.com/sample.jpg!")
+key(in)operator(:) string<delimiter(")content(!http://hobix.com/sample.jpg!)delimiter(")>
key(html)operator(:) string(<p><img src="http://hobix.com/sample.jpg" alt="" /></p>)
key(lite_mode_html)operator(:) string(<img src="http://hobix.com/sample.jpg" alt="" />)
-tag(---)
+head<head(---)>
key(name)operator(:) string(image title)
key(desc)operator(:) string(A title for the image can also be provided in parens, just before the closing exclamation.)
-key(in)operator(:) string("!openwindow1.gif(Bunny.\)!")
+key(in)operator(:) string<delimiter(")content(!openwindow1.gif(Bunny.\)!)delimiter(")>
key(html)operator(:) string(<p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(image links)
key(desc)operator(:) string(Links can be attached to images with a colon.)
-key(in)operator(:) string("!openwindow1.gif!:http://hobix.com/")
+key(in)operator(:) string<delimiter(")content(!openwindow1.gif!:http://hobix.com/)delimiter(")>
key(html)operator(:) string(<p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(image alignments)
key(desc)operator(:) string(Alignments can be applied as well to images.)
key(in)operator(:) string(|-)
string(!>obake.gif!)
- string(And) string(others) string(sat) string(all) string(round) string(the) string(small)
- string(machine) string(and) string(paid) string(it) string(to) string(sing) string(to) string(them.)
+ string(And others sat all round the small)
+ string(machine and paid it to sing to them.)
key(html)operator(:) string(|-)
- string(<p) string(style="float)symbol(:right)string(;"><img) string(src="obake.gif") string(alt="") string(/></p>)
- string(<p>And) string(others) string(sat) string(all) string(round) string(the) string(small<br) string(/>)
- string(machine) string(and) string(paid) string(it) string(to) string(sing) string(to) string(them.</p>)
-tag(---)
+ string(<p style="float:right;"><img src="obake.gif" alt="" /></p>)
+ string(<p>And others sat all round the small<br />)
+ string(machine and paid it to sing to them.</p>)
+head<head(---)>
key(name)operator(:) string(acronym definitions)
key(desc)operator(:) string(Definitions for acronyms can be provided by following an acronym with its definition in parens.)
key(in)operator(:) string(We use CSS(Cascading Style Sheets\).)
key(html)operator(:) string(<p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p>)
key(lite_mode_html)operator(:) string(We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.)
key(no_span_caps_html)operator(:) string(<p>We use <acronym title="Cascading Style Sheets">CSS</acronym>.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(tables)
key(desc)operator(:) string(Simple tables can be built by separating fields with pipe characters)
key(in)operator(:) string(|-)
- string(|) string(name) string(|) string(age) string(|) string(sex) string(|)
- string(|) string(joan) string(|) string(24) string(|) string(f) string(|)
- string(|) string(archie) string(|) string(29) string(|) string(m) string(|)
- string(|) string(bella) string(|) string(45) string(|) string(f) string(|)
+ string(| name | age | sex |)
+ string(| joan | 24 | f |)
+ string(| archie | 29 | m |)
+ string(| bella | 45 | f |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td>) string(name) string(</td>)
- string(<td>) string(age) string(</td>)
- string(<td>) string(sex) string(</td>)
+ string(<td> name </td>)
+ string(<td> age </td>)
+ string(<td> sex </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(joan) string(</td>)
- string(<td>) string(24) string(</td>)
- string(<td>) string(f) string(</td>)
+ string(<td> joan </td>)
+ string(<td> 24 </td>)
+ string(<td> f </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(archie) string(</td>)
- string(<td>) string(29) string(</td>)
- string(<td>) string(m) string(</td>)
+ string(<td> archie </td>)
+ string(<td> 29 </td>)
+ string(<td> m </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(bella) string(</td>)
- string(<td>) string(45) string(</td>)
- string(<td>) string(f) string(</td>)
+ string(<td> bella </td>)
+ string(<td> 45 </td>)
+ string(<td> f </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(table headers)
key(desc)operator(:) string(Specify header cells by marking them with an underscore and period.)
key(in)operator(:) string(|-)
- string(|_.) string(name) string(|_.) string(age) string(|_.) string(sex) string(|)
- string(|) string(joan) string(|) string(24) string(|) string(f) string(|)
- string(|) string(archie) string(|) string(29) string(|) string(m) string(|)
- string(|) string(bella) string(|) string(45) string(|) string(f) string(|)
+ string(|_. name |_. age |_. sex |)
+ string(| joan | 24 | f |)
+ string(| archie | 29 | m |)
+ string(| bella | 45 | f |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<th>name) string(</th>)
- string(<th>age) string(</th>)
- string(<th>sex) string(</th>)
+ string(<th>name </th>)
+ string(<th>age </th>)
+ string(<th>sex </th>)
string(</tr>)
string(<tr>)
- string(<td>) string(joan) string(</td>)
- string(<td>) string(24) string(</td>)
- string(<td>) string(f) string(</td>)
+ string(<td> joan </td>)
+ string(<td> 24 </td>)
+ string(<td> f </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(archie) string(</td>)
- string(<td>) string(29) string(</td>)
- string(<td>) string(m) string(</td>)
+ string(<td> archie </td>)
+ string(<td> 29 </td>)
+ string(<td> m </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(bella) string(</td>)
- string(<td>) string(45) string(</td>)
- string(<td>) string(f) string(</td>)
+ string(<td> bella </td>)
+ string(<td> 45 </td>)
+ string(<td> f </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(table cell attributes)
key(desc)operator(:) string(The period used above marks the end of a cell’s attributes. Other attributes can be applied as well.)
key(in)operator(:) string(|-)
- string(|_.) string(attribute) string(list) string(|)
- string(|<.) string(align) string(left) string(|)
- string(|>.) string(align) string(right|)
- string(|=.) string(center) string(|)
- string(|<>.) string(justify) string(|)
- string(|^.) string(valign) string(top) string(|)
- string(|~.) string(bottom) string(|)
+ string(|_. attribute list |)
+ string(|<. align left |)
+ string(|>. align right|)
+ string(|=. center |)
+ string(|<>. justify |)
+ string(|^. valign top |)
+ string(|~. bottom |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<th>attribute) string(list) string(</th>)
+ string(<th>attribute list </th>)
string(</tr>)
string(<tr>)
- string(<td) string(style="text-align)symbol(:left)string(;">align) string(left) string(</td>)
+ string(<td style="text-align:left;">align left </td>)
string(</tr>)
string(<tr>)
- string(<td) string(style="text-align)symbol(:right)string(;">align) string(right</td>)
+ string(<td style="text-align:right;">align right</td>)
string(</tr>)
string(<tr>)
- string(<td) string(style="text-align)symbol(:center)string(;">center) string(</td>)
+ string(<td style="text-align:center;">center </td>)
string(</tr>)
string(<tr>)
- string(<td) string(style="text-align)symbol(:justify)string(;">justify) string(</td>)
+ string(<td style="text-align:justify;">justify </td>)
string(</tr>)
string(<tr>)
- string(<td) string(style="vertical-align)symbol(:top)string(;">valign) string(top) string(</td>)
+ string(<td style="vertical-align:top;">valign top </td>)
string(</tr>)
string(<tr>)
- string(<td) string(style="vertical-align)symbol(:bottom)string(;">bottom) string(</td>)
+ string(<td style="vertical-align:bottom;">bottom </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(table colspan)
key(desc)operator(:) string(You can also specify colspans with a backslash, followed by the cell width.)
key(in)operator(:) string(|-)
- string(|\\2.) string(spans) string(two) string(cols) string(|)
- string(|) string(col) string(1) string(|) string(col) string(2) string(|)
+ string(|\\2. spans two cols |)
+ string(| col 1 | col 2 |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(colspan="2">spans) string(two) string(cols) string(</td>)
+ string(<td colspan="2">spans two cols </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(col) string(1) string(</td>)
- string(<td>) string(col) string(2) string(</td>)
+ string(<td> col 1 </td>)
+ string(<td> col 2 </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(table rowspan)
key(desc)operator(:) string(Rowspan is specified by a forward slash, followed by the row height.)
key(in)operator(:) string(|-)
- string(|/3.) string(spans) string(3) string(rows) string(|) string(a) string(|)
- string(|) string(b) string(|)
- string(|) string(c) string(|)
+ string(|/3. spans 3 rows | a |)
+ string(| b |)
+ string(| c |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(rowspan="3">spans) string(3) string(rows) string(</td>)
- string(<td>) string(a) string(</td>)
+ string(<td rowspan="3">spans 3 rows </td>)
+ string(<td> a </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(b) string(</td>)
+ string(<td> b </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(c) string(</td>)
+ string(<td> c </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(block attributes applied to table cells)
key(desc)operator(:) string(All block attributes can be applied to table cells as well.)
-key(in)operator(:) string("|{background:#ddd}. Grey cell|")
+key(in)operator(:) string<delimiter(")content(|{background:#ddd}. Grey cell|)delimiter(")>
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(style="background)error(:)comment(#ddd;">Grey cell</td>)
+ string(<td style="background:#ddd;">Grey cell</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(black attributes applied to a table)
key(desc)operator(:) string(Table-wide attributes can be applied before the first row of the table. On its own line, followed by a period.)
key(in)operator(:) string(|-)
- string(table{border)symbol(:1px) string(solid) string(black}.)
+ string(table{border:1px solid black}.)
string(|This|is|a|row|)
string(|This|is|a|row|)
key(html)operator(:) string(|-)
- string(<table) string(style="border)symbol(:1px) string(solid) string(black;">)
+ string(<table style="border:1px solid black;">)
string(<tr>)
string(<td>This</td>)
string(<td>is</td>)
@@ -724,12 +724,12 @@ key(html)operator(:) string(|-)
string(<td>row</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(black attributes applied to a table row)
key(desc)operator(:) string(Attributes can be applied to a single row by supplying the attribute before the row starts, using a <code>table</code> modifier and following it by a period.)
key(in)operator(:) string(|-)
string(|This|is|a|row|)
- operator({)key(background)error(:)comment(#ddd}. |This|is|grey|row|)
+ operator({)string(background:#ddd}. |This|is|grey|row|)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
@@ -738,134 +738,134 @@ key(html)operator(:) string(|-)
string(<td>a</td>)
string(<td>row</td>)
string(</tr>)
- string(<tr) string(style="background)error(:)comment(#ddd;">)
+ string(<tr style="background:#ddd;">)
string(<td>This</td>)
string(<td>is</td>)
string(<td>grey</td>)
string(<td>row</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(extended block followed by pre block)
key(in)operator(:) string(|-)
- string(div..) string(Just) string(a) string(test.)
+ string(div.. Just a test.)
- string(Second) string(div.)
+ string(Second div.)
- string(pre.) string(A) string(pre) string(block) string(ends) string(it.)
+ string(pre. A pre block ends it.)
key(html)operator(:) string(|-)
- string(<div>Just) string(a) string(test.</div>)
- string(<div>Second) string(div.</div>)
- string(<pre>A) string(pre) string(block) string(ends) string(it.</pre>)
-tag(---)
+ string(<div>Just a test.</div>)
+ string(<div>Second div.</div>)
+ string(<pre>A pre block ends it.</pre>)
+head<head(---)>
key(name)operator(:) string(extended block followed by blockquote)
key(in)operator(:) string(|-)
- string(div..) string(Just) string(a) string(test.)
+ string(div.. Just a test.)
- string(Second) string(div.)
+ string(Second div.)
- string(bq.) string(A) string(blockquote) string(ends) string(it.)
+ string(bq. A blockquote ends it.)
key(html)operator(:) string(|-)
- string(<div>Just) string(a) string(test.</div>)
- string(<div>Second) string(div.</div>)
+ string(<div>Just a test.</div>)
+ string(<div>Second div.</div>)
string(<blockquote>)
- string(<p>A) string(blockquote) string(ends) string(it.</p>)
+ string(<p>A blockquote ends it.</p>)
string(</blockquote>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(extended block followed by block code)
key(in)operator(:) string(|-)
- string(div..) string(Just) string(a) string(test.)
+ string(div.. Just a test.)
- string(Second) string(div.)
+ string(Second div.)
- string(bc.) string(A) string(blockcode) string(ends) string(it.)
+ string(bc. A blockcode ends it.)
key(html)operator(:) string(|-)
- string(<div>Just) string(a) string(test.</div>)
- string(<div>Second) string(div.</div>)
- string(<pre><code>A) string(blockcode) string(ends) string(it.</code></pre>)
-tag(---)
+ string(<div>Just a test.</div>)
+ string(<div>Second div.</div>)
+ string(<pre><code>A blockcode ends it.</code></pre>)
+head<head(---)>
key(name)operator(:) string(extended block followed by notextile block)
key(in)operator(:) string(|-)
- string(div..) string(Just) string(a) string(test.)
+ string(div.. Just a test.)
- string(Second) string(div.)
+ string(Second div.)
- string(notextile.) string(A) string(notextile) string(block) string(ends) string(it.)
+ string(notextile. A notextile block ends it.)
key(html)operator(:) string(|-)
- string(<div>Just) string(a) string(test.</div>)
- string(<div>Second) string(div.</div>)
- string(A) string(notextile) string(block) string(ends) string(it.)
+ string(<div>Just a test.</div>)
+ string(<div>Second div.</div>)
+ string(A notextile block ends it.)
key(valid_html)operator(:) string(false)
-tag(---)
+head<head(---)>
key(name)operator(:) string(simple parentheses)
key(in)operator(:) string(|-)
- string(before) string((in) string(parens\)) string(after)
+ string(before (in parens\) after)
key(html)operator(:) string(|-)
- string(<p>before) string((in) string(parens\)) string(after</p>)
-tag(---)
+ string(<p>before (in parens\) after</p>)
+head<head(---)>
key(name)operator(:) string(parentheses in underscores)
key(in)operator(:) string(|-)
- string(before) string(_(in) string(parens\)_) string(after)
+ string(before _(in parens\)_ after)
key(html)operator(:) string(|-)
- string(<p>before) string(<em>(in) string(parens\)</em>) string(after</p>)
-tag(---)
+ string(<p>before <em>(in parens\)</em> after</p>)
+head<head(---)>
key(name)operator(:) string(parentheses in asterisks)
key(in)operator(:) string(|-)
- string(before) string(*(in) string(parens\)*) string(after)
+ string(before *(in parens\)* after)
key(html)operator(:) string(|-)
- string(<p>before) string(<strong>(in) string(parens\)</strong>) string(after</p>)
-tag(---)
+ string(<p>before <strong>(in parens\)</strong> after</p>)
+head<head(---)>
key(name)operator(:) string(parentheses in underscores in quotes)
key(in)operator(:) string(|-)
- string("before) string(_(in) string(parens\)_) string(after")
+ string("before _(in parens\)_ after")
key(html)operator(:) string(|-)
- string(<p>&#8220;before) string(<em>(in) string(parens\)</em>) string(after&#8221;</p>)
-tag(---)
+ string(<p>&#8220;before <em>(in parens\)</em> after&#8221;</p>)
+head<head(---)>
key(name)operator(:) string(underscores in parentheses)
key(in)operator(:) string(|-)
- string(one) string(_two) string(three_) string((four) string(_five) string(six_\)) string(seven)
+ string(one _two three_ (four _five six_\) seven)
key(html)operator(:) string(|-)
- string(<p>one) string(<em>two) string(three</em>) string((four) string(<em>five) string(six</em>\)) string(seven</p>)
-tag(---)
+ string(<p>one <em>two three</em> (four <em>five six</em>\) seven</p>)
+head<head(---)>
key(name)operator(:) string(underscores in parentheses in quotes)
key(in)operator(:) string(|-)
- string("one) string(_two) string(three_) string((four) string(_five) string(six_\)) string(seven")
+ string("one _two three_ (four _five six_\) seven")
key(html)operator(:) string(|-)
- string(<p>&#8220;one) string(<em>two) string(three</em>) string((four) string(<em>five) string(six</em>\)) string(seven&#8221;</p>)
-tag(---)
+ string(<p>&#8220;one <em>two three</em> (four <em>five six</em>\) seven&#8221;</p>)
+head<head(---)>
key(name)operator(:) string(underscores in parentheses 2)
key(in)operator(:) string(|-)
- string(one) string((two) string(_three) string(four_\)) string(five)
+ string(one (two _three four_\) five)
key(html)operator(:) string(|-)
- string(<p>one) string((two) string(<em>three) string(four</em>\)) string(five</p>)
-tag(---)
+ string(<p>one (two <em>three four</em>\) five</p>)
+head<head(---)>
key(name)operator(:) string(underscores in parentheses in quotes 2)
key(in)operator(:) string(|-)
- string("one) string((two) string(_three) string(four_\)) string(five")
+ string("one (two _three four_\) five")
key(html)operator(:) string(|-)
- string(<p>&#8220;one) string((two) string(<em>three) string(four</em>\)) string(five&#8221;</p>)
-tag(---)
+ string(<p>&#8220;one (two <em>three four</em>\) five&#8221;</p>)
+head<head(---)>
key(name)operator(:) string(caps in parentheses)
key(desc)operator(:) string(Uppercase words of three or more characters that are in parentheses should be recognized as well as those not in parentheses.)
key(in)operator(:) string(IBM or (HAL\))
key(html)operator(:) string(<p><span class="caps">IBM</span> or (<span class="caps">HAL</span>\)</p>)
key(no_span_caps_html)operator(:) string(<p>IBM or (HAL\)</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(phrase modifiers in parentheses)
key(desc)operator(:) string(Inline modifiers are expected to work in parentheses as well.)
key(in)operator(:) string(|-)
- string(__Amanita__s) string(are) string(mushrooms.)
- string(Lungworts) string((__Lobaria__\)) string(are) string(lichens.)
- string(Blah) string(blah) string((normal) string(text) string(**bold**\)) string(blah.)
+ string(__Amanita__s are mushrooms.)
+ string(Lungworts (__Lobaria__\) are lichens.)
+ string(Blah blah (normal text **bold**\) blah.)
key(html)operator(:) string(|-)
- string(<p>__Amanita__s) string(are) string(mushrooms.<br) string(/>)
- string(Lungworts) string((<i>Lobaria</i>\)) string(are) string(lichens.<br) string(/>)
- string(Blah) string(blah) string((normal) string(text) string(<b>bold</b>\)) string(blah.</p>)
-tag(---)
+ string(<p>__Amanita__s are mushrooms.<br />)
+ string(Lungworts (<i>Lobaria</i>\) are lichens.<br />)
+ string(Blah blah (normal text <b>bold</b>\) blah.</p>)
+head<head(---)>
key(name)operator(:) string(square brackets are preserved)
key(in)operator(:) string(|-)
- string(citation) operator([)string("(Berk.\)) string(Hilton"],) string(see)
- operator([)string(Papers) string("blah) string(blah."])
+ string(citation ["(Berk.\) Hilton"], see)
+ operator([)string(Papers "blah blah."])
key(html)operator(:) string(|-)
- string(<p>citation) operator([)variable(&#8220;(Berk.\)) string(Hilton&#8221;],) string(see<br) string(/>)
- operator([)string(Papers) variable(&#8220;blah) string(blah.&#8221;]</p>) \ No newline at end of file
+ string(<p>citation [&#8220;(Berk.\) Hilton&#8221;], see<br />)
+ operator([)string(Papers &#8220;blah blah.&#8221;]</p>) \ No newline at end of file
diff --git a/test/scanners/yaml/database.expected.raydebug b/test/scanners/yaml/database.expected.raydebug
new file mode 100644
index 0000000..3efbba2
--- /dev/null
+++ b/test/scanners/yaml/database.expected.raydebug
@@ -0,0 +1,52 @@
+key(login)operator(:) variable(&login)
+ key(adapter)operator(:) string(mysql)
+ key(host)operator(:) string(localhost)
+ key(socket)operator(:) string(/Applications/MAMP/tmp/mysql/mysql.sock)
+ key(username)operator(:) string(rails)
+ key(password)operator(:)
+
+comment(# A)
+key(development)operator(:) variable(&default)
+ key(database)operator(:) string(a_development)
+ class_variable(<<)operator(:) global_variable(*login)
+
+key(production)operator(:) variable(&production)
+ class_variable(<<)operator(:) global_variable(*default)
+
+key(test)operator(:) variable(&test)
+ key(database)operator(:) string(a_test)
+ class_variable(<<)operator(:) global_variable(*login)
+
+comment(# B)
+key(b_development)operator(:) variable(&b)
+ key(database)operator(:) string(b_development)
+ class_variable(<<)operator(:) global_variable(*login)
+
+key(b_production)operator(:) global_variable(*b)
+
+key(b_test)operator(:)
+ key(database)operator(:) string(b_test)
+ class_variable(<<)operator(:) global_variable(*login)
+
+comment(# C)
+key(c_development)operator(:) variable(&c)
+ key(database)operator(:) string(c_development)
+ class_variable(<<)operator(:) global_variable(*login)
+
+key(c_production)operator(:) global_variable(*c)
+
+key(c_test)operator(:)
+ key(database)operator(:) string(c_test)
+ class_variable(<<)operator(:) global_variable(*login)
+
+comment(# D)
+key(d_development)operator(:) variable(&d)
+ key(database)operator(:) string(d_development)
+ class_variable(<<)operator(:) global_variable(*login)
+
+key(d_production)operator(:) global_variable(*d)
+
+key(d_test)operator(:)
+ key(database)operator(:) string(d_test)
+ class_variable(<<)operator(:) global_variable(*login)
+
diff --git a/test/scanners/yaml/database.in.yml b/test/scanners/yaml/database.in.yml
new file mode 100644
index 0000000..4f3dc31
--- /dev/null
+++ b/test/scanners/yaml/database.in.yml
@@ -0,0 +1,52 @@
+login: &login
+ adapter: mysql
+ host: localhost
+ socket: /Applications/MAMP/tmp/mysql/mysql.sock
+ username: rails
+ password:
+
+# A
+development: &default
+ database: a_development
+ <<: *login
+
+production: &production
+ <<: *default
+
+test: &test
+ database: a_test
+ <<: *login
+
+# B
+b_development: &b
+ database: b_development
+ <<: *login
+
+b_production: *b
+
+b_test:
+ database: b_test
+ <<: *login
+
+# C
+c_development: &c
+ database: c_development
+ <<: *login
+
+c_production: *c
+
+c_test:
+ database: c_test
+ <<: *login
+
+# D
+d_development: &d
+ database: d_development
+ <<: *login
+
+d_production: *d
+
+d_test:
+ database: d_test
+ <<: *login
+
diff --git a/test/scanners/yaml/faq.expected.raydebug b/test/scanners/yaml/faq.expected.raydebug
index 491f335..77b9b30 100644
--- a/test/scanners/yaml/faq.expected.raydebug
+++ b/test/scanners/yaml/faq.expected.raydebug
@@ -1,492 +1,492 @@
-tag(---)
-operator(-) key<delimiter(")content(What is a...)delimiter(")>error(:)
+head<head(---)>
+operator(-) key<delimiter(")content(What is a...)delimiter(")>operator(:)
operator(-) key<delimiter(")content(container?)delimiter(")>operator(:) string(>-)
- string(A) string(_container_) string(is) string(collection) string(of) string(service) string(points) string(and) string(other) string(containers.) string(It)
- string(is) string(used) string(to) string(organize) string(services.) string(Each) string(container) string(has) string(access) string(to) string(all) string(of) string(the)
- string(service) string(points) string(in) string(its) string(ancestor) string(containers.)
+ string(A _container_ is collection of service points and other containers. It)
+ string(is used to organize services. Each container has access to all of the)
+ string(service points in its ancestor containers.)
operator(-) key<delimiter(")content(registry?)delimiter(")>operator(:) string(>-)
- string(A) string(_registry_) string(is) string(a) string(special) string(kind) string(of) string(container) string(that) string(has) string(no) string(parent) string(container.)
- string(It) string(also) string(defines) string(a) string(few) string(services) string((such) string(as) string(the) string(LoggingInterceptor,) string(and)
- string(the) string(various) string(service) string(models) string(and) string(pipeline) string(elements\),) string(so) string(that) string(they) string(are)
- string(available) string(by) string(default) string(to) string(all) string(of) string(the) string(services) string(it) string(contains.)
+ string(A _registry_ is a special kind of container that has no parent container.)
+ string(It also defines a few services (such as the LoggingInterceptor, and)
+ string(the various service models and pipeline elements\), so that they are)
+ string(available by default to all of the services it contains.)
operator(-) key<delimiter(")content(service point?)delimiter(")>operator(:) string(>-)
- string(A) string(_service) string(point_) string(is) string(the) string(definition) string(of) string(a) string(service.) string(Just) string(as) string(a) string(class) string(is) string(the)
- string(definition) string(of) string(an) string(object,) string(and) string(you) string(instantiate) string(an) string(object) string(from) string(a) string(class,) string(so)
- string(do) string(you) string(instantiate) string(services) string(from) string(service) string(points.)
+ string(A _service point_ is the definition of a service. Just as a class is the)
+ string(definition of an object, and you instantiate an object from a class, so)
+ string(do you instantiate services from service points.)
operator(-) key<delimiter(")content(service?)delimiter(")>operator(:) string(>-)
- string(A) string(_service_) string(is) string(the) string(instantiation) string(of) string(a) string(service) string(point.)
+ string(A _service_ is the instantiation of a service point.)
operator(-) key<delimiter(")content(parameterized service?)delimiter(")>operator(:) string(>-)
- string(A) string(_parameterized_) string(service) string(is) string(a) string(service) string(that) string(allows) string(contextual) string(parameters)
- string(to) string(be) string(passed) string(to) string(the) string(service) string(when) string(it) string(is) string(created.) string(Such) string(services) string(are)
- string(typically) string(used) string(in) string(conjunction) string(with) string(the) string(@multiton@) string(service) string(model,) string(but)
- string(the) string(only) string(real) string(requirement) string(is) string(that) string(they) string(_not_) string(be) string(used) string(with) string(a) string(service) string(model)
- string(that) string(does) string(not) string(support) string(multiple) string(parameters) string((like) string(@singleton@) string(or)
+ string(A _parameterized_ service is a service that allows contextual parameters)
+ string(to be passed to the service when it is created. Such services are)
+ string(typically used in conjunction with the @multiton@ service model, but)
+ string(the only real requirement is that they _not_ be used with a service model)
+ string(that does not support multiple parameters (like @singleton@ or)
string(@threaded@\).)
operator(-) key<delimiter(")content(service model?)delimiter(")>operator(:) string(>-)
- string(A) string(_service) string(model_) string(is) string(a) string(description) string(of) string(the) string(lifecycle) string(of) string(a) string(service.) string(By)
- string(default,) string(all) string(services) string(are) string(_singletons_,) string(meaning) string(that) string(every) string(time) string(you) string(ask)
- string(a) string(container) string(for) string(a) string(particular) string(service,) string(you'll) string(get) string(the) string(same) string(object)
- string(instance) string(back.)
+ string(A _service model_ is a description of the lifecycle of a service. By)
+ string(default, all services are _singletons_, meaning that every time you ask)
+ string(a container for a particular service, you'll get the same object)
+ string(instance back.)
- string(There) string(are) string(other) string(service) string(models) string(available,) string(though,) string(including) string("prototype")
- string((which) string(returns) string(a) string(new) string(instance) string(for) string(each) string(request) string(of) string(a) string(service\)) string(and)
- string("deferred") string((which) string(returns) string(a) string(proxy,) string(deferring) string(the) string(instatiation) string(of) string(the)
- string(service) string(itself) string(until) string(a) string(method) string(is) string(invoked) string(on) string(the) string(service\).)
+ string(There are other service models available, though, including "prototype")
+ string((which returns a new instance for each request of a service\) and)
+ string("deferred" (which returns a proxy, deferring the instatiation of the)
+ string(service itself until a method is invoked on the service\). )
operator(-) key<delimiter(")content(interceptor?)delimiter(")>operator(:) string(>-)
- string(An) string(_interceptor_) string(is) string(an) string(object) string(that) string(may) string(be) string(placed) string(between) string(the) string(client) string(and)
- string(a) string(service.) string(Every) string(request) string(to) string(the) string(service) string(is) string(thus) string(_intercepted_) string(by) string(that)
- string(object,) string(which) string(can) string(do) string(operations) string(on) string(the) string(request) string((such) string(as) string(logging\)) string(and) string(may)
- string(even) string(reroute) string(or) string(ignore) string(the) string(request) string(altogether.) string(This) string(provides) string(a) string(kind) string(of)
- string("poor) string(man's) string(AOP",) string(since) string(you) string(can) string(do) string("before",) string("after",) string(and) string("around") string(advice)
- string(on) string(the) string(methods) string(of) string(a) string(service.)
+ string(An _interceptor_ is an object that may be placed between the client and)
+ string(a service. Every request to the service is thus _intercepted_ by that)
+ string(object, which can do operations on the request (such as logging\) and may)
+ string(even reroute or ignore the request altogether. This provides a kind of)
+ string("poor man's AOP", since you can do "before", "after", and "around" advice)
+ string(on the methods of a service.)
- string(Needle) string(comes) string(with) string(one) string(standard) string(interceptor,) string(the) string(LoggingInterceptor.) string(It)
- string(will) string(log) string(a) string(message) string(on) string(method) string(entry) string(and) string(exit,) string(and) string(also) string(when) string(an) string(exception)
- string(is) string(raised.)
+ string(Needle comes with one standard interceptor, the LoggingInterceptor. It)
+ string(will log a message on method entry and exit, and also when an exception)
+ string(is raised.)
operator(-) key<delimiter(")content(pipeline?)delimiter(")>operator(:) string(>-)
- string(In) string(Needle,) string(the) string(_instantiation) string(pipeline_) string(is) string(used) string(to) string(control) string(how) string(and) string(when)
- string(services) string(are) string(instantiated.) string(The) string(_service) string(models_) string(are) string(implemented) string(as)
+ string(In Needle, the _instantiation pipeline_ is used to control how and when)
+ string(services are instantiated. The _service models_ are implemented as)
string(pipelines.)
- string(Just) string(as) string(the) string(_interceptors_) string(are) string(for) string(hooking) string(into) string(method) string(invocations,) string(the)
- string(pipelines) string(are) string(for) string(hooking) string(into) string(service) string(instantiations.) string(Every) string(time) string(a)
- string(service) string(is) string(requested,) string(it's) string(instantiation) string(pipeline) string(is) string(executed.) string(By)
- string(choosing) string(the) string(appropriate) string(kinds) string(of) string(pipeline) string(elements,) string(all) string(of) string(the) string(available)
- string(service) string(models) string(can) string(be) string(implemented) string((prototype,) string(prototype_deferred,)
- string(singleton,) string(singleton_deferred,) string(etc.\).)
+ string(Just as the _interceptors_ are for hooking into method invocations, the)
+ string(pipelines are for hooking into service instantiations. Every time a)
+ string(service is requested, it's instantiation pipeline is executed. By)
+ string(choosing the appropriate kinds of pipeline elements, all of the available)
+ string(service models can be implemented (prototype, prototype_deferred,)
+ string(singleton, singleton_deferred, etc.\).)
-operator(-) key<delimiter(")content(How do I...)delimiter(")>error(:)
+operator(-) key<delimiter(")content(How do I...)delimiter(")>operator(:)
operator(-) key<delimiter(")content(create a new registry?)delimiter(")>operator(:) string(>-)
- string(There) string(are) string(several) string(ways) string(to) string(create) string(a) string(new) string(registry.) string(The) string(simplist) string(is) string(just) string(to)
- string(invoke) string(Registry#new.)
+ string(There are several ways to create a new registry. The simplist is just to)
+ string(invoke Registry#new.)
string(<pre>)
- string(reg) string(=) key(Needle)error(:)symbol(:Registry)string(.new)
+ string(reg = Needle::Registry.new)
string(</pre>)
- string(This) string(will) string(create) string(a) string(new) string(Registry) string(instance.) string(You) string(can) string(also) string(send) string(a) string(block) string(to)
+ string(This will create a new Registry instance. You can also send a block to)
comment(#new, in which case the new registry will be yielded to it:)
string(<pre>)
- string(reg) string(=) key(Needle)error(:)symbol(:Registry)string(.new) string(do) string(|r|)
+ string(reg = Needle::Registry.new do |r|)
string(...)
string(end)
string(</pre>)
- string(There) string(are) string(two) string(other) string(factory) string(methods) string(you) string(can) string(use) string(for) string(creating) string(a) string(Registry)
- string(instance.) string(Both) string(require) string(a) string(block.)
+ string(There are two other factory methods you can use for creating a Registry)
+ string(instance. Both require a block.)
string(<pre>)
- string(r1) string(=) key(Needle)error(:)symbol(:Registry)string(.define) string(do) string(|builder|)
+ string(r1 = Needle::Registry.define do |builder|)
string(...)
string(end)
- string(r2) string(=) key(Needle)error(:)symbol(:Registry)string(.define!) string(do)
+ string(r2 = Needle::Registry.define! do)
string(...)
string(end)
string(</pre>)
- string(Registry#define) string(creates) string(a) string("builder") string(object) string(that) string(you) string(can) string(use) string(define)
- string(services) string(more) string(conveniently.) string(Register#define!) string((with) string(a) string(bang\)) string(does) string(the) string(same)
- string(thing,) string(but) string(evaluates) string(the) string(block) string(within) string(the) string(context) string(of) string(the) string(builder.)
+ string(Registry#define creates a "builder" object that you can use define)
+ string(services more conveniently. Register#define! (with a bang\) does the same)
+ string(thing, but evaluates the block within the context of the builder.)
operator(-) key<delimiter(")content(register a service?)delimiter(")>operator(:) string(>-)
- string(The) string(first) string(way) string(to) string(register) string(a) string(service) string(is) string(by) string(calling) comment(#register on the)
- string(registry) string((or) string(a) string(namespace\))error(:)
+ string(The first way to register a service is by calling #register on the)
+ key(registry (or a namespace\))operator(:)
string(<pre>)
- string(reg.register() symbol(:foo) string(\)) operator({) string(Foo.new) operator(})
+ string(reg.register( :foo \) { Foo.new })
string(</pre>)
- string(The) string((first\)) string(parameter) string(to) comment(#register is the name of the service, and the)
- string(block) string(should) string(return) string(the) string(implementation) string(of) string(the) string(service.) string(If) string(needed,) string(the)
- string(block) string(can) string(accept) string(two) string(parameters--the) string(container) string(that) string(the) string(service) string(is) string(being)
- string(registered) string(with,) string(and) string(an) string(object) string(that) string(represents) string(the) string(service) string(being) string(defined)
- string((called) string(a) string("service) string(point"\))error(:)
+ string(The (first\) parameter to #register is the name of the service, and the)
+ string(block should return the implementation of the service. If needed, the)
+ string(block can accept two parameters--the container that the service is being)
+ string(registered with, and an object that represents the service being defined)
+ string((called a "service point"\):)
string(<pre>)
- string(reg.register() symbol(:foo) string(\)) string(do) string(|container,point|)
- string(Foo.new() string(container[)symbol(:bar)operator(])operator(,) string(point.fullname) string(\))
+ string(reg.register( :foo \) do |container,point|)
+ string(Foo.new( container[:bar], point.fullname \))
string(end)
string(</pre>)
- string(You) string(can) string(also) string(use) string(Container#define) string(and) string(Container#define!) string(to) string(register)
- string(services.) string(These) string(approaches) string(are) string(friendlier) string(if) string(you) string(are) string(needing) string(to) string(register)
- string(several) string(services) string(at) string(once.)
+ string(You can also use Container#define and Container#define! to register)
+ string(services. These approaches are friendlier if you are needing to register)
+ string(several services at once.)
string(<pre>)
- string(reg.define) string(do) string(|builder|)
- string(builder.foo) operator({) string(Foo.new) operator(})
- string(builder.bar) operator({) string(|c,p|) string(Bar.new() string(c[)symbol(:foo)operator(])operator(,) string(p.name) string(\)) operator(})
+ string(reg.define do |builder|)
+ string(builder.foo { Foo.new })
+ string(builder.bar { |c,p| Bar.new( c[:foo], p.name \) })
string(end)
- string(reg.define!) string(do)
- string(baz) operator({) string(|c,p|) string(Baz.new() string(c[)symbol(:bar)operator(])operator(,) string(p.name) string(\)) operator(})
- string(zoom) operator({) string(Buggy.new) operator(})
+ string(reg.define! do)
+ string(baz { |c,p| Baz.new( c[:bar], p.name \) })
+ string(zoom { Buggy.new })
string(end)
string(</pre>)
- string(Container#define) string(yields) string(a) string(new) string("builder") string(object) string(to) string(the) string(block.) string(Messages)
- string(sent) string(to) string(the) string(builder) string(are) string(interpreted) string(as) string(service) string(names,) string(and) string(if) string(a) string(block) string(is)
- string(sent) string(with) string(the) string(message,) string(a) string(new) string(service) string(is) string(registered) string(under) string(that) string(name.)
+ string(Container#define yields a new "builder" object to the block. Messages)
+ string(sent to the builder are interpreted as service names, and if a block is)
+ string(sent with the message, a new service is registered under that name.)
- string(Container#define!) string(does) string(likewise,) string(except) string(it) string(evaluates) string(the) string(block) string(within) string(the)
- string(context) string(of) string(the) string(builder) string(object.)
+ string(Container#define! does likewise, except it evaluates the block within the)
+ string(context of the builder object.)
- string(If) string(you) string(do) string(not) string(pass) string(a) string(block) string(to) comment(#define, it will return the builder object,)
- string(so) string(you) string(could) string(do) string(something) string(like) string(the) string(following) string(if) string(you) string(only) string(need) string(to) string(define)
- string(one) string(or) string(two) key(services)error(:)
+ string(If you do not pass a block to #define, it will return the builder object,)
+ string(so you could do something like the following if you only need to define)
+ key(one or two services)operator(:)
string(<pre>)
- string(reg.define.foo) operator({) string(...) operator(})
+ string(reg.define.foo { ... })
string(</pre>)
- string(Lastly,) string(you) string(can) string(get) string(the) string(builder) string(directly) string(and) string(add) string(services) string(using) key(it)error(:)
+ string(Lastly, you can get the builder directly and add services using it:)
string(<pre>)
- string(builder) string(=) string(reg.builder)
- string(builder.baz) operator({) string(...) operator(})
- string(builder.bar) operator({) string(...) operator(})
+ string(builder = reg.builder)
+ string(builder.baz { ... })
+ string(builder.bar { ... })
string(</pre>)
- string((This) string(last) string(is) string(the) string(same) string(as) string(calling) comment(#define without arguments, but is more)
- string(readable) string(if) string(you) string(intend) string(to) string(use) string(the) string(builder) string(object) string(multiple) string(times.\))
+ string((This last is the same as calling #define without arguments, but is more)
+ string(readable if you intend to use the builder object multiple times.\))
operator(-) key<delimiter(")content(reference a service?)delimiter(")>operator(:) string(>-)
- string(Referencing) string(a) string(service) string(can) string(be) string(done) string(in) string(either) string(of) string(two) string(ways.) string(The) string(first) string(is) string(to)
- string(treat) string(the) string(container) string((i.e.,) string(registry\)) string(as) string(a) string(hash,) string(passing) string(the) string(name) string(of) string(the)
- string(service) string(as) string(an) string(argument) string(to) string(Container#[])error(:)
+ string(Referencing a service can be done in either of two ways. The first is to)
+ string(treat the container (i.e., registry\) as a hash, passing the name of the)
+ string(service as an argument to Container#[]:)
string(<pre>)
- string(svc) string(=) string(registry[)symbol(:foo)operator(])
+ string(svc = registry[:foo])
string(svc.do_something_interesting)
string(</pre>)
- string(A) string(more) string(convenient) string((but) string(slightly) string(more) string(peril-fraught\)) string(approach) string(is) string(to) string(send)
- string(the) string(name) string(of) string(the) string(method) string(to) string(the) string(registry) string(as) string(a) key(message)error(:)
+ string(A more convenient (but slightly more peril-fraught\) approach is to send)
+ key(the name of the method to the registry as a message)operator(:)
string(<pre>)
- string(svc) string(=) string(registry.foo)
+ string(svc = registry.foo)
string(</pre>)
- string(Be) string(aware) string(that) string(this) string(latter) string(approach) string(will) string(only) string(work) string(when) string(the) string(service) string(name)
- string(does) string(not) string(conflict) string(with) string(the) string(name) string(of) string(an) string(existing) string(method) string(on) string(the) string(container.)
- string(For) string(example,) string(if) string(you) string(were) string(to) key(do)error(:)
+ string(Be aware that this latter approach will only work when the service name)
+ string(does not conflict with the name of an existing method on the container.)
+ string(For example, if you were to do:)
string(<pre>)
- string(registry.register() symbol(:hash) string(\)) operator({) string("hello,) string(world") operator(})
- string(p) string(registry.hash)
+ string(registry.register( :hash \) { "hello, world" })
+ string(p registry.hash)
string(</pre>)
- string(You) string(would) string(get) string(the) string(hash) string(value) string(of) string(the) string(registry) string(object,) string(instead) string(of) string(the) string(value)
- string(value) string(of) string(the) string(service) string((which) string(would) string(be) string("hello,) string(world"\).)
+ string(You would get the hash value of the registry object, instead of the value)
+ string(value of the service (which would be "hello, world"\).)
operator(-) key<delimiter(")content(select a service model for a service (i.e., change the default model of lifecycle management\)?)delimiter(")>operator(:) string(>-)
- string(By) string(default,) string(a) string(service) string(will) string(be) string(managed) string(as) string(a) string(singleton,) string(i.e.,) string(every) string(request)
- string(of) string(that) string(service) string(will) string(return) string(the) string(same) string(object) string(instance.) string(This) string(is) string(the)
- string(_singleton_) string(service) string(model.)
+ string(By default, a service will be managed as a singleton, i.e., every request)
+ string(of that service will return the same object instance. This is the)
+ string(_singleton_ service model.)
- string(To) string(select) string(a) string(different) string(service) string(model,) string(pass) string(it) string(as) string(an) string(option) string(when) string(you)
- string(register) string(the) key(service)error(:)
+ string(To select a different service model, pass it as an option when you)
+ key(register the service)operator(:)
string(<pre>)
- string(registry.register() symbol(:foo)operator(,) symbol(:model) string(=>) symbol(:prototype) string(\)) operator({)string(...})
- string(registry.define.bar() symbol(:model) string(=>) symbol(:threaded) string(\)) operator({)string(...})
- string(registry.define!) string(do)
- string(baz() symbol(:model) string(=>) symbol(:singleton_deferred) string(\)) operator({)string(...})
+ string(registry.register( :foo, :model => :prototype \) {...})
+ string(registry.define.bar( :model => :threaded \) {...})
+ string(registry.define! do)
+ string(baz( :model => :singleton_deferred \) {...})
string(...)
string(end)
string(...)
string(</pre>)
operator(-) key<delimiter(")content(create a namespace?)delimiter(")>operator(:) string(>-)
- string(Namespaces) string(allow) string(you) string(to) string(organize) string(your) string(services) string(into) string(hierarchical)
- string(packages.) string(You) string(can) string(create) string(namespaces) string(in) string(a) string(few) string(ways.) string(The) string(first) string((and)
- string(simplest\)) string(is) string(to) string(just) string(call) string(Container#namespace)error(:)
+ string(Namespaces allow you to organize your services into hierarchical)
+ string(packages. You can create namespaces in a few ways. The first (and)
+ string(simplest\) is to just call Container#namespace:)
string(<pre>)
- string(registry.namespace() symbol(:stuff) string(\))
+ string(registry.namespace( :stuff \))
string(</pre>)
- string(This) string(will) string(create) string(a) string(namespace) string(in) string(the) string(registry,) string(called) string(stuff.) string(If) string(you) string(send) string(a)
- string(block) string(as) string(well,) string(the) string(block) string(will) string(be) string(invoked) string((with) string(the) string(new) string(namespace) string(yielded)
- string(to) string(it\)) string(the) string(first) string(time) string(the) string(namespace) string(is) key(requested)error(:)
+ string(This will create a namespace in the registry, called stuff. If you send a)
+ string(block as well, the block will be invoked (with the new namespace yielded)
+ key(to it\) the first time the namespace is requested)operator(:)
string(<pre>)
- string(registry.namespace() symbol(:stuff) string(\)) string(do) string(|ns|)
- string(ns.register() symbol(:foo) string(\)) operator({)string(...})
- string(ns.define.bar) operator({)string(...})
- string(ns.define!) string(do)
- string(baz) operator({)string(...})
- string(buf) operator({)string(...})
+ string(registry.namespace( :stuff \) do |ns|)
+ string(ns.register( :foo \) {...})
+ string(ns.define.bar {...})
+ string(ns.define! do)
+ string(baz {...})
+ string(buf {...})
string(end)
string(end)
string(</pre>)
- string(Because) string(it) string(is) string(so) string(common) string(to) string(immediately) string(define) string(services) string(on) string(the) string(new)
- string(namespace,) string(there) string(are) string(some) string(convenience) string(methods) string(to) string(make) string(this) string(more...)
+ string(Because it is so common to immediately define services on the new)
+ string(namespace, there are some convenience methods to make this more...)
string(convenient.)
string(<pre>)
- string(registry.namespace_define!() symbol(:stuff) string(\)) string(do)
- string(foo) operator({)string(...})
- string(bar) operator({)string(...})
- string(baz) operator({)string(...})
+ string(registry.namespace_define!( :stuff \) do)
+ string(foo {...})
+ string(bar {...})
+ string(baz {...})
string(end)
- string(registry.namespace_define() symbol(:more_stuff) string(\)) string(do) string(|b|)
- string(b.blah) operator({)string(...})
- string(b.argh) operator({)string(...})
- string(b.hack) operator({)string(...})
+ string(registry.namespace_define( :more_stuff \) do |b|)
+ string(b.blah {...})
+ string(b.argh {...})
+ string(b.hack {...})
string(end)
string(</pre>)
- string(The) string(first) string(one,) string(above,) string(creates) string(the) string(namespace) string(and) string(calls) string(Container#define!.)
- string(The) string(second) string(creates) string(the) string(namespace) string(and) string(calls) string(Container#define.) string(In) string(both)
- string(cases,) string(_the) string(namespace) string(is) string(created) string(immediately_,) string(unlike) string(Container#namespace)
- string(which) string(only) string(creates) string(the) string(namespace) string(when) string(it) string(is) string(first) string(requested.)
+ string(The first one, above, creates the namespace and calls Container#define!.)
+ string(The second creates the namespace and calls Container#define. In both)
+ string(cases, _the namespace is created immediately_, unlike Container#namespace)
+ string(which only creates the namespace when it is first requested.)
- string(Lastly,) string(note) string(that) string(namespace's) string(are) string(just) string(special) string(services.) string(Thus,) string(you) string(can)
- string(pass) string(options) string(to) string(the) string(namespace) string(methods) string(just) string(as) string(you) string(can) string(with)
- string(Container#register) string(and) string(friends.)
+ string(Lastly, note that namespace's are just special services. Thus, you can)
+ string(pass options to the namespace methods just as you can with)
+ string(Container#register and friends.)
operator(-) key<delimiter(")content(write log messages?)delimiter(")>operator(:) string(>-)
- string(You) string(can) string(obtain) string(a) string(new) string(logger) string(instance) string(from) string(the) string(@)symbol(:logs)string(@) string(and) string(@)symbol(:log_for)string(@)
- string(services.) string(Once) string(you) string(have) string(a) string(logger) string(instance,) string(you) string(can) string(invoke) string(the) comment(#debug,)
+ string(You can obtain a new logger instance from the @:logs@ and @:log_for@)
+ string(services. Once you have a logger instance, you can invoke the #debug,)
comment(#info, #warn, #error, and #fatal methods on the instance to log messages)
- string(of) string(the) string(corresponding) string(severity.)
+ string(of the corresponding severity.)
string(<pre>)
- string(logger) string(=) string(registry.logs.get() string("a) string(name) string(for) string(my) string(logger") string(\))
- string(logger.debug) string("This) string(is) string(a) string(debug) string(message")
- string(logger.info) string("This) string(is) string(an) string(informational) string(message")
+ string(logger = registry.logs.get( "a name for my logger" \))
+ string(logger.debug "This is a debug message")
+ string(logger.info "This is an informational message")
string(...)
- string(logger2) string(=) string(registry.log_for() string("another) string(logger) string(name") string(\))
+ string(logger2 = registry.log_for( "another logger name" \))
string(...)
string(</pre>)
- string(The) string(two) string(approaches) string(shown) string(above) string(are) string(identical--the) string(second) string(approach) string((using)
- string(the) string(@log_for@) string(service\)) string(is) string(just) string(a) string(convenience) string(for) string(@logs.get@.)
+ string(The two approaches shown above are identical--the second approach (using)
+ string(the @log_for@ service\) is just a convenience for @logs.get@.)
- string(Log) string(messages) string(are) string(written,) string(by) string(default,) string(to) string(a) string(file) string(called) string("needle.log",) string(in)
- string(the) string(same) string(directory) string(that) string(the) string(application) string(was) string(invoked) string(from.)
+ string(Log messages are written, by default, to a file called "needle.log", in)
+ string(the same directory that the application was invoked from.)
- string(You) string(can) string(also) string(use) string(a) string(logging) string(interceptor) string(to) string(automatically) string(log) string(all) string(external)
- string(method) string(invocations) string(on) string(a) string(service.) string(This) string(includes) string(method) string(entry) string(and) string(exit,) string(as)
- string(well) string(as) string(any) string(exceptions) string(that) string(are) string(raised) string(inside) string(the) string(method.)
+ string(You can also use a logging interceptor to automatically log all external)
+ string(method invocations on a service. This includes method entry and exit, as)
+ string(well as any exceptions that are raised inside the method.)
string(<pre>)
- string(registry.register() symbol(:foo) string(\)) operator({) string(...) operator(})
- string(registry.intercept() symbol(:foo) string(\).with) operator({) string(|r|) string(r.logging_interceptor) operator(})
+ string(registry.register( :foo \) { ... })
+ string(registry.intercept( :foo \).with { |r| r.logging_interceptor })
string(foo.something)
- string(foo.another_method() string(1,) string(2,) string(3) string(\))
+ string(foo.another_method( 1, 2, 3 \))
string(</pre>)
- string(See) string(the) string(chapter) string(in) string(the) key<delimiter(")content(User's Manual)delimiter(")>symbol(:http)error(:)string(//needle.rubyforge.org) string(about)
- string(logging) string(for) string(more) string(information) string(on) string(how) string(to) string(use) string(and) string(configure) string(loggers.)
+ string(See the chapter in the "User's Manual":http://needle.rubyforge.org about)
+ string(logging for more information on how to use and configure loggers.)
operator(-) key<delimiter(")content(exclude methods from being intercepted?)delimiter(")>operator(:) string(>-)
- string(Only) string(interceptors) string(that) string(explicitly) string(support) string(exclusion) string(of) string(methods) string(can) string(help)
- string(you) string(here.) string(Fortunately,) string(the) string(LoggingInterceptor) string(is) string(one) string(of) string(them.) string((If) string(you)
- string(write) string(your) string(own) string(interceptor) string(and) string(would) string(like) string(similar) string(functionality,) string(see) string(the)
- string(IncludeExclude) string(module.\))
+ string(Only interceptors that explicitly support exclusion of methods can help)
+ string(you here. Fortunately, the LoggingInterceptor is one of them. (If you)
+ string(write your own interceptor and would like similar functionality, see the)
+ string(IncludeExclude module.\))
- string(In) string(the) string(case) string(of) string(the) string(LoggingInterceptor,) string(just) string(pass) string(an) string(array) string(of) string(patterns)
- string((matching) string(method) string(names) string(and/or) string(arities\)) string(as) string(the) string("exclude") string(option,) string(when)
- string(declaring) string(the) key(interceptor)error(:)
+ string(In the case of the LoggingInterceptor, just pass an array of patterns)
+ string((matching method names and/or arities\) as the "exclude" option, when)
+ key(declaring the interceptor)operator(:)
string(<pre>)
- string(registry.register() symbol(:foo) string(\)) operator({) string(...) operator(})
- string(registry.intercept() symbol(:foo) string(\).)
- string(with) operator({) string(|r|) string(r.logging_interceptor) operator(})string(.)
- string(with_options) symbol(:exclude) string(=>) operator([) string('foo',) string('bar(>4\)',) string('*(<2\)') operator(])
+ string(registry.register( :foo \) { ... })
+ string(registry.intercept( :foo \).)
+ string(with { |r| r.logging_interceptor }.)
+ string(with_options :exclude => [ 'foo', 'bar(>4\)', '*(<2\)' ])
string(</pre>)
- string(The) string(above) string(will) string(exclude) string(from) string(interception) string(any) string(method) string(named) string('foo',) string(or) string(any)
- string(invocation) string(of) string('bar') string(with) string(more) string(than) string(4) string(arguments,) string(or) string(any) string(method) string(invocation)
- string(with) string(fewer) string(than) string(two) string(arguments.)
+ string(The above will exclude from interception any method named 'foo', or any)
+ string(invocation of 'bar' with more than 4 arguments, or any method invocation)
+ string(with fewer than two arguments.)
- string(You) string(can) string(also) string(give) string(an) string(array) string(of) string(patterns) string(to) string(_include_.) string(These) string(cause) string(methods)
- string(to) string(be) string(explicitly) string(intercepted) string(even) string(if) string(they) string(match) string(an) string(exclude) key(pattern)error(:)
+ string(You can also give an array of patterns to _include_. These cause methods)
+ key(to be explicitly intercepted even if they match an exclude pattern)operator(:)
string(<pre>)
- string(registry.register() symbol(:foo) string(\)) operator({) string(...) operator(})
- string(registry.intercept() symbol(:foo) string(\).)
- string(with) operator({) string(|r|) string(r.logging_interceptor) operator(})string(.)
- string(with_options) symbol(:exclude) string(=>) operator([) string('foo',) string('bar(>4\)',) string('*(<2\)') operator(])operator(,)
- symbol(:include) string(=>) operator([) string('baz') operator(])
+ string(registry.register( :foo \) { ... })
+ string(registry.intercept( :foo \).)
+ string(with { |r| r.logging_interceptor }.)
+ string(with_options :exclude => [ 'foo', 'bar(>4\)', '*(<2\)' ],)
+ symbol(:include) string(=> [ 'baz' ])
- string(foo) string(=) string(registry.foo)
+ string(foo = registry.foo)
string(foo.baz)
string(</pre>)
- string(This) string(would) string(result) string(in) string(the) string(call) string(to) comment(#baz being intercepted, even though it)
- string(matches) string(an) string(exclude) string(pattern) string((@*(<2\)@\).)
+ string(This would result in the call to #baz being intercepted, even though it)
+ string(matches an exclude pattern (@*(<2\)@\).)
operator(-) key<delimiter(")content(include services defined in another library?)delimiter(")>operator(:) string(>-)
- string(This) string(requires) string(that) string(the) string(other) string(library) string(be) string(implemented) string(in) string(such) string(a) string(way) string(that) string(it)
- string(expects) string(to) string(be) string("included") string(by) string(other) string(libraries/applications.) string(For) string(example,)
- string(Needle) string(encourages) string(the) string(use) string(of) string(a) string(method) string(called) string(@register_services@,) string(which)
- string(accepts) string(a) string(container) string(as) string(a) key(parameter)error(:)
+ string(This requires that the other library be implemented in such a way that it)
+ string(expects to be "included" by other libraries/applications. For example,)
+ string(Needle encourages the use of a method called @register_services@, which)
+ key(accepts a container as a parameter)operator(:)
string(<pre>)
- string(module) string(A)
- string(module) string(B)
- string(def) string(register_services() string(container) string(\))
+ string(module A)
+ string(module B)
+ string(def register_services( container \))
string(...)
string(end)
- string(module_function) symbol(:register_services)
+ string(module_function :register_services)
string(end)
string(end)
string(</pre>)
- string(If) string(the) string(library) string(has) string(been) string(implemented) string(in) string(this) string(way,) string(you) string(can) string(simply) string(do) string(a)
- string(require) string(of) string(the) string(library) string(and) string(then) string(invoke) string(the) string(@register_services@) string(method.)
+ string(If the library has been implemented in this way, you can simply do a)
+ string(require of the library and then invoke the @register_services@ method.)
- string(There) string(is) string(a) string(convenience) string(method) string(in) string(Container) string(for) string(doing) string(this.) string(Just) string(call)
- string(Container#require,) string(passing) string(the) string(file) string(to) string(require) string(and) string(a) string(string) string((or) string(symbol\))
- string(identifying) string(the) string(name) string(of) string(the) string(module) string(that) string(contains) string(the) string(registration) string(method.)
- string(You) string(can) string(also) string(pass) string(a) string(symbol) string(as) string(the) string(third) string(parameter) string(naming) string(the) string(registration)
- string(method,) string(but) string(it) string(defaults) string(to) string(@)symbol(:register_services)string(@.)
+ string(There is a convenience method in Container for doing this. Just call)
+ string(Container#require, passing the file to require and a string (or symbol\))
+ string(identifying the name of the module that contains the registration method.)
+ string(You can also pass a symbol as the third parameter naming the registration)
+ string(method, but it defaults to @:register_services@.)
string(<pre>)
- string(require) string('a/b')
- key(A)error(:)symbol(:B)string(.register_services() string(container) string(\))
+ string(require 'a/b')
+ string(A::B.register_services( container \))
comment(# or)
- string(container.require() string('a/b',) string("A)error(:)symbol(:B)string(") string(\))
+ string(container.require( 'a/b', "A::B" \))
string(</pre>)
- string(The) string(definition) string(context) string((i.e.,) string(the) string("builder") string(object\)) string(also) string(supports) string(the)
- string(require) string(method,) string(so) string(you) string(can) key(do)error(:)
+ string(The definition context (i.e., the "builder" object\) also supports the)
+ string(require method, so you can do:)
string(<pre>)
- string(container.define) string(do) string(|b|)
- string(b.require) string("a/b",) string("A)error(:)symbol(:B)string(")
- string(b.foo) operator({) string(...) operator(})
+ string(container.define do |b|)
+ string(b.require "a/b", "A::B")
+ string(b.foo { ... })
string(...)
string(end)
string(</pre>)
-operator(-) key<delimiter(")content(When should I...)delimiter(")>error(:)
- operator(-) key<delimiter(")content(use a different service model?)delimiter(")>error(:)
+operator(-) key<delimiter(")content(When should I...)delimiter(")>operator(:)
+ operator(-) key<delimiter(")content(use a different service model?)delimiter(")>operator(:)
operator(-) key<delimiter(")content(Like, :prototype?)delimiter(")>operator(:) string(>-)
- string(The) string(prototype) string(service) string(model) string(is) string(appropriate) string(when) string(the) key(service)error(:)
+ key(The prototype service model is appropriate when the service)operator(:)
- string(*) string(has) string(internal) string(state)
+ string(* has internal state)
- string(*) string(will) string(be) string(used) string(multiple) string(times) string(for) string(different) string(situations)
+ string(* will be used multiple times for different situations)
- string(For) string(example,) string(if) string(you) string(have) string(a) string(GUI) string(library,) string(a) string("button") string(service) string(could) string(be) string(a)
- string(prototype,) string(because) string(you) string(will) string(likely) string(have) string(many) string(buttons) string(in) string(an) string(application,)
- string(with) string(each) string(button) string(being) string(an) string(independent) string(instance.)
+ string(For example, if you have a GUI library, a "button" service could be a)
+ string(prototype, because you will likely have many buttons in an application,)
+ string(with each button being an independent instance.)
operator(-) key<delimiter(")content(Like, :singleton?)delimiter(")>operator(:) string(>-)
- string(The) string(singleton) string(service) string(model) string(is) string(the) string(default,) string(so) string(you) string(should) string(rarely) string(need)
- string(to) string(explicitly) string(specify) string(it) string(as) string(a) string(model.) string(It) string(is) string(appropriate) string(for) string(services)
- key(that)error(:)
+ string(The singleton service model is the default, so you should rarely need)
+ string(to explicitly specify it as a model. It is appropriate for services)
+ key(that)operator(:)
- string(*) string(guard) string(some) string(specific) string(functionality)
+ string(* guard some specific functionality)
- string(*) string(represent) string(state) string(that) string(is) string(global) string(across) string(an) string(application)
+ string(* represent state that is global across an application)
operator(-) key<delimiter(")content(Like, :threaded?)delimiter(")>operator(:) string(>-)
- string(Threaded) string(is) string(similar) string(to) string(singleton,) string(but) string(it) string(allows) string(one) string(unique) string(instance) string(of)
- string(the) string(service) string(_per) string(thread_.) string(Thus,) string(it) string(is) string(appropriate) string(to) string(the) string(same)
- string(situations) string(as) string(singleton,) string(but) string(specific) string(to) string(a) string(thread,) string(instead) string(of) string(an)
- string(application.) string(This) string(is) string(useful) string(for) string(web) string(applications) string(that) string(are) string(run) string(in) string(a)
- string(single) string(virtual) string(machine,) string(and) string(which) string(share) string(a) string(single) string(registry.)
+ string(Threaded is similar to singleton, but it allows one unique instance of)
+ string(the service _per thread_. Thus, it is appropriate to the same)
+ string(situations as singleton, but specific to a thread, instead of an)
+ string(application. This is useful for web applications that are run in a)
+ string(single virtual machine, and which share a single registry.)
operator(-) key<delimiter(")content(Like, deferred?)delimiter(")>operator(:) string(>-)
- string(Deferred) string(models) string(use) string(a) string(proxy) string(to) string(enforce) string(lazy) string(initialization) string(of) string(the)
- string(service.) string(A) string(service) string(using) string(a) string(deferred) string(service) string(model) string((ie,)
- string(@)symbol(:prototype_deferred)string(@,) string(@)symbol(:multiton_deferred)string(@,) string(@)symbol(:singleton_deferred)string(@,) string(or)
- string(@)symbol(:threaded_deferred)string(@\)) string(will) string(not) string(be) string(instantiated) string(until) string(the) string(first) string(time) string(a)
- string(method) string(is) string(invoked) string(on) string(the) string(service.)
+ string(Deferred models use a proxy to enforce lazy initialization of the)
+ string(service. A service using a deferred service model (ie,)
+ string(@:prototype_deferred@, @:multiton_deferred@, @:singleton_deferred@, or)
+ string(@:threaded_deferred@\) will not be instantiated until the first time a)
+ string(method is invoked on the service.)
- string(This) string(makes) string(a) string(deferred) string(model) string(appropriate) string(when) string(a) string(service) string(is) string(expensive) string(to)
- string(instantiate,) string(since) string(you) string(can) string(wait) string(to) string(do) string(the) string(expensive) string(initialization)
- string(until) string(it) string(is) string(really) string(needed.) string(Applications) string(will) string(start) string(up) string(faster) string(when) string(their)
- string(dependences) string(use) string(deferred) string(instantiation.)
+ string(This makes a deferred model appropriate when a service is expensive to)
+ string(instantiate, since you can wait to do the expensive initialization)
+ string(until it is really needed. Applications will start up faster when their)
+ string(dependences use deferred instantiation.)
operator(-) key<delimiter(")content(Like, initialize?)delimiter(")>operator(:) string(>-)
- string(This) string(is) string(useful) string(when) string(you) string(have) string(a) string(method) string(that) string(you) string(want) string(to) string(be) string(invoked)
- string(automatically) string(after) string(a) string(service) string(has) string(been) string(instantiated.) string(Consider) string(the) string(case)
- string(where) string(a) string(service) string(is) string(initialized) string(primarily) string(using) string(setters,) string(but) string(requires)
- string(some) string(logic) string(to) string(be) string(executed) string(to) string(complete) string(the) string(initialization) string(phase.) string(In) string(this)
- string(case,) string(you) string(could) string(always) string(explicitly) string(invoke) string(the) string(initialization) string(method(s\))
- string(in) string(the) string(constructor) string(block,) string(but) string(if) string(many) string(services) string(use) string(the) string(same)
- string(initialization) string(method,) string(it) string(can) string(be) string(more) string(convenient) string(to) string(use) string(an) string("initialize")
- string(service) string(model.)
+ string(This is useful when you have a method that you want to be invoked)
+ string(automatically after a service has been instantiated. Consider the case)
+ string(where a service is initialized primarily using setters, but requires)
+ string(some logic to be executed to complete the initialization phase. In this)
+ string(case, you could always explicitly invoke the initialization method(s\))
+ string(in the constructor block, but if many services use the same)
+ string(initialization method, it can be more convenient to use an "initialize")
+ string(service model.)
operator(-) key<delimiter(")content(Like, multiton?)delimiter(")>operator(:) string(>-)
- string(Multitons) string(are) string(useful) string(for) string(factories,) string(where) string(you) string(have) string(a) string(class) string(that)
- string(differentiates) string(its) string(instances) string(based) string(on) string(some) string(construction) string(parameters) string(that)
- string(need) string(to) string(be) string(determined) string(at) string(runtime.) string(Thus,) string(multitons) string(are) string(always) string(used) string(with)
- string(parameterized) string(services.)
+ string(Multitons are useful for factories, where you have a class that)
+ string(differentiates its instances based on some construction parameters that)
+ string(need to be determined at runtime. Thus, multitons are always used with)
+ string(parameterized services.)
diff --git a/test/scanners/yaml/gemspec.expected.raydebug b/test/scanners/yaml/gemspec.expected.raydebug
index 11cf53f..ec76cf9 100644
--- a/test/scanners/yaml/gemspec.expected.raydebug
+++ b/test/scanners/yaml/gemspec.expected.raydebug
@@ -1,4 +1,4 @@
-tag(---) type(!ruby/object)operator(:)class(Gem::Specification)
+head<head(---)> type(!ruby/object)operator(:)class(Gem::Specification)
key(name)operator(:) string(coderay)
key(version)operator(:) type(!ruby/object)operator(:)class(Gem::Version)
key(version)operator(:) string(0.7.9.257)
@@ -13,7 +13,7 @@ key(date)operator(:) string(2008-09-24 00:00:00 +02:00)
key(default_executable)operator(:)
key(dependencies)operator(:) string([])
-key(description)operator(:) string("CodeRay is a Ruby library for syntax highlighting. I try to make CodeRay easy to use and intuitive, but at the same time fully featured, complete, fast and efficient. Usage is simple: require 'coderay' code = 'some %q(weird (Ruby\) can't shock\) me!' puts CodeRay.scan(code, :ruby\).html")
+key(description)operator(:) string<delimiter(")content(CodeRay is a Ruby library for syntax highlighting. I try to make CodeRay easy to use and intuitive, but at the same time fully featured, complete, fast and efficient. Usage is simple: require 'coderay' code = 'some %q(weird (Ruby\) can't shock\) me!' puts CodeRay.scan(code, :ruby\).html)delimiter(")>
key(email)operator(:) string(murphy@cYcnus.de)
key(executables)operator(:)
operator(-) string(coderay)
@@ -84,20 +84,20 @@ key(rdoc_options)operator(:)
operator(-) string(-SNw2)
operator(-) string(-mREADME)
operator(-) string(-a)
-operator(-) string(-t) string(CodeRay) string(Documentation)
+operator(-) string(-t CodeRay Documentation)
key(require_paths)operator(:)
operator(-) string(lib)
key(required_ruby_version)operator(:) type(!ruby/object)operator(:)class(Gem::Requirement)
key(requirements)operator(:)
- operator(-) operator(-) string(">=")
+ operator(-) string(- ">=")
operator(-) type(!ruby/object)operator(:)class(Gem::Version)
key(version)operator(:) string(1.8.2)
key(version)operator(:)
key(required_rubygems_version)operator(:) type(!ruby/object)operator(:)class(Gem::Requirement)
key(requirements)operator(:)
- operator(-) operator(-) string(">=")
+ operator(-) string(- ">=")
operator(-) type(!ruby/object)operator(:)class(Gem::Version)
- key(version)operator(:) string("0")
+ key(version)operator(:) string<delimiter(")content(0)delimiter(")>
key(version)operator(:)
key(requirements)operator(:)
operator(-) string(strscan)
diff --git a/test/scanners/yaml/latex_entities.expected.raydebug b/test/scanners/yaml/latex_entities.expected.raydebug
index 9e4ffd2..5533c54 100644
--- a/test/scanners/yaml/latex_entities.expected.raydebug
+++ b/test/scanners/yaml/latex_entities.expected.raydebug
@@ -1,6 +1,6 @@
comment(# based on "SGML/XML character entity reference" at http://www.bitjungle.com/isoent/)
comment(#)
-tag(---)
+head<head(---)>
comment(#EM SPACE)
key(emsp)operator(:) string(\\hspace{1em})
comment(#EM SPACE)
@@ -32,7 +32,7 @@ key(ndash)operator(:) string(--)
comment(#EN DASH)
key<delimiter(")content(8211)delimiter(")>operator(:) string(--)
comment(#HYPHEN)
-key<delimiter(")content(8208)delimiter(")>operator(:) string("-")
+key<delimiter(")content(8208)delimiter(")>operator(:) string<delimiter(")content(-)delimiter(")>
comment(#OPEN BOX)
key<delimiter(")content(9251)delimiter(")>operator(:) string(\\textvisiblespace{})
comment(#HORIZONTAL ELLIPSIS)
@@ -58,7 +58,7 @@ key<delimiter(")content(8537)delimiter(")>operator(:) string(\\sfrac{1}{6})
comment(#VULGAR FRACTION FIVE SIXTHS)
key<delimiter(")content(8538)delimiter(")>operator(:) string(\\sfrac{5}{6})
comment(#CARE OF)
-key<delimiter(")content(8453)delimiter(")>operator(:) string("{^c\\\\!/\\\\!_o}")
+key<delimiter(")content(8453)delimiter(")>operator(:) string<delimiter(")content({^c\\\\!/\\\\!_o})delimiter(")>
comment(#FULL BLOCK)
key<delimiter(")content(9608)delimiter(")>operator(:) string(\\block{})
comment(#UPPER HALF BLOCK)
@@ -174,10 +174,10 @@ comment(#CARET)
key<delimiter(")content(8257)delimiter(")>operator(:) string(\\mathchar"1356)
comment(#SINGLE LOW-9 QUOTATION MARK)
comment(#requires fontenc:T1)
-key(lsquor)operator(:) string(",")
+key(lsquor)operator(:) string<delimiter(")content(,)delimiter(")>
comment(#SINGLE LOW-9 QUOTATION MARK)
comment(#requires fontenc:T1)
-key<delimiter(")content(8218)delimiter(")>operator(:) string(",")
+key<delimiter(")content(8218)delimiter(")>operator(:) string<delimiter(")content(,)delimiter(")>
comment(#DOUBLE LOW-9 QUOTATION MARK)
comment(#requires fontenc:T1)
key(ldquor)operator(:) string(,,)
@@ -283,7 +283,7 @@ key(lt)operator(:) string(\\textless{})
comment(#LESS-THAN SIGN)
key<delimiter(")content(60)delimiter(")>operator(:) string(\\textless{})
comment(#EQUALS SIGN)
-key<delimiter(")content(61)delimiter(")>operator(:) string("=")
+key<delimiter(")content(61)delimiter(")>operator(:) string<delimiter(")content(=)delimiter(")>
comment(#GREATER-THAN SIGN)
key(gt)operator(:) string(\\textgreater{})
comment(#GREATER-THAN SIGN)
@@ -335,13 +335,13 @@ key<delimiter(")content(38)delimiter(")>operator(:) string(\\&)
comment(#ASTERISK)
key<delimiter(")content(42)delimiter(")>operator(:) string(\\ast{})
comment(#COMMERCIAL AT)
-key<delimiter(")content(64)delimiter(")>operator(:) string("@")
+key<delimiter(")content(64)delimiter(")>operator(:) string<delimiter(")content(@)delimiter(")>
comment(#LEFT SQUARE BRACKET)
-key<delimiter(")content(91)delimiter(")>operator(:) string("[")
+key<delimiter(")content(91)delimiter(")>operator(:) string<delimiter(")content([)delimiter(")>
comment(#REVERSE SOLIDUS)
key<delimiter(")content(92)delimiter(")>operator(:) string(\\textbackslash{})
comment(#RIGHT SQUARE BRACKET)
-key<delimiter(")content(93)delimiter(")>operator(:) string("]")
+key<delimiter(")content(93)delimiter(")>operator(:) string<delimiter(")content(])delimiter(")>
comment(#LEFT CURLY BRACKET)
key<delimiter(")content(123)delimiter(")>operator(:) string(\\{)
comment(#HORIZONTAL BAR)
@@ -451,40 +451,40 @@ comment(#EIGHTH NOTE)
comment(#requires wasysym)
key<delimiter(")content(9834)delimiter(")>operator(:) string(\\textmusicalnote{})
comment(#EXCLAMATION MARK)
-key<delimiter(")content(33)delimiter(")>operator(:) string("!")
+key<delimiter(")content(33)delimiter(")>operator(:) string<delimiter(")content(!)delimiter(")>
comment(#INVERTED EXCLAMATION MARK)
-key(iexcl)operator(:) string("!`")
+key(iexcl)operator(:) string<delimiter(")content(!`)delimiter(")>
comment(#INVERTED EXCLAMATION MARK)
-key<delimiter(")content(161)delimiter(")>operator(:) string("!`")
+key<delimiter(")content(161)delimiter(")>operator(:) string<delimiter(")content(!`)delimiter(")>
comment(#QUOTATION MARK)
comment(#requires fontenc:T1)
-key(quot)operator(:) string("\\"")
+key(quot)operator(:) string<delimiter(")content(\\")delimiter(")>
comment(#QUOTATION MARK)
comment(#requires fontenc:T1)
-key<delimiter(")content(34)delimiter(")>operator(:) string("\\"")
+key<delimiter(")content(34)delimiter(")>operator(:) string<delimiter(")content(\\")delimiter(")>
comment(#APOSTROPHE)
comment(#requires textcomp)
-key<delimiter(")content(39)delimiter(")>operator(:) string("'")
+key<delimiter(")content(39)delimiter(")>operator(:) string<delimiter(")content(')delimiter(")>
comment(#LEFT PARENTHESIS)
key<delimiter(")content(40)delimiter(")>operator(:) string(()
comment(#RIGHT PARENTHESIS)
key<delimiter(")content(41)delimiter(")>operator(:) string(\))
comment(#COMMA)
-key<delimiter(")content(44)delimiter(")>operator(:) string(",")
+key<delimiter(")content(44)delimiter(")>operator(:) string<delimiter(")content(,)delimiter(")>
comment(#LOW LINE)
key<delimiter(")content(95)delimiter(")>operator(:) string(\\_)
comment(#HYPHEN-MINUS)
-key<delimiter(")content(45)delimiter(")>operator(:) string("-")
+key<delimiter(")content(45)delimiter(")>operator(:) string<delimiter(")content(-)delimiter(")>
comment(#FULL STOP)
key<delimiter(")content(46)delimiter(")>operator(:) string(.)
comment(#SOLIDUS)
key<delimiter(")content(47)delimiter(")>operator(:) string(/)
comment(#COLON)
-key<delimiter(")content(58)delimiter(")>operator(:) string(":")
+key<delimiter(")content(58)delimiter(")>operator(:) string<delimiter(")content(:)delimiter(")>
comment(#SEMICOLON)
key<delimiter(")content(59)delimiter(")>operator(:) string(;)
comment(#QUESTION MARK)
-key<delimiter(")content(63)delimiter(")>operator(:) string("?")
+key<delimiter(")content(63)delimiter(")>operator(:) string<delimiter(")content(?)delimiter(")>
comment(#INVERTED QUESTION MARK)
key(iquest)operator(:) string(?`)
comment(#INVERTED QUESTION MARK)
@@ -506,21 +506,21 @@ key(lsquo)operator(:) string(`)
comment(#LEFT SINGLE QUOTATION MARK)
key<delimiter(")content(8216)delimiter(")>operator(:) string(`)
comment(#RIGHT SINGLE QUOTATION MARK)
-key(rsquo)operator(:) string("'")
+key(rsquo)operator(:) string<delimiter(")content(')delimiter(")>
comment(#RIGHT SINGLE QUOTATION MARK)
-key<delimiter(")content(8217)delimiter(")>operator(:) string("'")
+key<delimiter(")content(8217)delimiter(")>operator(:) string<delimiter(")content(')delimiter(")>
comment(#LEFT DOUBLE QUOTATION MARK)
key(ldquo)operator(:) string(``)
comment(#LEFT DOUBLE QUOTATION MARK)
key<delimiter(")content(8220)delimiter(")>operator(:) string(``)
comment(#RIGHT DOUBLE QUOTATION MARK)
-key(rdquo)operator(:) string("''")
+key(rdquo)operator(:) string<delimiter(")content('')delimiter(")>
comment(#RIGHT DOUBLE QUOTATION MARK)
-key<delimiter(")content(8221)delimiter(")>operator(:) string("''")
+key<delimiter(")content(8221)delimiter(")>operator(:) string<delimiter(")content('')delimiter(")>
comment(#NO-BREAK SPACE)
-key(nbsp)operator(:) string("~")
+key(nbsp)operator(:) string<delimiter(")content(~)delimiter(")>
comment(#NO-BREAK SPACE)
-key<delimiter(")content(160)delimiter(")>operator(:) string("~")
+key<delimiter(")content(160)delimiter(")>operator(:) string<delimiter(")content(~)delimiter(")>
comment(#SOFT HYPHEN)
key(shy)operator(:) string(\\-)
comment(#SOFT HYPHEN)
@@ -732,9 +732,9 @@ key(prime)operator(:) string(^\\prime)
comment(#PRIME)
key<delimiter(")content(8242)delimiter(")>operator(:) string(^\\prime)
comment(#DOUBLE PRIME)
-key(Prime)operator(:) string("{''}")
+key(Prime)operator(:) string<delimiter(")content({''})delimiter(")>
comment(#DOUBLE PRIME)
-key<delimiter(")content(8243)delimiter(")>operator(:) string("{''}")
+key<delimiter(")content(8243)delimiter(")>operator(:) string<delimiter(")content({''})delimiter(")>
comment(#PROPORTIONAL TO)
key(prop)operator(:) string(\\propto{})
comment(#PROPORTIONAL TO)
@@ -822,7 +822,7 @@ key<delimiter(")content(8499)delimiter(")>operator(:) string(M)
comment(#COMBINING THREE DOTS ABOVE)
key<delimiter(")content(8411)delimiter(")>operator(:) string(\\ddot{}\\kern 3pt\\dot{ })
comment(#TRIPLE PRIME)
-key<delimiter(")content(8244)delimiter(")>operator(:) string("{'''}")
+key<delimiter(")content(8244)delimiter(")>operator(:) string<delimiter(")content({'''})delimiter(")>
comment(#ESTIMATES)
key<delimiter(")content(8793)delimiter(")>operator(:) string(\\stackrel{\\wedge}{=})
comment(#GREEK SMALL LETTER ALPHA)
@@ -1309,7 +1309,7 @@ comment(#RING EQUAL TO)
comment(#requires amssymb)
key<delimiter(")content(8791)delimiter(")>operator(:) string(\\circeq{})
comment(#COLON EQUALS)
-key<delimiter(")content(8788)delimiter(")>operator(:) string(":=")
+key<delimiter(")content(8788)delimiter(")>operator(:) string<delimiter(")content(:=)delimiter(")>
comment(#EQUAL TO OR PRECEDES)
comment(#requires amssymb)
key<delimiter(")content(8926)delimiter(")>operator(:) string(\\curlyeqprec{})
@@ -1325,7 +1325,7 @@ comment(#RING IN EQUAL TO)
comment(#requires amssymb)
key<delimiter(")content(8790)delimiter(")>operator(:) string(\\eqcirc{})
comment(#EQUALS COLON)
-key<delimiter(")content(8789)delimiter(")>operator(:) string("=:")
+key<delimiter(")content(8789)delimiter(")>operator(:) string<delimiter(")content(=:)delimiter(")>
comment(#GEOMETRICALLY EQUAL TO)
comment(#requires amssymb)
key<delimiter(")content(8785)delimiter(")>operator(:) string(\\doteqdot{})
@@ -2393,7 +2393,7 @@ comment(#INVERTED OHM SIGN)
comment(#requires amssymb)
key<delimiter(")content(8487)delimiter(")>operator(:) string(\\textmho{})
comment(#PROPORTION)
-key<delimiter(")content(8759)delimiter(")>operator(:) string("::")
+key<delimiter(")content(8759)delimiter(")>operator(:) string<delimiter(")content(::)delimiter(")>
comment(#LEFT WHITE SQUARE BRACKET)
comment(#requires stmaryrd)
key<delimiter(")content(12314)delimiter(")>operator(:) string(\\textlbrackdbl{})
diff --git a/test/scanners/yaml/threshold.expected.raydebug b/test/scanners/yaml/threshold.expected.raydebug
index 8d3c8f5..55a33e4 100644
--- a/test/scanners/yaml/threshold.expected.raydebug
+++ b/test/scanners/yaml/threshold.expected.raydebug
@@ -1,582 +1,582 @@
-tag(---) comment(# From http://thresholdstate.com/articles/4312/the-textile-reference-manual)
+head<head(---)> comment(# From http://thresholdstate.com/articles/4312/the-textile-reference-manual)
key(name)operator(:) string(paragraph)
key(desc)operator(:) string(Paragraphs are separated by blank lines. Each paragraph of text is transformed into a XHTML <p> paragraph block.)
key(in)operator(:) string(|-)
- string(A) string(paragraph.)
+ string(A paragraph.)
- string(Another) string(paragraph.)
+ string(Another paragraph.)
key(html)operator(:) string(|-)
- string(<p>A) string(paragraph.</p>)
- string(<p>Another) string(paragraph.</p>)
-tag(---)
+ string(<p>A paragraph.</p>)
+ string(<p>Another paragraph.</p>)
+head<head(---)>
key(name)operator(:) string(line breaks)
key(desc)operator(:) string(Line breaks within paragraphs are transformed into XHTML line breaks.)
key(in)operator(:) string(|-)
- string(A) string(paragraph) string(with)
- string(a) string(line) string(break.)
+ string(A paragraph with)
+ string(a line break.)
key(html)operator(:) string(|-)
- string(<p>A) string(paragraph) string(with<br) string(/>)
- string(a) string(line) string(break.</p>)
-tag(---)
+ string(<p>A paragraph with<br />)
+ string(a line break.</p>)
+head<head(---)>
key(name)operator(:) string(xhtml tags)
key(desc)operator(:) string(Simple XHTML tags may be included in a paragraph.)
key(in)operator(:) string(Here's some <b>bold</b> text.)
key(html)operator(:) string(<p>Here&#8217;s some <b>bold</b> text.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(no paragraph tags)
key(desc)operator(:) string(A line beginning with a space will be left untouched, and not wrapped in <p> tags.)
-key(in)operator(:) string(" No paragraph tags here.")
-key(html)operator(:) string("No paragraph tags here.")
+key(in)operator(:) string<delimiter(")content( No paragraph tags here.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(No paragraph tags here.)delimiter(")>
key(valid_html)operator(:) string(false)
-tag(---)
+head<head(---)>
key(name)operator(:) string(smart quotes)
key(desc)operator(:) string(Single and double typewriter quotation marks ' and " are transformed into typographically correct “curly” quote marks.)
key(in)operator(:) string('"Proceed!" said he to the host.')
key(html)operator(:) string('<p>&#8220;Proceed!&#8221; said he to the host.</p>')
-tag(---)
+head<head(---)>
key(name)operator(:) string(smart quotes 2)
-key(in)operator(:) string("'Proceed!' said he to the host.")
-key(html)operator(:) string("<p>&#8216;Proceed!&#8217; said he to the host.</p>")
-tag(---)
+key(in)operator(:) string<delimiter(")content('Proceed!' said he to the host.)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<p>&#8216;Proceed!&#8217; said he to the host.</p>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(nested quotation marks)
key(desc)operator(:) string(Single and double quotation marks may be nested one inside the other.)
key(in)operator(:) string(|-)
- string("'I) string(swear,) string(captain,') string(replied) string(I.")
+ string("'I swear, captain,' replied I.")
key(html)operator(:) string(|-)
- string(<p>&#8220;&#8216;I) string(swear,) string(captain,&#8217;) string(replied) string(I.&#8221;</p>)
-tag(---)
+ string(<p>&#8220;&#8216;I swear, captain,&#8217; replied I.&#8221;</p>)
+head<head(---)>
key(name)operator(:) string(nested quotation marks 2)
key(in)operator(:) string(|-)
- string('"I) string(swear,) string(captain,") string(replied) string(I.')
+ string('"I swear, captain," replied I.')
key(html)operator(:) string(|-)
- string(<p>&#8216;&#8220;I) string(swear,) string(captain,&#8221;) string(replied) string(I.&#8217;</p>)
-tag(---)
+ string(<p>&#8216;&#8220;I swear, captain,&#8221; replied I.&#8217;</p>)
+head<head(---)>
key(name)operator(:) string(apostrophe glyphs)
key(desc)operator(:) string(Single quotation marks ' will be turned into apostrophe glyphs when used as such.)
key(in)operator(:) string(Greengrocers' apostrophe's.)
key(html)operator(:) string(<p>Greengrocers&#8217; apostrophe&#8217;s.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(em-dash glyphs)
key(desc)operator(:) string(Double -- dashes become an em-dash glyph.)
key(in)operator(:) string(You know the Italian proverb -- Chi ha compagno ha padrone.)
key(html)operator(:) string(<p>You know the Italian proverb &#8212; Chi ha compagno ha padrone.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(em-dash glyphs 2)
key(in)operator(:) string(You know the Italian proverb--Chi ha compagno ha padrone.)
key(html)operator(:) string(<p>You know the Italian proverb&#8212;Chi ha compagno ha padrone.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(en-dash glyphs)
key(desc)operator(:) string(Single - dashes are replaced with en-dashes.)
key(in)operator(:) string(You know the Italian proverb - Chi ha compagno ha padrone.)
key(html)operator(:) string(<p>You know the Italian proverb &#8211; Chi ha compagno ha padrone.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(ellipsis character)
key(desc)operator(:) string(Three period marks become an ellipsis character.)
key(in)operator(:) string(Meanwhile...)
key(html)operator(:) string(<p>Meanwhile&#8230;</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(dimension character)
key(desc)operator(:) string(An “x” is replaced with the dimension character when used between numbers.)
key(in)operator(:) string(1 x 2 x 3 = 6)
key(html)operator(:) string(<p>1 &#215; 2 &#215; 3 = 6</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(dimension character 2)
key(in)operator(:) string(1x2x3 = 6)
key(html)operator(:) string(<p>1&#215;2&#215;3 = 6</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(trademark register copyright)
key(desc)operator(:) string(Trademark, Registered and Copyright symbols are represented by their common plain text equivalents.)
key(in)operator(:) string(Registered(r\) Trademark(tm\) Copyright (c\).)
key(html)operator(:) string(<p>Registered&#174; Trademark&#8482; Copyright &#169;.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(acronyms)
key(desc)operator(:) string(Acronyms consist of three or more uppercase characters, followed immediately by words in parentheses.)
key(in)operator(:) string(ABC(Always Be Closing\))
key(html)operator(:) string(<p><acronym title="Always Be Closing"><span class="caps">ABC</span></acronym></p>)
key(no_span_caps_html)operator(:) string(<p><acronym title="Always Be Closing">ABC</acronym></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(uppercase)
key(desc)operator(:) string(Uppercase words of three or more characters are enclosed with a special span element.)
key(in)operator(:) string(IBM or HAL)
key(html)operator(:) string(<p><span class="caps">IBM</span> or <span class="caps">HAL</span></p>)
key(no_span_caps_html)operator(:) string(<p>IBM or HAL</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(emphasis)
key(desc)operator(:) string(Emphasis is added with _ underscores.)
key(in)operator(:) string(The _underlying_ cause.)
key(html)operator(:) string(<p>The <em>underlying</em> cause.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(strong text)
key(desc)operator(:) string(Strong text is indicated by * asterisks.)
key(in)operator(:) string(The *underlying* cause.)
key(html)operator(:) string(<p>The <strong>underlying</strong> cause.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(italic text)
key(desc)operator(:) string(em is a semantic tag, usually represented by browsers as italic text. To produce italic tags instead, use double underscores.)
key(in)operator(:) string(The __underlying__ cause.)
key(html)operator(:) string(<p>The <i>underlying</i> cause.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(bold text)
key(desc)operator(:) string(strong is a semantic tag, usually represented by browsers as bold text. To produce bold tags instead, use double asterisks.)
key(in)operator(:) string(The **underlying** cause.)
key(html)operator(:) string(<p>The <b>underlying</b> cause.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(citation)
key(desc)operator(:) string(Double question marks represent a citation, like the title of a book.)
key(in)operator(:) string(??The Count of Monte Cristo??, by Dumas.)
key(html)operator(:) string(<p><cite>The Count of Monte Cristo</cite>, by Dumas.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(inserted and deleted text)
key(desc)operator(:) string(Inserted and deleted text is represented by + plus and - minus symbols.)
key(in)operator(:) string(Scratch -that-, replace with +this+.)
key(html)operator(:) string(<p>Scratch <del>that</del>, replace with <ins>this</ins>.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(subscript)
key(desc)operator(:) string(Subscript text is indicated by ~ tilde characters.)
key(in)operator(:) string(log ~2~ n)
key(html)operator(:) string(<p>log <sub>2</sub> n</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(superscript)
key(desc)operator(:) string(Superscript text is indicated by ^ caret characters.)
key(in)operator(:) string(2 ^x^)
key(html)operator(:) string(<p>2 <sup>x</sup></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(span tag)
key(desc)operator(:) string(Percentage marks will enclose text with a XHTML span tag.)
key(in)operator(:) string(The %underlying% cause.)
key(html)operator(:) string(<p>The <span>underlying</span> cause.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(code)
key(desc)operator(:) string(To include a short snippet of code such as XHTML or Javascript, surround it with @ “at” symbols. XHTML significant characters within a code phrase will be escaped for display to the reader.)
key(in)operator(:) string(About the @<hr />@ tag.)
key(html)operator(:) string(<p>About the <code>&lt;hr /&gt;</code> tag.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(links)
key(desc)operator(:) string(Links are represented by double quotes and a colon.)
key(in)operator(:) string('"link text":http://example.com/')
key(html)operator(:) string(<p><a href="http://example.com/">link text</a></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(local links)
key(desc)operator(:) string(The host name may be ommitted for local links.)
key(in)operator(:) string('"link text":/example')
key(html)operator(:) string(<p><a href="/example">link text</a></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(link title)
key(desc)operator(:) string(A title may be placed in (\) parentheses.)
key(in)operator(:) string('"link text(with title\)":http://example.com/')
key(html)operator(:) string(<p><a href="http://example.com/" title="with title">link text</a></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(link alias)
key(desc)operator(:) string(For frequent linking to a single URL, you can specify a link alias with [] square brackets.)
key(in)operator(:) string(|-)
- string(Here's) key<delimiter(")content(a link)delimiter(")>symbol(:tstate)operator(,) string(and)
- key<delimiter(")content(another link)delimiter(")>symbol(:tstate) string(to) string(the) string(same) string(site.)
+ string(Here's "a link":tstate, and)
+ string("another link":tstate to the same site.)
- operator([)string(tstate]http)error(:)string(//thresholdstate.com/)
+ operator([)string(tstate]http://thresholdstate.com/)
key(html)operator(:) string(|-)
- string(<p>Here&#8217;s) string(<a) string(href="http)error(:)string(//thresholdstate.com/">a) string(link</a>,) string(and<br) string(/>)
- string(<a) string(href="http)error(:)string(//thresholdstate.com/">another) string(link</a>) string(to) string(the) string(same) string(site.</p>)
-tag(---)
+ string(<p>Here&#8217;s <a href="http://thresholdstate.com/">a link</a>, and<br />)
+ string(<a href="http://thresholdstate.com/">another link</a> to the same site.</p>)
+head<head(---)>
key(name)operator(:) string(image)
key(desc)operator(:) string(Use ! exclamation marks to insert an image tag.)
-key(in)operator(:) string("!/img.gif!")
+key(in)operator(:) string<delimiter(")content(!/img.gif!)delimiter(")>
key(html)operator(:) string(<p><img src="/img.gif" alt="" /></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(image 2)
-key(in)operator(:) string("!http://thresholdstate.com/img.gif!")
+key(in)operator(:) string<delimiter(")content(!http://thresholdstate.com/img.gif!)delimiter(")>
key(html)operator(:) string(<p><img src="http://thresholdstate.com/img.gif" alt="" /></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(image alt)
key(desc)operator(:) string(Use (\) parentheses to include “alt” text.)
-key(in)operator(:) string("!/img.gif(alt text\)!")
+key(in)operator(:) string<delimiter(")content(!/img.gif(alt text\)!)delimiter(")>
key(html)operator(:) string(<p><img src="/img.gif" title="alt text" alt="alt text" /></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(image links)
key(desc)operator(:) string(Images may be combined with links by using an !image! in place of the link text.)
-key(in)operator(:) string("!/img.gif!:http://textpattern.com/")
+key(in)operator(:) string<delimiter(")content(!/img.gif!:http://textpattern.com/)delimiter(")>
key(html)operator(:) string(<p><a href="http://textpattern.com/"><img src="/img.gif" alt="" /></a></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(headers)
key(desc)operator(:) string(Headers are represented by h1., h2., … h6..)
key(in)operator(:) string(h1. Heading 1)
key(html)operator(:) string(<h1>Heading 1</h1>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(headers 2)
key(in)operator(:) string(h2. Heading 2)
key(html)operator(:) string(<h2>Heading 2</h2>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(headers 3)
key(in)operator(:) string(h6. Heading 6)
key(html)operator(:) string(<h6>Heading 6</h6>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(paragraph text)
-key(desc)operator(:) string("Paragraph p text is represented by p.. This is the default block type: any paragraph without a block modifier will automatically be enclosed with p tags.")
+key(desc)operator(:) string<delimiter(")content(Paragraph p text is represented by p.. This is the default block type: any paragraph without a block modifier will automatically be enclosed with p tags.)delimiter(")>
key(in)operator(:) string(|-)
- string(p.) string(A) string(paragraph.)
+ string(p. A paragraph.)
string(Continued.)
- string(Also) string(a) string(paragraph.)
+ string(Also a paragraph.)
key(html)operator(:) string(|-)
- string(<p>A) string(paragraph.<br) string(/>)
+ string(<p>A paragraph.<br />)
string(Continued.</p>)
- string(<p>Also) string(a) string(paragraph.</p>)
-tag(---)
+ string(<p>Also a paragraph.</p>)
+head<head(---)>
key(name)operator(:) string(block quote)
key(desc)operator(:) string(bq. indicates a quoted block of text.)
key(in)operator(:) string(|-)
- string(bq.) string(A) string(quotation.)
+ string(bq. A quotation.)
string(Continued.)
- string(Regular) string(paragraph.)
+ string(Regular paragraph.)
key(html)operator(:) string(|-)
string(<blockquote>)
- string(<p>A) string(quotation.<br) string(/>)
+ string(<p>A quotation.<br />)
string(Continued.</p>)
string(</blockquote>)
- string(<p>Regular) string(paragraph.</p>)
-tag(---)
+ string(<p>Regular paragraph.</p>)
+head<head(---)>
key(name)operator(:) string(block quote citation)
key(desc)operator(:) string(Block quotes may include a citation URL immediately following the period.)
key(in)operator(:) string(bq.:http://thresholdstate.com/ A cited quotation.)
key(html)operator(:) string(|-)
- string(<blockquote) string(cite="http)error(:)string(//thresholdstate.com/">)
- string(<p>A) string(cited) string(quotation.</p>)
+ string(<blockquote cite="http://thresholdstate.com/">)
+ string(<p>A cited quotation.</p>)
string(</blockquote>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(footnotes)
key(desc)operator(:) string(Footnotes are represented by the fn1., fn2., … block modifiers.)
key(in)operator(:) string(|-)
- string(A) string(footnote) string(reference[1].)
+ string(A footnote reference[1].)
- string(fn1.) string(The) string(footnote.)
+ string(fn1. The footnote.)
key(html)operator(:) string(|-)
- string(<p>A) string(footnote) string(reference<sup) string(class="footnote"><a) string(href="#fn1">1</a></sup>.</p>)
- string(<p) string(class="footnote") string(id="fn1"><sup>1</sup>) string(The) string(footnote.</p>)
+ string(<p>A footnote reference<sup class="footnote"><a href="#fn1">1</a></sup>.</p>)
+ string(<p class="footnote" id="fn1"><sup>1</sup> The footnote.</p>)
comment(# html: |-)
comment(# <p>A footnote reference<sup class="footnote"><a href="#fn1216642796463b1223ae29d">1</a></sup>.</p>)
comment(# <p class="footnote" id="fn1216642796463b1223ae29d"><sup>1</sup> The footnote.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(block code)
key(desc)operator(:) string(Code such as XHTML, Javascript or PHP may be displayed using the bc. “block code” modifier. XHTML significant characters such as < and > will be escaped within code blocks – bc is used for displaying code to the reader, not for executing it.)
key(note)operator(:) string(Note that Textile will interpret any blank lines within the code as indicating the end of the code block. See Extended Blocks below for an explanation of how to display longer blocks of code.)
key(in)operator(:) string(|-)
- string(bc.) string(<script>)
- string(//) string(a) string(Javascript) string(example)
- string(alert("Hello) string(World"\);)
+ string(bc. <script>)
+ string(// a Javascript example)
+ string(alert("Hello World"\);)
string(</script>)
key(html)operator(:) string(|-)
string(<pre><code>&lt;script&gt;)
- string(//) string(a) string(Javascript) string(example)
- string(alert("Hello) string(World"\);)
+ string(// a Javascript example)
+ string(alert("Hello World"\);)
variable(&lt;/script&gt;</code></pre>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(preformatted text)
key(desc)operator(:) string(Use the pre. block modifier for pre-formatted text. XHTML significant characters within the block will be escaped.)
key(note)operator(:) string(pre. is almost identical to bc., with the exception that <code>...</code> tags are not used within the <pre> block.)
key(in)operator(:) string(|-)
- string(pre.) string(Pre-formatted)
+ string(pre. Pre-formatted)
string(text)
key(html)operator(:) string(|-)
string(<pre>Pre-formatted)
string(text</pre>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(notextile)
key(desc)operator(:) string(The notextile. block modifier applies no Textile processing at all to a block. Raw XHTML characters are passed through untouched, so this may be used to insert explicit XHTML markup, or execute Javascript or PHP code.)
key(in)operator(:) string(|-)
- string(notextile.) string(<script) string(type="text/javascript">)
- string(document.write("Hello) string(World!"\);)
+ string(notextile. <script type="text/javascript">)
+ string(document.write("Hello World!"\);)
string(</script>)
- string(<noscript>Your) string(browser) string(doesn't) string(support) string(Javascript</noscript>)
+ string(<noscript>Your browser doesn't support Javascript</noscript>)
key(html)operator(:) string(|-)
- string(<script) string(type="text/javascript">)
- string(document.write("Hello) string(World!"\);)
+ string(<script type="text/javascript">)
+ string(document.write("Hello World!"\);)
string(</script>)
- string(<noscript>Your) string(browser) string(doesn't) string(support) string(Javascript</noscript>)
+ string(<noscript>Your browser doesn't support Javascript</noscript>)
key(valid_html)operator(:) string(false)
-tag(---)
+head<head(---)>
key(name)operator(:) string(class attribute)
key(desc)operator(:) string(CSS classes are specified with (\) parentheses.)
key(in)operator(:) string(p(myclass\). My classy paragraph.)
key(html)operator(:) string(<p class="myclass">My classy paragraph.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(id attribute)
key(desc)operator(:) string(CSS IDs are specified with (\) parentheses.)
key(in)operator(:) string(p(#myid\). My ID paragraph.)
key(html)operator(:) string(<p id="myid">My ID paragraph.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(style attribute)
key(desc)operator(:) string(CSS styles are specified with {} braces.)
key(in)operator(:) string(p{color:red}. Red rum.)
key(html)operator(:) string(<p style="color:red;">Red rum.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(lang attribute)
key(desc)operator(:) string(Languages are specified with [] brackets.)
key(in)operator(:) string(p[fr-fr]. En français.)
key(html)operator(:) string(<p lang="fr-fr">En français.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(phrase modifiers)
key(desc)operator(:) string(The same syntax may be applied to phrase modifiers.)
key(in)operator(:) string(A *(myclass\)classy* phrase.)
key(html)operator(:) string(<p>A <strong class="myclass">classy</strong> phrase.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(phrase modifiers 2)
key(in)operator(:) string(An _(#myid2\)ID_ phrase.)
key(html)operator(:) string(<p>An <em id="myid2">ID</em> phrase.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(phrase modifiers 3)
key(in)operator(:) string(The %{color:blue}blue% room.)
key(html)operator(:) string(<p>The <span style="color:blue;">blue</span> room.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(block and phrase attributes combined)
key(desc)operator(:) string(Block and phrase attributes may be combined.)
key(in)operator(:) string(p(myclass#myid3\){color:green}[de-de]. A complex paragraph.)
key(html)operator(:) string(<p style="color:green;" class="myclass" lang="de-de" id="myid3">A complex paragraph.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(block and phrase attributes combined 2)
key(in)operator(:) string(A ??(myclass#myid4\){color:green}[de-de]complex?? phrase.)
key(html)operator(:) string(<p>A <cite style="color:green;" class="myclass" lang="de-de" id="myid4">complex</cite> phrase.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(extended blocks)
key(desc)operator(:) string(Normally a block modifier covers a single block of text, and ends at the first blank line. To extend a block over multiple paragraphs that include blank lines, use a block modifier with two period marks instead of one. To close the extended block, use a different block modifier on the next paragraph.)
key(in)operator(:) string(|-)
- string(bq..) string(A) string(quote.)
+ string(bq.. A quote.)
- string(The) string(quote) string(continued.)
+ string(The quote continued.)
- string(p.) string(Back) string(to) string(paragraph) string(text.)
+ string(p. Back to paragraph text.)
key(html)operator(:) string(|-)
string(<blockquote>)
- string(<p>A) string(quote.</p>)
- string(<p>The) string(quote) string(continued.</p>)
+ string(<p>A quote.</p>)
+ string(<p>The quote continued.</p>)
string(</blockquote>)
- string(<p>Back) string(to) string(paragraph) string(text.</p>)
-tag(---)
+ string(<p>Back to paragraph text.</p>)
+head<head(---)>
key(name)operator(:) string(extended block code)
key(desc)operator(:) string(Extended blocks are useful for displaying longer examples of code that contain blank lines.)
key(in)operator(:) string(|-)
- string(A) string(PHP) string(code) string(example.)
+ string(A PHP code example.)
- string(bc..) string(<?php)
- string(function) string(hello(\)) operator({)
- string(//) string(display) string(a) string(hello) string(message)
+ string(bc.. <?php)
+ string(function hello(\) {)
+ string(// display a hello message)
- string(print) string("Hello,) string(World";)
+ string(print "Hello, World";)
operator(})
string(?>)
- string(p.) string(Following) string(paragraph.)
+ string(p. Following paragraph.)
key(html)operator(:) string(|-)
- string(<p>A) string(<span) string(class="caps">PHP</span>) string(code) string(example.</p>)
+ string(<p>A <span class="caps">PHP</span> code example.</p>)
string(<pre><code>&lt;?php)
- string(function) string(hello(\)) operator({)
- string(//) string(display) string(a) string(hello) string(message</code>)
+ string(function hello(\) {)
+ string(// display a hello message</code>)
- string(<code>print) string("Hello,) string(World";)
+ string(<code>print "Hello, World";)
operator(})
string(?&gt;</code>)
string(</pre>)
- string(<p>Following) string(paragraph.</p>)
-tag(---)
+ string(<p>Following paragraph.</p>)
+head<head(---)>
key(name)operator(:) string(extended block attributes)
key(desc)operator(:) string(Any block attributes on an extended block will be included on each following block.)
key(in)operator(:) string(|-)
- string(p(myclass\)..) string(A) string(classy) string(paragraph.)
+ string(p(myclass\).. A classy paragraph.)
- string(Another) string(classy) string(paragraph.)
+ string(Another classy paragraph.)
- string(p.) string(Not) string(so) string(classy.)
+ string(p. Not so classy.)
key(html)operator(:) string(|-)
- string(<p) string(class="myclass">A) string(classy) string(paragraph.</p>)
- string(<p) string(class="myclass">Another) string(classy) string(paragraph.</p>)
- string(<p>Not) string(so) string(classy.</p>)
-tag(---)
+ string(<p class="myclass">A classy paragraph.</p>)
+ string(<p class="myclass">Another classy paragraph.</p>)
+ string(<p>Not so classy.</p>)
+head<head(---)>
key(name)operator(:) string(extended block quote attributes)
key(desc)operator(:) string(Attributes on bq.. extended blocks will be included on both the inner and outer blocks.)
key(in)operator(:) string(|-)
- string(bq(myclass\)..) string(Quote) string(paragraph) string(1.)
+ string(bq(myclass\).. Quote paragraph 1.)
- string(Paragraph) string(2.)
+ string(Paragraph 2.)
key(html)operator(:) string(|-)
- string(<blockquote) string(class="myclass">)
- string(<p) string(class="myclass">Quote) string(paragraph) string(1.</p>)
- string(<p) string(class="myclass">Paragraph) string(2.</p>)
+ string(<blockquote class="myclass">)
+ string(<p class="myclass">Quote paragraph 1.</p>)
+ string(<p class="myclass">Paragraph 2.</p>)
string(</blockquote>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(extended block code attributes)
key(desc)operator(:) string(Attributes on bc.. extended blocks will be included on both the inner and outer blocks.)
key(in)operator(:) string(|-)
- string(bc(myclass\)..) string(Code) string(block) string(1.)
+ string(bc(myclass\).. Code block 1.)
- string(Code) string(block) string(2.)
+ string(Code block 2.)
key(html)operator(:) string(|-)
- string(<pre) string(class="myclass"><code) string(class="myclass">Code) string(block) string(1.</code>)
+ string(<pre class="myclass"><code class="myclass">Code block 1.</code>)
- string(<code) string(class="myclass">Code) string(block) string(2.</code></pre>)
-tag(---)
+ string(<code class="myclass">Code block 2.</code></pre>)
+head<head(---)>
key(name)operator(:) string(raw xhtml left in tact)
key(desc)operator(:) string(Raw XHTML tags are generally left untouched by Textile. Span tags that enclose only part of a block of text will be left intact, while the block itself is treated normally.)
key(in)operator(:) string(<b>bold</b> and <i>italic</i>, the hard way.)
key(html)operator(:) string(<p><b>bold</b> and <i>italic</i>, the hard way.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(paragraphs entirely raw xhtml)
key(desc)operator(:) string(Paragraphs that consist entirely of raw XHTML block tags will not be enclosed in <p>...</p> tags.)
key(in)operator(:) string(<div class="mydiv">My div</div>)
key(html)operator(:) string(<div class="mydiv">My div</div>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(paragraphs with inline xhtml)
key(desc)operator(:) string(Paragraphs that consist only of inline XHTML tags, will be enclosed in <p>...</p> tags.)
key(in)operator(:) string(<img src="/img.gif" alt="image" />)
key(html)operator(:) string(<p><img src="/img.gif" alt="image" /></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(paragraphs with inline xhtml 2)
key(in)operator(:) string(<span class="myspan">I'll make my own way.</span>)
key(html)operator(:) string('<p><span class="myspan">I&#8217;ll make my own way.</span></p>')
-tag(---)
+head<head(---)>
key(name)operator(:) string(paragraphs partly enclosed in xhtml block tags)
key(desc)operator(:) string(Paragraphs that are only partly enclosed in block tags will be enclosed in <p>...</p> tags.)
key(in)operator(:) string(<div>inside</div> and outside.)
key(html)operator(:) string(<div>inside</div> <p>and outside.</p>)
comment(# html: <p><div>inside</div> and outside.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(complex xhtml blocks)
key(desc)operator(:) string(Textile can’t always identify the beginning and end of long or complex blocks of XHTML. To prevent Textile from enclosing complex XHTML blocks in paragraph tags, either use a space at the beginning of each line...)
-key(in)operator(:) string(" <div>\\n <span>My div</span>\\n </div>")
-key(html)operator(:) string("<div>\\n<span>My div</span>\\n</div>")
-tag(---)
+key(in)operator(:) string<delimiter(")content( <div>\\n <span>My div</span>\\n </div>)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<div>\\n<span>My div</span>\\n</div>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(complex xhtml blocks 2)
key(desc)operator(:) string(...or a notexile.. extended block.)
key(in)operator(:) string(|-)
- string(notextile..) string(<div>)
+ string(notextile.. <div>)
- string(<span>My) string(div</span>)
+ string(<span>My div</span>)
string(</div>)
key(html)operator(:) string(|-)
string(<div>)
- string(<span>My) string(div</span>)
+ string(<span>My div</span>)
string(</div>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(complex xhtml blocks with inline formatting)
key(desc)operator(:) string(Textile will not wrap lines that start with a space in paragraph tags, but it should parse inline signatures)
-key(in)operator(:) string(" <div>\\n <span>My *div*</span>\\n </div>")
-key(html)operator(:) string("<div>\\n<span>My <strong>div</strong></span>\\n</div>")
-tag(---)
+key(in)operator(:) string<delimiter(")content( <div>\\n <span>My *div*</span>\\n </div>)delimiter(")>
+key(html)operator(:) string<delimiter(")content(<div>\\n<span>My <strong>div</strong></span>\\n</div>)delimiter(")>
+head<head(---)>
key(name)operator(:) string(explicit pre escapement)
key(desc)operator(:) string(The contents of explicit <pre>...</pre> tags are escaped for display. )
key(in)operator(:) string(|-)
string(<pre>)
- string(A) string(HTML) string(<b>example</b>)
+ string(A HTML <b>example</b>)
string(</pre>)
key(html)operator(:) string(|-)
string(<pre>)
- string(A) string(HTML) variable(&lt;b&gt;example&lt;/b&gt;)
+ string(A HTML &lt;b&gt;example&lt;/b&gt;)
string(</pre>)
key(note)operator(:) string(This syntax is supported for backwards compatibility only, and doesn’t always work as expected. The block modifier pre. should be used instead.)
-tag(---)
+head<head(---)>
key(name)operator(:) string(explicit code escapement)
key(desc)operator(:) string(The contents of explicit <code>...</code> tags are escaped for display.)
key(in)operator(:) string(|-)
string(<code>)
- string(Another) string(HTML) string(<b>example</b>)
+ string(Another HTML <b>example</b>)
string(</code>)
key(html)operator(:) string(|-)
string(<p><code>)
- string(Another) string(HTML) variable(&lt;b&gt;example&lt;/b&gt;)
+ string(Another HTML &lt;b&gt;example&lt;/b&gt;)
string(</code></p>)
key(note)operator(:) string(This syntax is supported for backwards compatibility only, and doesn’t always work as expected. The block modifier bc. should be used instead.)
-tag(---)
+head<head(---)>
key(name)operator(:) string(notextile tags)
key(desc)operator(:) string(Blocks enclosed by the pseudo tag <notextile>...</notextile> will be left untouched.)
key(in)operator(:) string(|-)
string(<notextile>)
- string(p.) string(Leave) string(me) string(alone)
+ string(p. Leave me alone)
string(</notextile>)
key(html)operator(:) string(|-)
- string(p.) string(Leave) string(me) string(alone)
+ string(p. Leave me alone)
comment(# html: |-)
comment(# <p>)
comment(# p. Leave me alone)
comment(# </p>)
key(note)operator(:) string(This syntax is supported for backwards compatibility only, and doesn’t always work as expected. The block modifier notextile. should be used instead.)
key(valid_html)operator(:) string(false)
-tag(---)
+head<head(---)>
key(name)operator(:) string(left aligned text)
key(desc)operator(:) string(Left alignment is specified with a < less than symbol.)
key(in)operator(:) string(p<. Left-aligned paragraph.)
key(html)operator(:) string(<p style="text-align:left;">Left-aligned paragraph.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(right aligned text)
key(desc)operator(:) string(Right alignment is specified with a > greater than symbol.)
key(in)operator(:) string(h3>. Right-aligned heading.)
key(html)operator(:) string(<h3 style="text-align:right;">Right-aligned heading.</h3>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(justified text)
key(desc)operator(:) string(Use both <> symbols for justified text.)
key(in)operator(:) string(p<>. Justified paragraph.)
key(html)operator(:) string(<p style="text-align:justify;">Justified paragraph.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(centered text)
key(desc)operator(:) string(An = equals symbol represents centered text.)
key(in)operator(:) string(h3=. Centered heading.)
key(html)operator(:) string(<h3 style="text-align:center;">Centered heading.</h3>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(padding)
key(desc)operator(:) string(Use empty ( and \) parentheses to add padding to blocks, in multiples of 1 em.)
key(in)operator(:) string(p(. Left pad 1em.)
key(html)operator(:) string(<p style="padding-left:1em;">Left pad 1em.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(padding 2)
key(in)operator(:) string(p\)\). Right pad 2em.)
key(html)operator(:) string(<p style="padding-right:2em;">Right pad 2em.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(padding 3)
key(in)operator(:) string(p(\). Left and right pad 1em.)
key(html)operator(:) string(<p style="padding-left:1em;padding-right:1em;">Left and right pad 1em.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(numeric lists)
-key(desc)operator(:) string(Numeric lists are represented by lines beginning with #.)
+key(desc)operator(:) string(Numeric lists are represented by lines beginning with) comment(#.)
key(in)operator(:) string(|-)
comment(# Item one)
comment(# Item two)
comment(# Item three)
key(html)operator(:) string(|-)
string(<ol>)
- string(<li>Item) string(one</li>)
- string(<li>Item) string(two</li>)
- string(<li>Item) string(three</li>)
+ string(<li>Item one</li>)
+ string(<li>Item two</li>)
+ string(<li>Item three</li>)
string(</ol>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(bulleted lists)
key(desc)operator(:) string(Bulleted lists are represented by lines beginning with *.)
key(in)operator(:) string(|-)
- string(*) string(Item) string(A)
- string(*) string(Item) string(B)
- string(*) string(Item) string(C)
+ string(* Item A)
+ string(* Item B)
+ string(* Item C)
key(html)operator(:) string(|-)
string(<ul>)
- string(<li>Item) string(A</li>)
- string(<li>Item) string(B</li>)
- string(<li>Item) string(C</li>)
+ string(<li>Item A</li>)
+ string(<li>Item B</li>)
+ string(<li>Item C</li>)
string(</ul>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(list attributes)
key(desc)operator(:) string(Attributes applied to the first list item will apply to the list itself.)
key(in)operator(:) string(|-)
- string(*{color)symbol(:red)operator(}) string(Item) string(one)
- string(*) string(Item) string(two)
- string(*) string(Item) string(three)
-key(html)operator(:) string(|-)
- string(<ul) string(style="color)symbol(:red)string(;">)
- string(<li>Item) string(one</li>)
- string(<li>Item) string(two</li>)
- string(<li>Item) string(three</li>)
+ string(*{color:red} Item one)
+ string(* Item two)
+ string(* Item three)
+key(html)operator(:) string(|-)
+ string(<ul style="color:red;">)
+ string(<li>Item one</li>)
+ string(<li>Item two</li>)
+ string(<li>Item three</li>)
string(</ul>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(nested lists)
-key(desc)operator(:) string(Use multiple # or * symbols to create nested lists.)
+key(desc)operator(:) string(Use multiple) comment(# or * symbols to create nested lists.)
key(in)operator(:) string(|-)
comment(# Item one)
comment(## Item one-A)
@@ -585,17 +585,17 @@ key(in)operator(:) string(|-)
comment(# Item two)
key(html)operator(:) string(|-)
string(<ol>)
- string(<li>Item) string(one)
+ string(<li>Item one)
string(<ol>)
- string(<li>Item) string(one-A</li>)
- string(<li>Item) string(one-B)
+ string(<li>Item one-A</li>)
+ string(<li>Item one-B)
string(<ol>)
- string(<li>Item) string(one-B-a</li>)
+ string(<li>Item one-B-a</li>)
string(</ol></li>)
string(</ol></li>)
- string(<li>Item) string(two</li>)
+ string(<li>Item two</li>)
string(</ol>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(tables)
key(desc)operator(:) string(Tables can be constructed using | “pipe” symbols to separate cells.)
key(in)operator(:) string(|a|simple|table|)
@@ -607,11 +607,11 @@ key(html)operator(:) string(|-)
string(<td>table</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(table heading cells)
key(desc)operator(:) string(Use _. to indicate table heading cells.)
key(in)operator(:) string(|-)
- string(|_.) string(a|_.) string(table|_.) string(heading|)
+ string(|_. a|_. table|_. heading|)
string(|a|table|row|)
key(html)operator(:) string(|-)
string(<table>)
@@ -626,7 +626,7 @@ key(html)operator(:) string(|-)
string(<td>row</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(cell attributes)
key(desc)operator(:) string(Attributes may be applied separately to individual cells, rows, and entire tables. Cell attributes are placed within each cell.)
key(in)operator(:) string(|a|{color:red}. styled|cell|)
@@ -634,23 +634,23 @@ key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
string(<td>a</td>)
- string(<td) string(style="color)symbol(:red)string(;">styled</td>)
+ string(<td style="color:red;">styled</td>)
string(<td>cell</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(row attributes)
key(desc)operator(:) string(Row attributes are placed at the beginning of a row, followed by a dot and a space.)
key(in)operator(:) string((rowclass\). |a|classy|row|)
key(html)operator(:) string(|-)
string(<table>)
- string(<tr) string(class="rowclass">)
+ string(<tr class="rowclass">)
string(<td>a</td>)
string(<td>classy</td>)
string(<td>row</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(table attributes)
key(desc)operator(:) string(Table attributes are specified by placing the special table. block modifier immediately before the table.)
key(in)operator(:) string(|-)
@@ -658,7 +658,7 @@ key(in)operator(:) string(|-)
string(|a|classy|table|)
string(|a|classy|table|)
key(html)operator(:) string(|-)
- string(<table) string(class="tableclass">)
+ string(<table class="tableclass">)
string(<tr>)
string(<td>a</td>)
string(<td>classy</td>)
@@ -670,102 +670,102 @@ key(html)operator(:) string(|-)
string(<td>table</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(vertical alignment)
key(desc)operator(:) string(Special alignment symbols are available for vertical alignment within table cells.)
key(in)operator(:) string(|^. top alignment|)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(style="vertical-align)symbol(:top)string(;">top) string(alignment</td>)
+ string(<td style="vertical-align:top;">top alignment</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(vertical alignment 2)
key(in)operator(:) string(|-)
- string(|-.) string(middle) string(alignment|)
+ string(|-. middle alignment|)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(style="vertical-align)symbol(:middle)string(;">middle) string(alignment</td>)
+ string(<td style="vertical-align:middle;">middle alignment</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(vertical alignment 3)
key(in)operator(:) string(|-)
- string(|~.) string(bottom) string(alignment|)
+ string(|~. bottom alignment|)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(style="vertical-align)symbol(:bottom)string(;">bottom) string(alignment</td>)
+ string(<td style="vertical-align:bottom;">bottom alignment</td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(column span)
key(desc)operator(:) string(Use a \\ backslash to indicate a column span.)
key(in)operator(:) string(|-)
- string(|\\2.) string(spans) string(two) string(cols) string(|)
- string(|) string(col) string(1) string(|) string(col) string(2) string(|)
+ string(|\\2. spans two cols |)
+ string(| col 1 | col 2 |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(colspan="2">spans) string(two) string(cols) string(</td>)
+ string(<td colspan="2">spans two cols </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(col) string(1) string(</td>)
- string(<td>) string(col) string(2) string(</td>)
+ string(<td> col 1 </td>)
+ string(<td> col 2 </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(row span)
key(desc)operator(:) string(Use a / forward slash to indicate a row span.)
key(in)operator(:) string(|-)
- string(|/3.) string(spans) string(3) string(rows) string(|) string(row) string(a) string(|)
- string(|) string(row) string(b) string(|)
- string(|) string(row) string(c) string(|)
+ string(|/3. spans 3 rows | row a |)
+ string(| row b |)
+ string(| row c |)
key(html)operator(:) string(|-)
string(<table>)
string(<tr>)
- string(<td) string(rowspan="3">spans) string(3) string(rows) string(</td>)
- string(<td>) string(row) string(a) string(</td>)
+ string(<td rowspan="3">spans 3 rows </td>)
+ string(<td> row a </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(row) string(b) string(</td>)
+ string(<td> row b </td>)
string(</tr>)
string(<tr>)
- string(<td>) string(row) string(c) string(</td>)
+ string(<td> row c </td>)
string(</tr>)
string(</table>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(whitespace required)
key(desc)operator(:) string(Links, images and phrase modifiers normally require surrounding whitespace.)
key(in)operator(:) string(this*won't*work)
key(html)operator(:) string(<p>this*won&#8217;t*work</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(modifier without whitespace)
key(desc)operator(:) string(To use these without whitespace, surround the modifier with [] square brackets.)
key(in)operator(:) string(this[*will*]work)
key(html)operator(:) string(<p>this<strong>will</strong>work</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(modifier without whitespace 2)
key(desc)operator(:) string(This is particularly useful in conjunction with superscript and subscript.)
key(in)operator(:) string(1[^st^], 2[^nd^], 3[^rd^].)
key(html)operator(:) string(<p>1<sup>st</sup>, 2<sup>nd</sup>, 3<sup>rd</sup>.</p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(modifier without whitespace 3)
key(in)operator(:) string(2 log[~n~])
key(html)operator(:) string(<p>2 log<sub>n</sub></p>)
-tag(---)
+head<head(---)>
key(name)operator(:) string(modifier without whitespace 4)
key(desc)operator(:) string(It can also be used to include links and images without surrounding whitespace.)
key(in)operator(:) string(|-)
- string(A) string(close[!/img.gif!]image.)
- string(A) string(tight["text")symbol(:http)error(:)string(//thresholdstate.com/]link.)
- string(A) operator([)key<delimiter(")content(footnoted link)delimiter(")>symbol(:http)error(:)string(//thresholdstate.com/][1].)
+ string(A close[!/img.gif!]image.)
+ string(A tight["text":http://thresholdstate.com/]link.)
+ string(A ["footnoted link":http://thresholdstate.com/][1].)
key(html)operator(:) string(|-)
- string(<p>A) string(close<img) string(src="/img.gif") string(alt="") string(/>image.<br) string(/>)
- string(A) string(tight<a) string(href="http)error(:)string(//thresholdstate.com/">text</a>link.<br) string(/>)
- string(A) string(<a) string(href="http)error(:)string(//thresholdstate.com/">footnoted) string(link</a><sup) string(class="footnote"><a) string(href="#fn1">1</a></sup>.</p>)
+ string(<p>A close<img src="/img.gif" alt="" />image.<br />)
+ string(A tight<a href="http://thresholdstate.com/">text</a>link.<br />)
+ string(A <a href="http://thresholdstate.com/">footnoted link</a><sup class="footnote"><a href="#fn1">1</a></sup>.</p>)
comment(# html: |-)
comment(# <p>A close<img src="/img.gif" alt="" />image.<br />)
comment(# A tight<a href="http://thresholdstate.com/">text</a>link.<br />)
diff --git a/test/scanners/yaml/website.expected.raydebug b/test/scanners/yaml/website.expected.raydebug
new file mode 100644
index 0000000..171afa3
--- /dev/null
+++ b/test/scanners/yaml/website.expected.raydebug
@@ -0,0 +1,70 @@
+string(%YAML 1.2)
+head<head(---)>
+key(YAML)operator(:) string(YAML Ain't Markup Language)
+
+key(What It Is)operator(:) string(YAML is a human friendly data serialization)
+ string(standard for all programming languages.)
+
+key(YAML Resources)operator(:)
+ key(YAML 1.2 Specification)operator(:) string(http://yaml.org/spec/1.2/)
+ key(YAML 1.1 Specification)operator(:) string(http://yaml.org/spec/1.1/)
+ key(YAML Trac Wiki)operator(:) string(http://trac.yaml.org/)
+ key(YAML Mailing List)operator(:) string(yaml-core@lists.sourceforge.net)
+ key(YAML IRC Channel)operator(:) string<delimiter(")content(#yaml on irc.freenode.net)delimiter(")>
+ key(YAML Cookbook (Ruby\))operator(:) string(http://yaml4r.sourceforge.net/cookbook/)
+
+key(Projects)operator(:)
+ operator(-) string(YAML C Libraries:)
+ operator(-) string(libyaml) comment(# New Fast YAML (1.1\))
+ operator(-) string(Syck) comment(# Old Fast YAML (1.0\))
+ operator(-) string(PyYaml) comment(# YAML 1.1 Implementation)
+ operator(-) string(JsYaml) comment(# JavaScript PyYaml port)
+ operator(-) string(RbYaml) comment(# Ruby port of PyYaml)
+ operator(-) string(JvYaml) comment(# Java port of PyYaml)
+ operator(-) string(ocaml-syck) comment(# Syck bindings for OCaml)
+ operator(-) string(Perl Modules:)
+ operator(-) string(YAML) comment(# Pure Perl YAML Module)
+ operator(-) string(YAML::XS) comment(# Binding to libyaml)
+ operator(-) string(YAML::Syck) comment(# Binding to libsyck)
+ operator(-) string(YAML::Tiny) comment(# A small YAML subset module)
+ operator(-) string(PlYaml) comment(# Perl port of PyYaml)
+ operator(-) string(YamlReference) comment(# Haskell 1.2 reference parser)
+ operator(-) string(YPaste) comment(# Play with the Haskell 1.2 parser)
+ operator(-) string(YamlBeans) comment(# De/serialize Java objects to/from YAML)
+ operator(-) string(Rx) comment(# Simple, Extensible Schemata)
+
+key(News)operator(:)
+ operator(-) string(11-MAY-2008 -- Oren Ben-Kiki has released a new YAML 1.2 spec draft.)
+ operator(-) string(29-NOV-2007 -- Alexey Zakhlestin has updated his Syck (YAML 1.0\) binding for PHP)
+ operator(-) string(23-NOV-2007 -- Derek Wischusen has release Action Script 3 YAML 1.1)
+ operator(-) string(01-AUG-2006 -- Kirill Simonov has released libyaml, a parser and emitter in "C")
+ operator(-) string(06-JUN-2006 -- Ola Bini is at it again, this time with a Java implementation)
+ operator(-) string(03-JUN-2006 -- Christophe Lambrechts and Jonathan Slenders announced a .NET parser)
+ operator(-) string(07-MAY-2006 -- Ola Bini released a pure-ruby YAML 1.1 parser and emitter)
+ operator(-) string(12-APR-2006 -- Kirill's YAML 1.1 parser for Python is now at PyYaml)
+ operator(-) string(05-FEB-2006 -- Spyc YAML for PHP is now at version 0.3)
+ operator(-) string(17-DEC-2005 -- Makoto Kuwata has released Kwalify 0.5, YAML/JSON schema validator)
+ operator(-) string(14-DEC-2005 -- Toby Ho has released Jyaml, a Java library for YAML based on Rolf Veen's work)
+ operator(-) string(30-AUG-2005 -- Kirill Simonov has produce a wonderful Python binding for Syck)
+ operator(-) string(08-APR-2005 -- As it turns out, YAML is a superset of the JSON serialization language)
+ operator(-) string(18-MAY-2005 -- Why has released version 0.55 of Syck)
+ operator(-) string(28-DEC-2004 -- Announcing YAML 1.1 Working Draft)
+ operator(-) string(01-OCT-2004 -- YAML for Cocoa was released by Will Thimbley)
+ operator(-) string(08-FEB-2004 -- Slaven Rezic announced a new version of his Javascript binding)
+ operator(-) string(29-JAN-2004 -- Ingy, Oren, and Clark spent 4 days hacking on the spec in Portland.)
+ operator(-) string(10-OCT-2003 -- The Syck implementation with bindings for Ruby, Python,)
+ string(and PHP is now at version .41)
+ operator(-) string(26-APR-2003 -- Mike Orr has taken over the Pure Python development.)
+ operator(-) string(26-APR-2003 -- Brian Ingerson has created a FIT platform for Wiki-like testing.)
+ operator(-) string(24-JAN-2003 -- Updates to specification.)
+ operator(-) string(25-JUL-2002 -- Both the Ruby and Python parsers have made significant progress.)
+ string(There is an article about YAML by Kendall Grant Clark at xml.com.)
+ string(There is also a draft XML binding.)
+ operator(-) string(02-JUL-2002 -- Brian Ingerson will be giving a 45 minute presentation on YAML at the)
+ string(O'Reilly Open Source Conference in San Diego on July 24th 2002.)
+ operator(-) string(01-FEB-2002 -- Brian's Perl implementation YAML.pm, has been updated with new documentation.)
+ string(Included in this release is YSH, a test shell for learning how YAML works.)
+ operator(-) string(03-JAN-2002 -- YAML(tm\) starts the new year with a new name YAML Ain't Markup Language.)
+ operator(-) string(17-MAY-2001 -- YAML now has a mailing list at SourceForge.)
+ operator(-) string(15-MAY-2001 -- YAML is started with a first pass specification.)
+head<head(...)>
diff --git a/test/scanners/yaml/website.in.yml b/test/scanners/yaml/website.in.yml
new file mode 100644
index 0000000..75b04e9
--- /dev/null
+++ b/test/scanners/yaml/website.in.yml
@@ -0,0 +1,70 @@
+%YAML 1.2
+---
+YAML: YAML Ain't Markup Language
+
+What It Is: YAML is a human friendly data serialization
+ standard for all programming languages.
+
+YAML Resources:
+ YAML 1.2 Specification: http://yaml.org/spec/1.2/
+ YAML 1.1 Specification: http://yaml.org/spec/1.1/
+ YAML Trac Wiki: http://trac.yaml.org/
+ YAML Mailing List: yaml-core@lists.sourceforge.net
+ YAML IRC Channel: "#yaml on irc.freenode.net"
+ YAML Cookbook (Ruby): http://yaml4r.sourceforge.net/cookbook/
+
+Projects:
+ - YAML C Libraries:
+ - libyaml # New Fast YAML (1.1)
+ - Syck # Old Fast YAML (1.0)
+ - PyYaml # YAML 1.1 Implementation
+ - JsYaml # JavaScript PyYaml port
+ - RbYaml # Ruby port of PyYaml
+ - JvYaml # Java port of PyYaml
+ - ocaml-syck # Syck bindings for OCaml
+ - Perl Modules:
+ - YAML # Pure Perl YAML Module
+ - YAML::XS # Binding to libyaml
+ - YAML::Syck # Binding to libsyck
+ - YAML::Tiny # A small YAML subset module
+ - PlYaml # Perl port of PyYaml
+ - YamlReference # Haskell 1.2 reference parser
+ - YPaste # Play with the Haskell 1.2 parser
+ - YamlBeans # De/serialize Java objects to/from YAML
+ - Rx # Simple, Extensible Schemata
+
+News:
+ - 11-MAY-2008 -- Oren Ben-Kiki has released a new YAML 1.2 spec draft.
+ - 29-NOV-2007 -- Alexey Zakhlestin has updated his Syck (YAML 1.0) binding for PHP
+ - 23-NOV-2007 -- Derek Wischusen has release Action Script 3 YAML 1.1
+ - 01-AUG-2006 -- Kirill Simonov has released libyaml, a parser and emitter in "C"
+ - 06-JUN-2006 -- Ola Bini is at it again, this time with a Java implementation
+ - 03-JUN-2006 -- Christophe Lambrechts and Jonathan Slenders announced a .NET parser
+ - 07-MAY-2006 -- Ola Bini released a pure-ruby YAML 1.1 parser and emitter
+ - 12-APR-2006 -- Kirill's YAML 1.1 parser for Python is now at PyYaml
+ - 05-FEB-2006 -- Spyc YAML for PHP is now at version 0.3
+ - 17-DEC-2005 -- Makoto Kuwata has released Kwalify 0.5, YAML/JSON schema validator
+ - 14-DEC-2005 -- Toby Ho has released Jyaml, a Java library for YAML based on Rolf Veen's work
+ - 30-AUG-2005 -- Kirill Simonov has produce a wonderful Python binding for Syck
+ - 08-APR-2005 -- As it turns out, YAML is a superset of the JSON serialization language
+ - 18-MAY-2005 -- Why has released version 0.55 of Syck
+ - 28-DEC-2004 -- Announcing YAML 1.1 Working Draft
+ - 01-OCT-2004 -- YAML for Cocoa was released by Will Thimbley
+ - 08-FEB-2004 -- Slaven Rezic announced a new version of his Javascript binding
+ - 29-JAN-2004 -- Ingy, Oren, and Clark spent 4 days hacking on the spec in Portland.
+ - 10-OCT-2003 -- The Syck implementation with bindings for Ruby, Python,
+ and PHP is now at version .41
+ - 26-APR-2003 -- Mike Orr has taken over the Pure Python development.
+ - 26-APR-2003 -- Brian Ingerson has created a FIT platform for Wiki-like testing.
+ - 24-JAN-2003 -- Updates to specification.
+ - 25-JUL-2002 -- Both the Ruby and Python parsers have made significant progress.
+ There is an article about YAML by Kendall Grant Clark at xml.com.
+ There is also a draft XML binding.
+ - 02-JUL-2002 -- Brian Ingerson will be giving a 45 minute presentation on YAML at the
+ O'Reilly Open Source Conference in San Diego on July 24th 2002.
+ - 01-FEB-2002 -- Brian's Perl implementation YAML.pm, has been updated with new documentation.
+ Included in this release is YSH, a test shell for learning how YAML works.
+ - 03-JAN-2002 -- YAML(tm) starts the new year with a new name YAML Ain't Markup Language.
+ - 17-MAY-2001 -- YAML now has a mailing list at SourceForge.
+ - 15-MAY-2001 -- YAML is started with a first pass specification.
+...