malt 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +18 -0
- data/README.rdoc +6 -2
- data/lib/malt.rb +9 -0
- data/lib/malt/engines/abstract.rb +7 -7
- data/lib/malt/engines/bluecloth.rb +3 -3
- data/lib/malt/engines/builder.rb +72 -0
- data/lib/malt/engines/erb.rb +2 -0
- data/lib/malt/engines/erector.rb +59 -0
- data/lib/malt/engines/haml.rb +2 -2
- data/lib/malt/engines/kramdown.rb +6 -4
- data/lib/malt/engines/less.rb +8 -8
- data/lib/malt/engines/markaby.rb +51 -0
- data/lib/malt/engines/mustache.rb +44 -0
- data/lib/malt/engines/radius.rb +4 -4
- data/lib/malt/engines/ragtag.rb +49 -0
- data/lib/malt/engines/rdiscount.rb +1 -1
- data/lib/malt/engines/rdoc.rb +3 -3
- data/lib/malt/engines/redcloth.rb +1 -1
- data/lib/malt/engines/sass.rb +8 -8
- data/lib/malt/engines/tenjin.rb +6 -6
- data/lib/malt/formats/abstract.rb +8 -2
- data/lib/malt/formats/builder.rb +56 -0
- data/lib/malt/formats/css.rb +8 -8
- data/lib/malt/formats/erector.rb +53 -0
- data/lib/malt/formats/haml.rb +2 -2
- data/lib/malt/formats/html.rb +3 -3
- data/lib/malt/formats/latex.rb +4 -4
- data/lib/malt/formats/less.rb +5 -5
- data/lib/malt/formats/liquid.rb +11 -1
- data/lib/malt/formats/markaby.rb +53 -0
- data/lib/malt/formats/markdown.rb +6 -6
- data/lib/malt/formats/mustache.rb +34 -0
- data/lib/malt/formats/pdf.rb +2 -2
- data/lib/malt/formats/radius.rb +4 -4
- data/lib/malt/formats/{rtals.rb → ragtag.rb} +13 -9
- data/lib/malt/formats/rdoc.rb +4 -4
- data/lib/malt/formats/ruby.rb +2 -2
- data/lib/malt/formats/sass.rb +10 -0
- data/lib/malt/formats/scss.rb +10 -0
- data/lib/malt/formats/tenjin.rb +4 -4
- data/lib/malt/formats/textile.rb +12 -12
- data/lib/malt/formats/xml.rb +29 -0
- data/lib/malt/formats/yaml.rb +2 -2
- data/lib/malt/meta/data.rb +4 -4
- data/lib/malt/meta/{gemfile → package} +6 -2
- data/lib/malt/render.rb +37 -9
- data/meta/data.rb +4 -4
- data/meta/{gemfile → package} +6 -2
- data/qed/03_formats/08_ragtag.rdoc +19 -0
- data/qed/03_formats/17_markaby.rdoc +50 -0
- data/qed/03_formats/18_builder.rb +50 -0
- data/qed/03_formats/19_erector.rb +50 -0
- data/qed/03_formats/20_mustache.rdoc +54 -0
- data/{test/samples/sample.md → qed/samples/sample.markdown} +0 -0
- data/{test → qed}/samples/sample.rdoc +0 -0
- metadata +81 -12
- data/lib/malt/engines/rtals.rb +0 -46
- data/qed/03_formats/08_rtal.rdoc +0 -15
data/lib/malt/engines/rtals.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'malt/engines/abstract'
|
2
|
-
|
3
|
-
module Malt::Engine
|
4
|
-
|
5
|
-
# RTALS
|
6
|
-
#
|
7
|
-
# http://github.com/rubyworks/rtals
|
8
|
-
#
|
9
|
-
class RTALS < Abstract
|
10
|
-
|
11
|
-
default :rtal
|
12
|
-
|
13
|
-
#
|
14
|
-
def render(params, &yld)
|
15
|
-
text = params[:text]
|
16
|
-
file = params[:file]
|
17
|
-
data = params[:data]
|
18
|
-
format = params[:format]
|
19
|
-
|
20
|
-
case format
|
21
|
-
when :html, :xml, nil
|
22
|
-
data = make_binding(data, &yld)
|
23
|
-
intermediate(params).compile(data).to_s
|
24
|
-
else
|
25
|
-
super(params, &yld)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
#
|
30
|
-
def intermediate(params)
|
31
|
-
text = params[:text]
|
32
|
-
::RTAL.new(text)
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
# Load Haml library if not already loaded.
|
38
|
-
def initialize_engine
|
39
|
-
return if defined? ::RTAL
|
40
|
-
require_library 'rtals'
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
data/qed/03_formats/08_rtal.rdoc
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
== RTAL
|
2
|
-
|
3
|
-
Lets say we have a Rtals document called 'test.rtal' containing:
|
4
|
-
|
5
|
-
<h1>Example<span replace="title">DUMMY</span></h1>
|
6
|
-
<p>This is an example of a Rtals template.</p>
|
7
|
-
|
8
|
-
We can render Rtal documents via the +render+ method, as we can any format.
|
9
|
-
|
10
|
-
data = { :title=>"Document" }
|
11
|
-
|
12
|
-
html = Malt.render(:file=>'tmp/test.rtal', :data=>data)
|
13
|
-
|
14
|
-
html.assert.include?('<h1>Example <span>Document</span></h1>')
|
15
|
-
|