tilt 2.0.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +2 -1
  3. data/bin/tilt +2 -110
  4. data/lib/tilt/_emacs_org.rb +2 -0
  5. data/lib/tilt/_handlebars.rb +2 -0
  6. data/lib/tilt/_jbuilder.rb +2 -0
  7. data/lib/tilt/_org.rb +2 -0
  8. data/lib/tilt/asciidoc.rb +11 -23
  9. data/lib/tilt/babel.rb +8 -0
  10. data/lib/tilt/builder.rb +23 -14
  11. data/lib/tilt/cli.rb +134 -0
  12. data/lib/tilt/coffee.rb +17 -25
  13. data/lib/tilt/commonmarker.rb +95 -0
  14. data/lib/tilt/creole.rb +9 -20
  15. data/lib/tilt/csv.rb +9 -21
  16. data/lib/tilt/erb.rb +27 -19
  17. data/lib/tilt/erubi.rb +55 -0
  18. data/lib/tilt/erubis.rb +20 -12
  19. data/lib/tilt/etanni.rb +5 -4
  20. data/lib/tilt/haml.rb +79 -42
  21. data/lib/tilt/kramdown.rb +8 -28
  22. data/lib/tilt/liquid.rb +11 -9
  23. data/lib/tilt/livescript.rb +11 -0
  24. data/lib/tilt/mapping.rb +242 -95
  25. data/lib/tilt/markaby.rb +5 -7
  26. data/lib/tilt/maruku.rb +6 -18
  27. data/lib/tilt/nokogiri.rb +11 -10
  28. data/lib/tilt/pandoc.rb +39 -0
  29. data/lib/tilt/pipeline.rb +19 -0
  30. data/lib/tilt/plain.rb +4 -19
  31. data/lib/tilt/prawn.rb +28 -0
  32. data/lib/tilt/radius.rb +15 -22
  33. data/lib/tilt/rdiscount.rb +17 -33
  34. data/lib/tilt/rdoc.rb +14 -35
  35. data/lib/tilt/redcarpet.rb +20 -93
  36. data/lib/tilt/redcloth.rb +9 -19
  37. data/lib/tilt/rst-pandoc.rb +10 -0
  38. data/lib/tilt/sass.rb +59 -22
  39. data/lib/tilt/slim.rb +5 -0
  40. data/lib/tilt/string.rb +9 -3
  41. data/lib/tilt/template.rb +246 -78
  42. data/lib/tilt/typescript.rb +19 -0
  43. data/lib/tilt/wikicloth.rb +8 -18
  44. data/lib/tilt/yajl.rb +5 -11
  45. data/lib/tilt.rb +91 -41
  46. metadata +39 -102
  47. data/CHANGELOG.md +0 -61
  48. data/Gemfile +0 -39
  49. data/HACKING +0 -16
  50. data/README.md +0 -206
  51. data/Rakefile +0 -95
  52. data/docs/TEMPLATES.md +0 -523
  53. data/docs/common.css +0 -14
  54. data/lib/tilt/bluecloth.rb +0 -24
  55. data/lib/tilt/less.rb +0 -38
  56. data/test/markaby/locals.mab +0 -1
  57. data/test/markaby/markaby.mab +0 -1
  58. data/test/markaby/markaby_other_static.mab +0 -1
  59. data/test/markaby/render_twice.mab +0 -1
  60. data/test/markaby/scope.mab +0 -1
  61. data/test/markaby/yielding.mab +0 -2
  62. data/test/test_helper.rb +0 -64
  63. data/test/tilt_asciidoctor_test.rb +0 -44
  64. data/test/tilt_blueclothtemplate_test.rb +0 -33
  65. data/test/tilt_buildertemplate_test.rb +0 -59
  66. data/test/tilt_cache_test.rb +0 -32
  67. data/test/tilt_coffeescripttemplate_test.rb +0 -104
  68. data/test/tilt_compilesite_test.rb +0 -51
  69. data/test/tilt_creoletemplate_test.rb +0 -24
  70. data/test/tilt_csv_test.rb +0 -65
  71. data/test/tilt_erbtemplate_test.rb +0 -239
  72. data/test/tilt_erubistemplate_test.rb +0 -151
  73. data/test/tilt_etannitemplate_test.rb +0 -174
  74. data/test/tilt_hamltemplate_test.rb +0 -144
  75. data/test/tilt_kramdown_test.rb +0 -20
  76. data/test/tilt_lesstemplate_test.less +0 -1
  77. data/test/tilt_lesstemplate_test.rb +0 -42
  78. data/test/tilt_liquidtemplate_test.rb +0 -78
  79. data/test/tilt_mapping_test.rb +0 -229
  80. data/test/tilt_markaby_test.rb +0 -88
  81. data/test/tilt_markdown_test.rb +0 -174
  82. data/test/tilt_marukutemplate_test.rb +0 -36
  83. data/test/tilt_metadata_test.rb +0 -42
  84. data/test/tilt_nokogiritemplate_test.rb +0 -87
  85. data/test/tilt_radiustemplate_test.rb +0 -75
  86. data/test/tilt_rdiscounttemplate_test.rb +0 -43
  87. data/test/tilt_rdoctemplate_test.rb +0 -29
  88. data/test/tilt_redcarpettemplate_test.rb +0 -59
  89. data/test/tilt_redclothtemplate_test.rb +0 -36
  90. data/test/tilt_sasstemplate_test.rb +0 -41
  91. data/test/tilt_stringtemplate_test.rb +0 -171
  92. data/test/tilt_template_test.rb +0 -316
  93. data/test/tilt_test.rb +0 -60
  94. data/test/tilt_wikiclothtemplate_test.rb +0 -32
  95. data/test/tilt_yajltemplate_test.rb +0 -101
  96. data/tilt.gemspec +0 -107
data/docs/TEMPLATES.md DELETED
@@ -1,523 +0,0 @@
1
- Tilt Templates
2
- ==============
3
-
4
- (See <https://github.com/rtomayko/tilt/blob/master/docs/TEMPLATES.md> for a rendered,
5
- HTML-version of this file).
6
-
7
- While all Tilt templates use the same basic interface for template loading and
8
- evaluation, each varies in its capabilities and available options. Detailed
9
- documentation on each supported template engine is provided below.
10
-
11
- There are also some file extensions that have several implementations
12
- (currently ERB and Markdown). These template classes have certain features
13
- which are guaranteed to work across all the implementations. If you wish to be
14
- compatible with all of these template classes, you should only depend on the
15
- cross-implementation features.
16
-
17
- * [ERB](#erb) - Generic ERB implementation (backed by erb.rb or Erubis)
18
- * [erb.rb](#erbrb) - `Tilt::ERBTemplate`
19
- * [Erubis](#erubis) - `Tilt::ErubisTemplate`
20
- * [Haml](#haml) - `Tilt::HamlTemplate`
21
- * [Liquid](#liquid) - `Tilt::LiquidTemplate`
22
- * Nokogiri - `Tilt::NokogiriTemplate`
23
- * Builder - `Tilt::BuilderTemplate`
24
- * Markaby - `Tilt::MarkabyTemplate`
25
- * [Radius](#radius) - `Tilt::RadiusTemplate`
26
-
27
- Tilt also includes support for CSS processors like [LessCSS][lesscss] and
28
- [Sass][sass], [CoffeeScript][coffee-script] and some simple text formats.
29
-
30
- * Less - `Tilt::LessTemplate`
31
- * Sass - `Tilt::SassTemplate`
32
- * Scss - `Tilt::ScssTemplate`
33
- * CoffeeScript - `Tilt::CoffeeScriptTemplate`
34
- * [Textile](#redcloth) - `Tilt::RedClothTemplate`
35
- * Creole - `Tilt::CreoleTemplate`
36
- * [RDoc](#rdoc) - `Tilt::RDocTemplate`
37
-
38
- Tilt has extensive support for Markdown, backed by one of four different
39
- implementations (depending on which are available on your system):
40
-
41
- * [Markdown](#markdown) - Generic Markdown implementation
42
- * [RDiscount](#rdiscount) - `Tilt::RDiscountTemplate`
43
- * Redcarpet - `Tilt::RedcarpetTemplate`
44
- * BlueCloth - `Tilt::BlueClothTemplate`
45
- * Kramdown - `Tilt::KramdownTemplate`
46
- * Maruku - `Tilt::MarukuTemplate`
47
-
48
- <a name='erb'></a>
49
- ERB (`erb`, `rhtml`)
50
- --------------------
51
-
52
- ERB is a simple but powerful template languge for Ruby. In Tilt it's backed by
53
- [Erubis](#erubis) (if installed on your system) or by [erb.rb](#erbrb) (which
54
- is included in Ruby's standard library). This documentation applies to both
55
- implementations.
56
-
57
- ### Example
58
-
59
- Hello <%= world %>!
60
-
61
- ### Usage
62
-
63
- ERB templates support custom evaluation scopes and locals:
64
-
65
- >> require 'erb'
66
- >> template = Tilt.new('hello.html.erb')
67
- >> template.render(self, :world => 'World!')
68
- => "Hello World!"
69
-
70
- Or, use `Tilt['erb']` directly to process strings:
71
-
72
- template = Tilt['erb'].new { "Hello <%= world %>!" }
73
- template.render(self, :world => 'World!')
74
-
75
- ### Options
76
-
77
- #### `:trim => trim`
78
-
79
- Omits newlines and spaces around certain lines (usually those that starts with
80
- `<%` and ends with `%>`). There isn't a specification for how trimming in ERB
81
- should work, so if you need more control over the whitespace, you should use
82
- [erb.rb](#erbrb) or [Erubis](#erubis) directly.
83
-
84
-
85
- #### `:outvar => '_erbout'`
86
-
87
- The name of the variable used to accumulate template output. This can be
88
- any valid Ruby expression but must be assignable. By default a local
89
- variable named `_erbout` is used.
90
-
91
- <a name='erbrb'></a>
92
- erb.rb (`erb`, `rhtml`)
93
- -----------------------
94
-
95
- [ERB](#erb) implementation available in Ruby's standard library.
96
-
97
- All the documentation of [ERB](#erb) applies in addition to the following:
98
-
99
- ### Usage
100
-
101
- The `Tilt::ERBTemplate` class is registered for all files ending in `.erb` or
102
- `.rhtml` by default, but with a *lower* priority than ErubisTemplate. If you
103
- specifically want to use ERB, it's recommended to use `#prefer`:
104
-
105
- Tilt.prefer Tilt::ERBTemplate
106
-
107
- __NOTE:__ It's suggested that your program `require 'erb'` at load time when
108
- using this template engine within a threaded environment.
109
-
110
- ### Options
111
-
112
- #### `:trim => true`
113
-
114
- The ERB trim mode flags. This is a string consisting of any combination of the
115
- following characters:
116
-
117
- * `'>'` omits newlines for lines ending in `>`
118
- * `'<>'` omits newlines for lines starting with `<%` and ending in `%>`
119
- * `'%'` enables processing of lines beginning with `%`
120
- * `true` is an alias of `<>`
121
-
122
- #### `:safe => nil`
123
-
124
- The `$SAFE` level; when set, ERB code will be run in a
125
- separate thread with `$SAFE` set to the provided level.
126
-
127
- #### `:outvar => '_erbout'`
128
-
129
- The name of the variable used to accumulate template output. This can be
130
- any valid Ruby expression but must be assignable. By default a local
131
- variable named `_erbout` is used.
132
-
133
- ### See also
134
-
135
- * [ERB documentation](http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html)
136
-
137
-
138
- <a name='erubis'></a>
139
- Erubis (`erb`, `rhtml`, `erubis`)
140
- ---------------------------------
141
-
142
- [Erubis][erubis] is a fast, secure, and very extensible implementation of [ERB](#erb).
143
-
144
- All the documentation of [ERB](#erb) applies in addition to the following:
145
-
146
- ### Usage
147
-
148
- The `Tilt::ErubisTemplate` class is registered for all files ending in `.erb` or
149
- `.rhtml` by default, but with a *higher* priority than `ERBTemplate`. If you
150
- specifically want to use Erubis, it's recommended to use `#prefer`:
151
-
152
- Tilt.prefer Tilt::ErubisTemplate
153
-
154
- __NOTE:__ It's suggested that your program `require 'erubis'` at load time when
155
- using this template engine within a threaded environment.
156
-
157
- ### Options
158
-
159
- #### `:engine_class => Erubis::Eruby`
160
-
161
- Allows you to specify a custom engine class to use instead of the
162
- default which is `Erubis::Eruby`.
163
-
164
- #### `:escape_html => false`
165
-
166
- When `true`, `Erubis::EscapedEruby` will be used as the engine class
167
- instead of the default. All content within `<%= %>` blocks will be
168
- automatically html escaped.
169
-
170
- #### `:outvar => '_erbout'`
171
-
172
- The name of the variable used to accumulate template output. This can be
173
- any valid Ruby expression but must be assignable. By default a local
174
- variable named `_erbout` is used.
175
-
176
- #### `:pattern => '<% %>'`
177
-
178
- Set pattern for embedded Ruby code.
179
-
180
- #### `:trim => true`
181
-
182
- Delete spaces around `<% %>`. (But, spaces around `<%= %>` are preserved.)
183
-
184
- ### See also
185
-
186
- * [Erubis Home][erubis]
187
- * [Erubis User's Guide](http://www.kuwata-lab.com/erubis/users-guide.html)
188
-
189
-
190
- <a name='haml'></a>
191
- Haml (`haml`)
192
- -------------
193
-
194
- [Haml][haml] is a markup language that’s used to cleanly and simply describe
195
- the HTML of any web document without the use of inline code. Haml functions as
196
- a replacement for inline page templating systems such as PHP, ASP, and ERB, the
197
- templating language used in most Ruby on Rails applications. However, Haml
198
- avoids the need for explicitly coding HTML into the template, because it itself
199
- is a description of the HTML, with some code to generate dynamic content.
200
- ([more](http://haml.info/about.html))
201
-
202
-
203
- ### Example
204
-
205
- %html
206
- %head
207
- %title= @title
208
- %body
209
- %h1
210
- Hello
211
- = world + '!'
212
-
213
- ### Usage
214
-
215
- The `Tilt::HamlTemplate` class is registered for all files ending in `.haml`
216
- by default. Haml templates support custom evaluation scopes and locals:
217
-
218
- >> require 'haml'
219
- >> template = Tilt.new('hello.haml')
220
- => #<Tilt::HamlTemplate @file='hello.haml'>
221
- >> @title = "Hello Haml!"
222
- >> template.render(self, :world => 'Haml!')
223
- => "
224
- <html>
225
- <head>
226
- <title>Hello Haml!</title>
227
- </head>
228
- <body>
229
- <h1>Hello Haml!</h1>
230
- </body>
231
- </html>"
232
-
233
- Or, use the `Tilt::HamlTemplate` class directly to process strings:
234
-
235
- >> require 'haml'
236
- >> template = Tilt::HamlTemplate.new { "%h1= 'Hello Haml!'" }
237
- => #<Tilt::HamlTemplate @file=nil ...>
238
- >> template.render
239
- => "<h1>Hello Haml!</h1>"
240
-
241
- __NOTE:__ It's suggested that your program `require 'haml'` at load time when
242
- using this template engine within a threaded environment.
243
-
244
- ### Options
245
-
246
- Please see the [Haml Reference](http://haml.info/docs/yardoc/file.HAML_REFERENCE.html#options) for all available options.
247
-
248
- ### See also
249
-
250
- * [#haml.docs](http://haml.info/docs.html)
251
- * [Haml Tutorial](http://haml.info/tutorial.html)
252
- * [Haml Reference](http://haml.info/docs/yardoc/file.HAML_REFERENCE.html)
253
-
254
-
255
- <a name='liquid'></a>
256
- Liquid (`liquid`)
257
- -----------------
258
-
259
- [Liquid][liquid] is for rendering safe templates which cannot affect the
260
- security of the server they are rendered on.
261
-
262
- ### Example
263
-
264
- <html>
265
- <head>
266
- <title>{{ title }}</title>
267
- </head>
268
- <body>
269
- <h1>Hello {{ world }}!</h1>
270
- </body>
271
- </html>
272
-
273
- ### Usage
274
-
275
- `Tilt::LiquidTemplate` is registered for all files ending in `.liquid` by
276
- default. Liquid templates support locals and objects that respond to
277
- `#to_h` as scopes:
278
-
279
- >> require 'liquid'
280
- >> require 'tilt'
281
- >> template = Tilt.new('hello.liquid')
282
- => #<Tilt::LiquidTemplate @file='hello.liquid'>
283
- >> scope = { :title => "Hello Liquid Templates" }
284
- >> template.render(nil, :world => "Liquid")
285
- => "
286
- <html>
287
- <head>
288
- <title>Hello Liquid Templates</title>
289
- </head>
290
- <body>
291
- <h1>Hello Liquid!</h1>
292
- </body>
293
- </html>"
294
-
295
- Or, use `Tilt::LiquidTemplate` directly to process strings:
296
-
297
- >> require 'liquid'
298
- >> template = Tilt::LiquidTemplate.new { "<h1>Hello Liquid!</h1>" }
299
- => #<Tilt::LiquidTemplate @file=nil ...>
300
- >> template.render
301
- => "<h1>Hello Liquid!</h1>"
302
-
303
- __NOTE:__ It's suggested that your program `require 'liquid'` at load
304
- time when using this template engine within a threaded environment.
305
-
306
- ### See also
307
-
308
- * [Liquid for Programmers](https://wiki.github.com/Shopify/liquid/liquid-for-programmers)
309
- * [Liquid Docs](http://liquid.rubyforge.org/)
310
- * GitHub: [Shopify/liquid](https://github.com/Shopify/liquid/)
311
-
312
-
313
- <a name='radius'></a>
314
- Radius (`radius`)
315
- -----------------
316
-
317
- [Radius][radius] is the template language used by [Radiant CMS][radiant]. It is
318
- a tag language designed to be valid XML/HTML.
319
-
320
- ### Example
321
-
322
- <html>
323
- <body>
324
- <h1><r:title /></h1>
325
- <ul class="<r:type />">
326
- <r:repeat times="3">
327
- <li><r:hello />!</li>
328
- </r:repeat>
329
- </ul>
330
- <r:yield />
331
- </body>
332
- </html>
333
-
334
- ### Usage
335
-
336
- To render a template such as the one above.
337
-
338
- scope = OpenStruct.new
339
- scope.title = "Radius Example"
340
- scope.hello = "Hello, World!"
341
-
342
- require 'radius'
343
- template = Tilt::RadiusTemplate.new('example.radius', :tag_prefix=>'r')
344
- template.render(scope, :type=>'hlist'){ "Jackpot!" }
345
-
346
- The result will be:
347
-
348
- <html>
349
- <body>
350
- <h1>Radius Example</h1>
351
- <ul class="hlist">
352
- <li>Hello, World!</li>
353
- <li>Hello, World!</li>
354
- <li>Hello, World!</li>
355
- </ul>
356
- Jackpot!
357
- </body>
358
- </html>
359
-
360
- ### See also
361
-
362
- * [Radius][radius]
363
- * [Radiant CMS][radiant]
364
-
365
-
366
- <a name='textile'></a>
367
- Textile (`textile`)
368
- -------------------
369
-
370
- Textile is a lightweight markup language originally developed by Dean Allen and
371
- billed as a "humane Web text generator". Textile converts its marked-up text
372
- input to valid, well-formed XHTML and also inserts character entity references
373
- for apostrophes, opening and closing single and double quotation marks,
374
- ellipses and em dashes.
375
-
376
- Textile formatted texts are converted to HTML with the [RedCloth][redcloth]
377
- engine, which is a Ruby extension written in C.
378
-
379
- ### Example
380
-
381
- h1. Hello Textile Templates
382
-
383
- Hello World. This is a paragraph.
384
-
385
- ### Usage
386
-
387
- __NOTE:__ It's suggested that your program `require 'redcloth'` at load time
388
- when using this template engine in a threaded environment.
389
-
390
- ### See Also
391
-
392
- * [RedCloth][redcloth]
393
-
394
-
395
- <a name='rdoc'></a>
396
- RDoc (`rdoc`)
397
- -------------
398
-
399
- [RDoc][rdoc] is the simple text markup system that comes with Ruby's standard
400
- library.
401
-
402
- ### Example
403
-
404
- = Hello RDoc Templates
405
-
406
- Hello World. This is a paragraph.
407
-
408
- ### Usage
409
-
410
- __NOTE:__ It's suggested that your program `require 'rdoc'`,
411
- `require 'rdoc/markup'`, and `require 'rdoc/markup/to_html'` at load time
412
- when using this template engine in a threaded environment.
413
-
414
- ### See also
415
-
416
- * [RDoc][rdoc]
417
-
418
-
419
- <a name='markdown'></a>
420
- Markdown (`markdown`, `md`, `mkd`)
421
- ----------------------------------
422
-
423
- [Markdown][markdown] is a lightweight markup language, created by John Gruber
424
- and Aaron Swartz. For any markup that is not covered by Markdown’s syntax, HTML
425
- is used. Marking up plain text with Markdown markup is easy and Markdown
426
- formatted texts are readable.
427
-
428
- Markdown formatted texts are converted to HTML with one of these libraries:
429
-
430
- * [RDiscount](#rdiscount) - `Tilt::RDiscountTemplate`
431
- * Redcarpet - `Tilt::RedcarpetTemplate`
432
- * BlueCloth - `Tilt::BlueClothTemplate`
433
- * Kramdown - `Tilt::KramdownTemplate`
434
- * Maruku - `Tilt::MarukuTemplate`
435
-
436
- Tilt will use fallback mode (as documented in the README) for determining which
437
- library to use. RDiscount has highest priority - Maruku has lowest.
438
-
439
- ### Example
440
-
441
- Hello Markdown Templates
442
- ========================
443
-
444
- Hello World. This is a paragraph.
445
-
446
- ### Usage
447
-
448
- To wrap a Markdown formatted document with a layout:
449
-
450
- layout = Tilt['erb'].new do
451
- "<!doctype html><title></title><%= yield %>"
452
- end
453
- data = Tilt['md'].new { "# hello tilt" }
454
- layout.render { data.render }
455
- # => "<!doctype html><title></title><h1>hello tilt</h1>\n"
456
-
457
- ### Options
458
-
459
- Every implementation of Markdown *should* support these options, but there are
460
- some known problems with the Kramdown and Maruku engines.
461
-
462
- #### `:smartypants => true|false`
463
-
464
- Set `true` to enable [Smarty Pants][smartypants] style punctuation replacement.
465
-
466
- In Kramdown this option only applies to smart quotes. It will apply a
467
- subset of Smarty Pants (e.g. `...` to `…`) regardless of any option.
468
-
469
- Maruku ignores this option and always applies smart quotes (and nothing else).
470
-
471
- #### `:escape_html => true|false`
472
-
473
- Set `true` disallow raw HTML in Markdown contents. HTML is converted to
474
- literal text by escaping `<` characters.
475
-
476
- Kramdown and Maruku doesn't support this option.
477
-
478
- ### See also
479
-
480
- * [Markdown Syntax Documentation](http://daringfireball.net/projects/markdown/syntax/)
481
-
482
- <a name='rdiscount'></a>
483
- RDiscount (`markdown`, `md`, `mkd`)
484
- -----------------------------------
485
-
486
- [Discount][discount] is an implementation of the Markdown markup language in C.
487
- [RDiscount][rdiscount] is a Ruby wrapper around Discount.
488
-
489
- All the documentation of [Markdown](#markdown) applies in addition to the following:
490
-
491
- ### Usage
492
-
493
- The `Tilt::RDiscountTemplate` class is registered for all files ending in
494
- `.markdown`, `.md` or `.mkd` by default with the highest priority. If you
495
- specifically want to use RDiscount, it's recommended to use `#prefer`:
496
-
497
- Tilt.prefer Tilt::RDiscountTemplate
498
-
499
- __NOTE:__ It's suggested that your program `require 'erubis'` at load time when
500
- using this template engine within a threaded environment.
501
-
502
- ### See also
503
-
504
- * [Discount][discount]
505
- * [RDiscount][rdiscount]
506
- * GitHub: [rtomayko/rdiscount][rdiscount]
507
-
508
-
509
- [lesscss]: http://lesscss.org/ "Less CSS"
510
- [sass]: http://sass-lang.com/ "Sass"
511
- [coffee-script]: http://jashkenas.github.com/coffee-script/ "Coffee Script"
512
- [erubis]: http://www.kuwata-lab.com/erubis/ "Erubis"
513
- [haml]: http://haml.info/ "Haml"
514
- [liquid]: http://www.liquidmarkup.org/ "Liquid"
515
- [radius]: http://radius.rubyforge.org/ "Radius"
516
- [radiant]: http://radiantcms.org/ "Radiant CMS"
517
- [redcloth]: http://redcloth.org/ "RedCloth"
518
- [rdoc]: http://rdoc.rubyforge.org/ "RDoc"
519
- [discount]: http://www.pell.portland.or.us/~orc/Code/discount/ "Discount"
520
- [rdiscount]: http://github.com/rtomayko/rdiscount/ "RDiscount"
521
- [smartypants]: http://daringfireball.net/projects/smartypants/ "Smarty Pants"
522
- [markdown]: http://en.wikipedia.org/wiki/Markdown "Markdown"
523
-
data/docs/common.css DELETED
@@ -1,14 +0,0 @@
1
- body {
2
- line-height: 1.5;
3
- font-size: 14px;
4
- }
5
-
6
- .frames #content {
7
- margin: 0;
8
- }
9
-
10
- #content {
11
- margin: 0 auto;
12
- max-width: 720px;
13
- }
14
-
@@ -1,24 +0,0 @@
1
- require 'tilt/template'
2
- require 'bluecloth'
3
-
4
- module Tilt
5
- # BlueCloth Markdown implementation. See:
6
- # http://deveiate.org/projects/BlueCloth/
7
- class BlueClothTemplate < Template
8
- self.default_mime_type = 'text/html'
9
-
10
- def prepare
11
- @engine = BlueCloth.new(data, options)
12
- @output = nil
13
- end
14
-
15
- def evaluate(scope, locals, &block)
16
- @output ||= @engine.to_html
17
- end
18
-
19
- def allows_script?
20
- false
21
- end
22
- end
23
- end
24
-
data/lib/tilt/less.rb DELETED
@@ -1,38 +0,0 @@
1
- require 'tilt/template'
2
- require 'less'
3
-
4
- module Tilt
5
- # Lessscss template implementation. See:
6
- # http://lesscss.org/
7
- #
8
- # Less templates do not support object scopes, locals, or yield.
9
- class LessTemplate < Template
10
- self.default_mime_type = 'text/css'
11
-
12
- def self.engine_initialized?
13
- defined? ::Less
14
- end
15
-
16
- def initialize_engine
17
- require_template_library 'less'
18
- end
19
-
20
- def prepare
21
- if ::Less.const_defined? :Engine
22
- @engine = ::Less::Engine.new(data)
23
- else
24
- parser = ::Less::Parser.new(options.merge :filename => eval_file, :line => line)
25
- @engine = parser.parse(data)
26
- end
27
- end
28
-
29
- def evaluate(scope, locals, &block)
30
- @output ||= @engine.to_css(options)
31
- end
32
-
33
- def allows_script?
34
- false
35
- end
36
- end
37
- end
38
-
@@ -1 +0,0 @@
1
- li foo
@@ -1 +0,0 @@
1
- text "hello from markaby!"
@@ -1 +0,0 @@
1
- text "_why?"
@@ -1 +0,0 @@
1
- text "foo"
@@ -1 +0,0 @@
1
- li foo
@@ -1,2 +0,0 @@
1
- text("Hey ")
2
- yield
data/test/test_helper.rb DELETED
@@ -1,64 +0,0 @@
1
- $LOAD_PATH << File.expand_path('../../lib', __FILE__)
2
-
3
- require 'bundler'
4
- Bundler.setup
5
-
6
- require 'minitest/autorun'
7
- require 'minitest/mock'
8
-
9
- # Contest adds +teardown+, +test+ and +context+ as class methods, and the
10
- # instance methods +setup+ and +teardown+ now iterate on the corresponding
11
- # blocks. Note that all setup and teardown blocks must be defined with the
12
- # block syntax. Adding setup or teardown instance methods defeats the purpose
13
- # of this library.
14
- class Minitest::Test
15
- def self.setup(&block)
16
- define_method :setup do
17
- super(&block)
18
- instance_eval(&block)
19
- end
20
- end
21
-
22
- def self.teardown(&block)
23
- define_method :teardown do
24
- instance_eval(&block)
25
- super(&block)
26
- end
27
- end
28
-
29
- def self.context(name, &block)
30
- subclass = Class.new(self)
31
- remove_tests(subclass)
32
- subclass.class_eval(&block) if block_given?
33
- const_set(context_name(name), subclass)
34
- end
35
-
36
- def self.test(name, &block)
37
- define_method(test_name(name), &block)
38
- end
39
-
40
- class << self
41
- alias_method :should, :test
42
- alias_method :describe, :context
43
- end
44
-
45
- private
46
-
47
- def self.context_name(name)
48
- "Test#{sanitize_name(name).gsub(/(^| )(\w)/) { $2.upcase }}".to_sym
49
- end
50
-
51
- def self.test_name(name)
52
- "test_#{sanitize_name(name).gsub(/\s+/,'_')}".to_sym
53
- end
54
-
55
- def self.sanitize_name(name)
56
- name.gsub(/\W+/, ' ').strip
57
- end
58
-
59
- def self.remove_tests(subclass)
60
- subclass.public_instance_methods.grep(/^test_/).each do |meth|
61
- subclass.send(:undef_method, meth.to_sym)
62
- end
63
- end
64
- end