wlang 0.8.5 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/CHANGELOG.rdoc +65 -0
  2. data/README.rdoc +85 -31
  3. data/bin/wlang +5 -0
  4. data/doc/specification/dialect.wtpl +14 -0
  5. data/doc/specification/dialects.wtpl +3 -0
  6. data/doc/specification/glossary.wtpl +4 -4
  7. data/doc/specification/rulesets.wtpl +9 -9
  8. data/doc/specification/specification.css +1 -0
  9. data/doc/specification/specification.html +68 -5
  10. data/doc/specification/specification.wtpl +12 -12
  11. data/doc/specification/specification.yml +9 -9
  12. data/doc/specification/symbols.wtpl +8 -8
  13. data/lib/wlang.rb +297 -75
  14. data/lib/wlang/dialect.rb +7 -3
  15. data/lib/wlang/dialects/coderay_dialect.rb +4 -4
  16. data/lib/wlang/dialects/plain_text_dialect.rb +13 -19
  17. data/lib/wlang/dialects/redcloth_dialect.rb +16 -0
  18. data/lib/wlang/dialects/ruby_dialect.rb +16 -2
  19. data/lib/wlang/dialects/standard_dialects.rb +20 -0
  20. data/lib/wlang/dialects/xhtml_dialect.rb +24 -1
  21. data/lib/wlang/encoder.rb +1 -1
  22. data/lib/wlang/encoder_set.rb +5 -0
  23. data/lib/wlang/errors.rb +70 -6
  24. data/lib/wlang/ext/hash_methodize.rb +13 -0
  25. data/lib/wlang/{ruby_extensions.rb → ext/string.rb} +9 -5
  26. data/lib/wlang/hash_scope.rb +89 -0
  27. data/lib/wlang/hosted_language.rb +146 -0
  28. data/lib/wlang/parser.rb +189 -126
  29. data/lib/wlang/parser_state.rb +94 -0
  30. data/lib/wlang/rule_set.rb +16 -3
  31. data/lib/wlang/rulesets/basic_ruleset.rb +14 -6
  32. data/lib/wlang/rulesets/buffering_ruleset.rb +20 -29
  33. data/lib/wlang/rulesets/context_ruleset.rb +16 -20
  34. data/lib/wlang/rulesets/imperative_ruleset.rb +4 -4
  35. data/lib/wlang/rulesets/ruleset_utils.rb +26 -5
  36. data/lib/wlang/template.rb +16 -34
  37. data/lib/wlang/wlang_command.rb +4 -7
  38. data/lib/wlang/wlang_command_options.rb +5 -0
  39. data/test/blackbox/basic/execution_1.exp +1 -0
  40. data/test/blackbox/basic/execution_1.tpl +1 -0
  41. data/test/blackbox/basic/execution_2.exp +1 -0
  42. data/test/blackbox/basic/execution_2.tpl +1 -0
  43. data/test/blackbox/basic/execution_3.exp +1 -0
  44. data/test/blackbox/basic/execution_3.tpl +1 -0
  45. data/test/blackbox/basic/execution_4.exp +1 -0
  46. data/test/blackbox/basic/execution_4.tpl +1 -0
  47. data/test/blackbox/basic/inclusion_1.exp +1 -0
  48. data/test/blackbox/basic/inclusion_1.tpl +1 -0
  49. data/test/blackbox/basic/inclusion_2.exp +1 -0
  50. data/test/blackbox/basic/inclusion_2.tpl +1 -0
  51. data/test/blackbox/basic/injection_1.exp +1 -0
  52. data/test/blackbox/basic/injection_1.tpl +1 -0
  53. data/test/blackbox/basic/injection_2.exp +1 -0
  54. data/test/blackbox/basic/injection_2.tpl +1 -0
  55. data/test/blackbox/basic/modulation_1.exp +1 -0
  56. data/test/blackbox/basic/modulation_1.tpl +1 -0
  57. data/test/blackbox/basic/modulation_2.exp +1 -0
  58. data/test/blackbox/basic/modulation_2.tpl +1 -0
  59. data/test/blackbox/basic/recursive_app_1.exp +1 -0
  60. data/test/blackbox/basic/recursive_app_1.tpl +1 -0
  61. data/test/blackbox/basic/recursive_app_2.exp +1 -0
  62. data/test/blackbox/basic/recursive_app_2.tpl +1 -0
  63. data/test/blackbox/buffering/data_1.rb +1 -0
  64. data/test/blackbox/buffering/data_assignment_1.exp +1 -0
  65. data/test/blackbox/buffering/data_assignment_1.tpl +1 -0
  66. data/test/blackbox/buffering/data_assignment_2.exp +1 -0
  67. data/test/blackbox/buffering/data_assignment_2.tpl +1 -0
  68. data/test/blackbox/buffering/data_assignment_3.exp +1 -0
  69. data/test/blackbox/buffering/data_assignment_3.tpl +1 -0
  70. data/test/blackbox/buffering/data_assignment_4.exp +1 -0
  71. data/test/blackbox/buffering/data_assignment_4.tpl +1 -0
  72. data/test/blackbox/buffering/input_1.exp +1 -0
  73. data/test/blackbox/buffering/input_1.tpl +1 -0
  74. data/test/blackbox/buffering/input_2.exp +1 -0
  75. data/test/blackbox/buffering/input_2.tpl +1 -0
  76. data/test/blackbox/buffering/input_3.exp +1 -0
  77. data/test/blackbox/buffering/input_3.tpl +1 -0
  78. data/test/blackbox/buffering/input_inclusion.exp +1 -0
  79. data/test/blackbox/buffering/input_inclusion.tpl +1 -0
  80. data/test/blackbox/buffering/input_inclusion_1.exp +0 -0
  81. data/test/blackbox/buffering/input_inclusion_1.tpl +1 -0
  82. data/test/blackbox/buffering/input_inclusion_2.exp +1 -0
  83. data/test/blackbox/buffering/input_inclusion_2.tpl +1 -0
  84. data/test/blackbox/buffering/input_inclusion_3.exp +1 -0
  85. data/test/blackbox/buffering/input_inclusion_3.tpl +1 -0
  86. data/test/blackbox/buffering/input_inclusion_4.exp +0 -0
  87. data/test/blackbox/buffering/input_inclusion_4.tpl +1 -0
  88. data/test/blackbox/buffering/input_inclusion_5.exp +1 -0
  89. data/test/blackbox/buffering/input_inclusion_5.tpl +1 -0
  90. data/test/blackbox/buffering/input_inclusion_6.exp +1 -0
  91. data/test/blackbox/buffering/input_inclusion_6.tpl +1 -0
  92. data/test/blackbox/buffering/input_inclusion_7.exp +0 -0
  93. data/test/blackbox/buffering/input_inclusion_7.tpl +1 -0
  94. data/test/blackbox/buffering/text_1.txt +1 -0
  95. data/test/blackbox/buffering/wlang.txt +1 -0
  96. data/test/blackbox/context/assignment_1.exp +1 -0
  97. data/test/blackbox/context/assignment_1.tpl +1 -0
  98. data/test/blackbox/context/assignment_2.exp +1 -0
  99. data/test/blackbox/context/assignment_2.tpl +1 -0
  100. data/test/blackbox/context/assignment_3.exp +2 -0
  101. data/test/blackbox/context/assignment_3.tpl +2 -0
  102. data/test/blackbox/context/assignment_4.exp +1 -0
  103. data/test/blackbox/context/assignment_4.tpl +1 -0
  104. data/test/blackbox/context/block_assignment_1.exp +1 -0
  105. data/test/blackbox/context/block_assignment_1.tpl +1 -0
  106. data/test/blackbox/context/block_assignment_2.exp +1 -0
  107. data/test/blackbox/context/block_assignment_2.tpl +1 -0
  108. data/test/blackbox/context/modulo_assignment_1.exp +1 -0
  109. data/test/blackbox/context/modulo_assignment_1.tpl +1 -0
  110. data/test/blackbox/context/modulo_assignment_2.exp +1 -0
  111. data/test/blackbox/context/modulo_assignment_2.tpl +1 -0
  112. data/test/blackbox/data_1.rb +1 -0
  113. data/test/blackbox/test_all.rb +59 -0
  114. data/test/spec/basic_object.spec +40 -0
  115. data/test/spec/global_extensions.rb +2 -0
  116. data/test/spec/hash_scope.spec +76 -0
  117. data/test/spec/redcloth_dialect.spec +24 -0
  118. data/test/spec/test_all.rb +8 -0
  119. data/test/spec/wlang.spec +53 -0
  120. data/test/spec/xhtml_dialect.spec +23 -0
  121. data/test/{test_all.rb → unit/test_all.rb} +1 -1
  122. data/test/{wlang → unit/wlang}/anagram_bugs_test.rb +2 -2
  123. data/test/{wlang → unit/wlang}/basic_ruleset_test.rb +1 -1
  124. data/test/{wlang → unit/wlang}/buffering_ruleset_test.rb +4 -4
  125. data/test/{wlang → unit/wlang}/buffering_template1.wtpl +0 -0
  126. data/test/{wlang → unit/wlang}/buffering_template2.wtpl +0 -0
  127. data/test/{wlang → unit/wlang}/buffering_template3.wtpl +0 -0
  128. data/test/unit/wlang/buffering_template4.wtpl +1 -0
  129. data/test/unit/wlang/buffering_template5.wtpl +1 -0
  130. data/test/{wlang → unit/wlang}/context_ruleset_test.rb +0 -0
  131. data/test/{wlang → unit/wlang}/data.rb +0 -0
  132. data/test/{wlang → unit/wlang}/encoder_set_test.rb +0 -0
  133. data/test/{wlang → unit/wlang}/imperative_ruleset_test.rb +0 -0
  134. data/test/{wlang → unit/wlang}/intelligent_buffer_test.rb +0 -0
  135. data/test/{wlang → unit/wlang}/othersymbols_test.rb +0 -0
  136. data/test/{wlang → unit/wlang}/parser_test.rb +10 -11
  137. data/test/{wlang → unit/wlang}/plain_text_dialect_test.rb +0 -0
  138. data/test/{wlang → unit/wlang}/ruby_dialect_test.rb +0 -0
  139. data/test/{wlang → unit/wlang}/ruby_expected.rb +0 -0
  140. data/test/{wlang → unit/wlang}/ruby_template.wrb +0 -0
  141. data/test/{wlang → unit/wlang}/ruleset_utils_test.rb +0 -0
  142. data/test/{wlang → unit/wlang}/specification_examples_test.rb +2 -2
  143. data/test/{wlang → unit/wlang}/test_utils.rb +1 -1
  144. data/test/{wlang → unit/wlang}/wlang_test.rb +0 -0
  145. metadata +135 -42
  146. data/lib/wlang/basic_object.rb +0 -19
  147. data/lib/wlang/parser_context.rb +0 -139
  148. data/test/sandbox.rb +0 -1
  149. data/test/wlang/buffering_template4.wtpl +0 -1
  150. data/test/wlang/buffering_template5.wtpl +0 -1
  151. data/test/wlang/parser_context_test.rb +0 -29
@@ -0,0 +1,65 @@
1
+ == Changelog
2
+
3
+ === Version 0.9.1
4
+
5
+ ==== Bug fixes
6
+
7
+ - #307, about HashScope.has_key? which returned nil instead of false in some situations
8
+
9
+ ==== Broken features and APIs (by order of importance)
10
+
11
+ - HostedLanguage::DSL is strictly private and should be reopened. Methods added to this class
12
+ will never be available in templates. Use HostedLanguage.variable_missing instead.
13
+ - ::WLang::BasicObject has been removed. HostedLanguage::DSL implements its own strategy, which
14
+ is spec tested in test/spec/basic_object.spec
15
+
16
+ ==== New features (by order of importance)
17
+
18
+ - WLang does not requires the rdoc gem by default
19
+ - A new encoder redcloth/xhtml allows using Textile markups easily
20
+ - The wlang/xhtml dialect provides a tag helper for links @{...}{...}
21
+ - The parser class returns friendly messages when a rule is ill-implemented
22
+
23
+ === Version 0.9.0
24
+
25
+ ==== Broken features and APIs (by order of importance)
26
+
27
+ - Major broken API in WLang.instantiate and WLang.file_instantiate which do not allow passing
28
+ buffers anymore
29
+ - Hash are not methodized by default anymore (major broken feature with 0.8.x versions)
30
+ - Expressions 'a la' PHP w@w (sections/.../.../id) are not supported anymore
31
+ - The default hosted language raises a WLang::UndefinedVariableError when a variable cannot be
32
+ found in the current template scope (0.8.x versions returned nil in this case)
33
+ - Template.initialize does not take a default context anymore
34
+ - WLang::Parser.context_xxx do not exist anymore. Use branch(...) instead
35
+ - WLang::Parser::Context removed, and WLang::HashScope introduced
36
+ - WLang::Parser instance variables are all made protected
37
+
38
+ ==== New features (by order of importance)
39
+
40
+ - WLang::HostingLanguage introduced, with a default one for Ruby. The hosting language
41
+ is the way to provide a main scope, accessible to all templates at once.
42
+ - WLang::HostingLanguage is not sensitive to the difference between symbol keys and strings
43
+ - Buffering and Context rulesets now branch the current parser instead of creating a new one
44
+ - WLang::Error and subclasses propose a backtrace information
45
+ - WLang::Parser refactored to encapsulate the whole state in another class (WLang::Parser::State)
46
+ - WLang facade has been made much more robust as it now checks all its arguments.
47
+ - WLang::dialect may now be used to ensure dialect instances from both Dialect args and qualified names.
48
+ - Introduction of WLang.template and WLang.file_template
49
+ - plain-text dialect proposes new camel-based encoders
50
+ - wlang/active-string dialect has the imperative rule set included
51
+ - sql dialect has been added
52
+ - ruby dialect proposes a method-case encoder
53
+
54
+ === Version 0.8.5
55
+
56
+ - Enhances error messages a lot
57
+ - Some bug fixes for ruby 0.8.7
58
+
59
+ === Version 0.8.4
60
+
61
+ - Migration from svn.chefbe.net to github.com
62
+
63
+ === Version 0.8.0
64
+
65
+ - First public version
@@ -8,25 +8,39 @@ escaping and the like. WLang proposes a generic engine that you can extend to fi
8
8
  proposes standard instantiations of this engine for common tasks such as creating SQL queries,
9
9
  instantiating web pages, etc.
10
10
 
11
- == Roadmap
11
+ === A collection of typical encoders
12
12
 
13
- - For terminology and a quick overview of _wlang_ for generating code, read on.
14
- - For the current cheatsheet/specification see the file doc/specification/specification.html
15
- - If you want to learn _wlang_ quickly, see the example directory or read examples
16
- in the specification file (if you understand all examples in the specification file, then you
17
- probably master wlang.
18
- - If you want a killer example (but simple) see the way the specification.html file
19
- is generated in doc/specification directory
20
- - If you want to know which dialects are available (that is, in which target languages
21
- you can generate code), see the specification as well or read the file
22
- lib/wlang/dialects/standard_dialects.rb in the source distribution.
23
- - If you want to create your own wlang dialect, see WLang::Dialect::DSL
24
- - If you think that your own dialect is of generic purpose and well-designed, if
25
- you have any question or want to contribute join us on {github}[http://github.com/blambeau/wlang].
13
+ The first basic usage of WLang is to provide a collection of text encoders:
14
+
15
+ WLang::encode('&', 'xhtml/entities-encoding') # &
16
+ WLang::encode("O'Neil", 'sql/single-quoting') # O\'Neil
17
+ WLang::encode("O'Neil", 'sql/sybase/single-quoting') # O''Neil
18
+ ...
19
+ WLang::encode("hello world", 'plain-text/camel') # HelloWorld
20
+ WLang::encode("hello world", 'plain-text/lower-camel') # helloWorld
21
+ ...
22
+ WLang::encode("helloWorld", 'ruby/method-case') # hello_world
23
+
24
+ === A powerful alternative to ruby string interpolation
25
+
26
+ The second usage is to have shortcuts for using these encoders in typical
27
+ situations:
28
+
29
+ # Hello world!
30
+ "Hello ${who}!".wlang(:who => 'world')
31
+
32
+ # Hello cruel & world!
33
+ "Hello ${who}!".wlang({:who => 'cruel & world'}, 'wlang/xhtml')
34
+
35
+ # Hello blambeau, llambeau
36
+ "Hello *{authors as a}{${a}}{, }".wlang(:authors => ['blambeau', 'llambeau'])
26
37
 
27
- == Overview
38
+ # INSERT INTO people VALUES ('O\'Neil')
39
+ INSERT INTO people VALUES ('{who}')".wlang(:who => "O'Neil")
40
+
41
+ === A powerful templating engine
28
42
 
29
- (for bold words, see terminology later) Basic usage of _wlang_ is as follows:
43
+ But the main usage of _wlang_ is as follows (for bold words, see terminology later):
30
44
  you have a *template* file (written in a given _wlang_ *dialect*), you have some
31
45
  instantiation *context* (data provided through a Ruby Hash or a yaml file for
32
46
  example) and you would like to instantiate the template with that data.
@@ -46,23 +60,63 @@ the template is straightforward:
46
60
 
47
61
  require 'wlang'
48
62
  context = {"title" => "Hello world in WLang", "who" => "Alice"}
49
- WLang.file_instantiate("template.whtml", context, STDOUT)
63
+ STDOUT << WLang.file_instantiate("template.whtml", context)
50
64
 
51
- === Seems magic ... but is not!
52
-
53
- - first of all, it <b>does not allow XSS attacks</b>: even if _who_ is a value
54
- like <tt>'<script>[some javascript code]</script>'</tt>, it will be automatically
55
- entities-encoded and will appear for itself, not allowing the browser to interpret
56
- it as javascript code.
57
- - <b>it is not hardcoded</b>, but uses _wlang_ shortcuts:
58
- - as you did not specify the _wlang_ dialect of your template, it has been infered
59
- as 'wlang/xhtml' from the file extension.
60
- - in this dialect, the wlang rule associated with the tag ${...} (<tt>${who}</tt>
61
- for example) automatically replaces the tag by the context data under 'who' (in
62
- the hash), while taking care of applying entities-encoding.
63
- - <b>${...} is only one available tag</b>. Actuall _wlang_ dialects come with a lot
64
- of useful tags that provide shortuct to common tasks ... entities-encoding is only one !
65
+ === Behind the scene
66
+
67
+ - WLang helps you avoiding SQL injection and XSS attacks through the same tags reacting differently
68
+ in different contexts.
69
+ - WLang understands your context (and its dialect) from the template file extension
70
+ - WLang provides a rich collection of pre-defined tags and dialects
71
+ - WLang allows you to create your own encoders, tags and dialects while reusing existing ones
72
+ - WLang may change the current dialect during the template instantiation itself (generating
73
+ html with embedded javascript is easy and natural)
74
+ - WLang is able to generate wlang code without any perturabation
75
+
76
+ === Additional examples (availability of the tags may depend on the dialect)
77
+
78
+ - Include text files on the fly
65
79
 
80
+ <<{my_file.html}
81
+
82
+ - Instantiate sub-templates on the fly, passing data as arguments
83
+
84
+ <<+{my_sub_template.whtml using who: 'wlang'}
85
+
86
+ - Load data from yaml or ruby files on the fly
87
+
88
+ <<={resources.yaml as resources}{
89
+ *{resources as r}{ ${r} }
90
+ }
91
+
92
+ - WLang instrospection (basic example)
93
+
94
+ context = {:varname => 'who', :who => 'wlang'}
95
+ "Hello ${${varname}}!".wlang(context) # => Hello wlang!
96
+
97
+ - Generate a wlang template and instantiate it after that
98
+
99
+ dialect = 'wlang/active-string'
100
+ tpl = "Hello $(${varname})!" # => Hello $(${varname})
101
+ tpl = tpl.wlang(:varname => 'who') # => Hello $(who)!
102
+ tpl = tpl.wlang({:who => 'wlang'}, dialect, :parentheses) # => Hello wlang!
103
+
104
+ == Roadmap
105
+
106
+ - For terminology and a quick overview of _wlang_ for generating code, read on.
107
+ - For the current cheatsheet/specification see the file doc/specification/specification.html
108
+ - If you want to learn _wlang_ quickly, see the example directory or read examples
109
+ in the specification file (if you understand all examples in the specification file, then you
110
+ probably master wlang.
111
+ - If you want a killer example (but simple) see the way the specification.html file
112
+ is generated in doc/specification directory
113
+ - If you want to know which dialects are available (that is, in which target languages
114
+ you can generate code), see the specification as well or read the file
115
+ lib/wlang/dialects/standard_dialects.rb in the source distribution.
116
+ - If you want to create your own wlang dialect, see WLang::Dialect::DSL
117
+ - If you think that your own dialect is of generic purpose and well-designed, if
118
+ you have any question or want to contribute join us on {github}[http://github.com/blambeau/wlang].
119
+
66
120
  == Terminology
67
121
 
68
122
  _wlang_ comes with a well-defined terminology for the underlying abstractions. As
data/bin/wlang CHANGED
@@ -6,11 +6,16 @@
6
6
  # Copyright (c) 2009 University of Louvain, Bernard & Louis Lambeau
7
7
  # Released under a MIT or Ruby licence
8
8
  #
9
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
+ require 'wlang'
9
11
  require 'wlang/wlang_command'
10
12
 
11
13
  begin
12
14
  r = WLang::WLangCommand.new
13
15
  r.run ARGV
16
+ rescue ::WLang::Error => e
17
+ $stderr.puts e.message
18
+ $stderr.puts e.wlang_backtrace.join("\n\t")
14
19
  rescue Interrupt => e
15
20
  $stderr.puts
16
21
  $stderr.puts "Interrupted"
@@ -0,0 +1,14 @@
1
+ <div class="dialect">
2
+ <div style="margin-bottom: 20px">
3
+ <h3 style="display: inline">${dialect.qualified_name}</h3>
4
+ ?{dialect.ruleset}{
5
+ <p style="display: inline">Includes *{dialect.ruleset.reuse as mod}{${mod.name.match(/::([A-Za-z]+)$/)[1]}}{, }</p>
6
+ }
7
+ </div>
8
+
9
+ ?{dialect.dialects}{
10
+ *{dialect.dialects.keys.sort{|k1, k2| k1 <=> k2} as name}{
11
+ <<+{dialect.wtpl with dialect: dialect.dialects[name]}
12
+ }
13
+ }
14
+ </div>
@@ -0,0 +1,3 @@
1
+ *{WLang::dialect_tree.dialect('wlang').dialects using each_pair as name, dialect}{
2
+ <<+{dialect.wtpl with dialect: dialect}
3
+ }
@@ -4,11 +4,11 @@
4
4
  <th class="definition">definition</th>
5
5
  <th class="example">example</th>
6
6
  </tr>
7
- *{spec/glossary as t}{
7
+ *{spec.glossary as t}{
8
8
  <tr>
9
- <td><em>${t/term}</em></td>
10
- <td>^{rdoc/nop}{+{t/definition}}</td>
11
- <td style="font-size: 90%;">^{rdoc/nop}{+{t/example}}</td>
9
+ <td><em>${t.term}</em></td>
10
+ <td>^{rdoc/nop}{+{t.definition}}</td>
11
+ <td style="font-size: 90%;">^{rdoc/nop}{+{t.example}}</td>
12
12
  </tr>
13
13
  }
14
14
  </table>
@@ -39,25 +39,25 @@ doing so (think at all blocks that expect an expression in the hosting language,
39
39
 
40
40
  }}
41
41
  <<={examples.rb as examples}
42
- *{spec/rulesets as ruleset}{
43
- <h3 id="${ruleset/name}">${ruleset/name}</h3>
44
- ^{rdoc/div}{${ruleset/description}}
42
+ *{spec.rulesets as ruleset}{
43
+ <h3 id="${ruleset.name}">${ruleset.name}</h3>
44
+ ^{rdoc/div}{${ruleset.description}}
45
45
  <table class="ruleset">
46
46
  <tr>
47
47
  <th class="signature">signature</th>
48
48
  <th class="name">name</th>
49
49
  <th class="definition">definition</th>
50
50
  </tr>
51
- *{ruleset/rules as rule}{
51
+ *{ruleset.rules as rule}{
52
52
  <tr>
53
- <td class="signature"><tt>${rule/signature}</tt></td>
54
- <td class="name">+{rule/name}</td>
55
- <td class="definition">^{rdoc/nop}{+{rule/definition}}</td>
53
+ <td class="signature"><tt>${rule.signature}</tt></td>
54
+ <td class="name">+{rule.name}</td>
55
+ <td class="definition">^{rdoc/nop}{+{rule.definition}}</td>
56
56
  </tr>
57
57
  }
58
58
  </table>
59
59
 
60
- ?{ruleset/examples}{
60
+ ?{ruleset.examples}{
61
61
  <br/>
62
62
  <h4>Examples:</h4>
63
63
  <table class="examples">
@@ -66,7 +66,7 @@ doing so (think at all blocks that expect an expression in the hosting language,
66
66
  <th>wlang expression</th>
67
67
  <th>replacement value</th>
68
68
  </tr>
69
- *{ruleset/examples as example}{
69
+ *{ruleset.examples as example}{
70
70
  <tr>
71
71
  <td class="dialect">
72
72
  <tt>${example[0]}</tt>
@@ -50,3 +50,4 @@ table.examples td { border-bottom: 1px dashed black; }
50
50
  th.dialect, td.dialect { width: 150px; }
51
51
  th.expression, td.expression { width: 350px; }
52
52
  th.replacement, td.replacement { width: 350px; }
53
+ div.dialect {padding-left: 20px;}
@@ -3,7 +3,7 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
- <title>WLang (version 0.8.4)</title>
6
+ <title>WLang (version 0.9.1)</title>
7
7
  <style type="text/css">
8
8
  body {
9
9
  font-family: arial, verdana, sans-serif;
@@ -57,7 +57,7 @@
57
57
  th.dialect, td.dialect { width: 150px; }
58
58
  th.expression, td.expression { width: 350px; }
59
59
  th.replacement, td.replacement { width: 350px; }
60
-
60
+ div.dialect {padding-left: 20px;}
61
61
  </style>
62
62
  <script type="text/javascript" language="JavaScript"><!--
63
63
  var current = 'about'
@@ -72,7 +72,7 @@
72
72
  //--></script>
73
73
  </head>
74
74
  <body onload="show('about')">
75
- <h1 id="title">WLang (version 0.8.4)</h1>
75
+ <h1 id="title">WLang (version 0.9.1)</h1>
76
76
  <ul id="tabs">
77
77
  <li id="symbolsfocus" onclick="show('symbols')">Tag symbols</li>
78
78
  <li id="glossaryfocus" onclick="show('glossary')">Glossary</li>
@@ -863,7 +863,7 @@
863
863
  replacement value.</td>
864
864
  </tr>
865
865
  <tr>
866
- <td class="signature"><tt>#={wlang/active-string &lt;as x&gt;}{...}{...}</tt></td>
866
+ <td class="signature"><tt>#={wlang/active-string}{...}{...}</tt></td>
867
867
  <td class="name">block-assignment<br/>(third block is optional)</td>
868
868
  <td class="definition"><tt>%={+{@parser.current_dialect} as #1}{#2}{#3}</tt></td>
869
869
  </tr>
@@ -1050,9 +1050,72 @@
1050
1050
 
1051
1051
  <div class="clear"></div>
1052
1052
  </div>
1053
-
1053
+ <div class="dialect">
1054
+ <div style="margin-bottom: 20px">
1055
+ <h3 style="display: inline">wlang/uri</h3>
1056
+ <p style="display: inline">Includes Basic</p>
1057
+
1058
+ </div>
1059
+
1060
+
1061
+ </div>
1062
+ <div class="dialect">
1063
+ <div style="margin-bottom: 20px">
1064
+ <h3 style="display: inline">wlang/sql</h3>
1065
+ <p style="display: inline">Includes Basic, Encoding, Imperative, SQL</p>
1066
+
1067
+ </div>
1068
+
1069
+ <div class="dialect">
1070
+ <div style="margin-bottom: 20px">
1071
+ <h3 style="display: inline">wlang/sql/sybase</h3>
1072
+ <p style="display: inline">Includes Basic, Encoding, Imperative, SQL</p>
1073
+
1074
+ </div>
1075
+
1076
+
1077
+ </div>
1078
+
1079
+
1080
+ </div>
1081
+ <div class="dialect">
1082
+ <div style="margin-bottom: 20px">
1083
+ <h3 style="display: inline">wlang/active-string</h3>
1084
+ <p style="display: inline">Includes Basic, Imperative</p>
1085
+
1086
+ </div>
1087
+
1088
+
1089
+ </div>
1090
+ <div class="dialect">
1091
+ <div style="margin-bottom: 20px">
1092
+ <h3 style="display: inline">wlang/xhtml</h3>
1093
+ <p style="display: inline">Includes Basic, Encoding, Imperative, Buffering, Context, XHtml</p>
1094
+
1095
+ </div>
1096
+
1097
+
1098
+ </div>
1099
+ <div class="dialect">
1100
+ <div style="margin-bottom: 20px">
1101
+ <h3 style="display: inline">wlang/ruby</h3>
1102
+ <p style="display: inline">Includes Basic, Encoding, Imperative, Context, Ruby</p>
1054
1103
 
1055
1104
  </div>
1105
+
1106
+
1107
+ </div>
1108
+ <div class="dialect">
1109
+ <div style="margin-bottom: 20px">
1110
+ <h3 style="display: inline">wlang/dummy</h3>
1111
+
1112
+ </div>
1113
+
1114
+
1115
+ </div>
1116
+
1117
+
1118
+ </div>
1056
1119
  <div id="hosting" style="display: none;">
1057
1120
  <div class="header">
1058
1121
  <h2>Hosting language</h2>
@@ -3,7 +3,7 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
- <title>${spec/title} (version ${spec/version})</title>
6
+ <title>${spec.title} (version ${spec.version})</title>
7
7
  <style type="text/css">
8
8
  <<{specification.css}
9
9
  </style>
@@ -12,28 +12,28 @@
12
12
  //--></script>
13
13
  </head>
14
14
  <body onload="show('about')">
15
- <h1 id="title">${spec/title} (version ${spec/version})</h1>
15
+ <h1 id="title">${spec.title} (version ${spec.version})</h1>
16
16
  <ul id="tabs">
17
- *{spec["sections"].reverse as section}{
18
- <li id="+{section/id}focus" onclick="show('{section/id}')">${section/name}</li>
17
+ *{spec.sections.reverse as section}{
18
+ <li id="+{section.identifier}focus" onclick="show('{section.identifier}')">${section.name}</li>
19
19
  }
20
20
  </ul>
21
21
  <div class="clear"></div>
22
- *{spec/sections as section}{
23
- <div id="{section/id}" style="display: none;">
22
+ *{spec.sections as section}{
23
+ <div id="{section.identifier}" style="display: none;">
24
24
  <div class="header">
25
- <h2>${section/name}</h2>
26
- ?{section/links}{
25
+ <h2>${section.name}</h2>
26
+ ?{section.links}{
27
27
  <ul class="links">
28
- *{+{section/links} as link}{<li><a href="#${link/name}">${link/name}</a></li>}
28
+ *{+{section.links} as link}{<li><a href="#${link.name}">${link.name}</a></li>}
29
29
  </ul>
30
30
  }
31
31
  <div class="clear"></div>
32
32
  </div>
33
- ?{/rdoc$/ =~ "{section/file}"}{
34
- ^{rdoc/div}{<<{+{section/file}}}
33
+ ?{/rdoc$/ =~ "{section.file}"}{
34
+ ^{rdoc/div}{<<{+{section.file}}}
35
35
  }{
36
- <<+{+{section/file} with spec: spec}
36
+ <<+{+{section.file} with spec: spec}
37
37
  }
38
38
  </div>
39
39
  }