pith 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.markdown +1 -1
- data/cucumber.yml +1 -1
- data/features/layouts.feature +7 -7
- data/features/relative_linking.feature +2 -2
- data/features/step_definitions/build_steps.rb +1 -1
- data/features/textile.feature +11 -5
- data/lib/pith/input.rb +1 -0
- data/lib/pith/plugins/compass.rb +1 -1
- data/lib/pith/render_context.rb +0 -3
- data/lib/pith/version.rb +1 -1
- data/spec/pith/config_spec.rb +9 -9
- data/spec/pith/input_spec.rb +17 -9
- data/spec/pith/pathname_ext_spec.rb +5 -5
- data/spec/pith/plugins/publication_spec.rb +7 -7
- data/spec/pith/project_spec.rb +13 -13
- data/spec/pith/server_spec.rb +8 -9
- data/spec/spec_helper.rb +2 -0
- metadata +74 -140
- data/features/content_for.feature~ +0 -29
- data/features/haml.feature~ +0 -24
- data/features/helpers.feature~ +0 -23
- data/features/ignorance.feature~ +0 -37
- data/features/include.feature~ +0 -84
- data/features/incremental_rebuild.feature~ +0 -24
- data/features/layouts.feature~ +0 -63
- data/features/linking.feature~ +0 -79
- data/features/metadata.feature~ +0 -20
- data/features/relative_linking.feature~ +0 -109
- data/features/step_definitions/build_steps.rb~ +0 -66
- data/features/support/env.rb~ +0 -86
- data/features/support/rspec_matchers.rb~ +0 -5
- data/features/textile.feature~ +0 -29
- data/features/verbatim.feature~ +0 -32
- data/lib/pith.rb~ +0 -1
- data/lib/pith/console_logger.rb~ +0 -16
- data/lib/pith/input.rb~ +0 -20
- data/lib/pith/metadata.rb~ +0 -26
- data/lib/pith/pathname_ext.rb~ +0 -16
- data/lib/pith/plugins/publication.rb~ +0 -2
- data/lib/pith/plugins/publication/input.rb~ +0 -50
- data/lib/pith/plugins/publication/project.rb~ +0 -14
- data/lib/pith/project.rb~ +0 -143
- data/lib/pith/reference_error.rb~ +0 -5
- data/lib/pith/render_context.rb~ +0 -117
- data/lib/pith/server.rb~ +0 -46
- data/lib/pith/version.rb~ +0 -3
- data/lib/pith/watcher.rb~ +0 -32
- data/sample/_out/index.html +0 -14
- data/sample/_out/stylesheets/app.css +0 -38
data/features/helpers.feature~
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
Feature: helper methods
|
2
|
-
|
3
|
-
I want to extend Pith with helper methods
|
4
|
-
So that I can use them in templates
|
5
|
-
|
6
|
-
Scenario: call a helper from a template
|
7
|
-
|
8
|
-
Given input file "_pith/config.rb" contains
|
9
|
-
"""
|
10
|
-
project.helpers do
|
11
|
-
|
12
|
-
def greet(subject = "mate")
|
13
|
-
"Hello, #{subject}"
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
"""
|
18
|
-
|
19
|
-
And input file "index.html.haml" contains "= greet('World')"
|
20
|
-
|
21
|
-
When I build the site
|
22
|
-
|
23
|
-
Then output file "index.html" should contain "Hello, World"
|
data/features/ignorance.feature~
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
Feature: ignorable files are ignored
|
2
|
-
|
3
|
-
I want any file (or directory) beginning with "_" to be ignored
|
4
|
-
So that I can place supporting files anywhere within the input directory
|
5
|
-
|
6
|
-
Scenario: a layout template at the input root
|
7
|
-
|
8
|
-
Given input file "_layout.haml" contains
|
9
|
-
"""
|
10
|
-
Blah de blah
|
11
|
-
"""
|
12
|
-
|
13
|
-
When I build the site
|
14
|
-
|
15
|
-
Then output file "_layout" should not exist
|
16
|
-
|
17
|
-
Scenario: a partial in an ignored subdirectory
|
18
|
-
|
19
|
-
Given input file "_partials/foo.html.haml" contains
|
20
|
-
"""
|
21
|
-
Blah de blah
|
22
|
-
"""
|
23
|
-
|
24
|
-
When I build the site
|
25
|
-
|
26
|
-
Then output file "_partials/foo.html" should not exist
|
27
|
-
|
28
|
-
Scenario: an ignored partial in a subdirectory
|
29
|
-
|
30
|
-
Given input file "partials/_foo.html.haml" contains
|
31
|
-
"""
|
32
|
-
Blah de blah
|
33
|
-
"""
|
34
|
-
|
35
|
-
When I build the site
|
36
|
-
|
37
|
-
Then output file "partials/_foo.html" should not exist
|
data/features/include.feature~
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
Feature: templates can include other templates
|
2
|
-
|
3
|
-
I want to be able to include partials
|
4
|
-
So that I can reuse template fragments
|
5
|
-
|
6
|
-
Scenario: include a partial
|
7
|
-
|
8
|
-
Given input file "index.html.haml" contains "= include('_fragment.haml')"
|
9
|
-
And input file "_fragment.haml" contains "%p blah blah"
|
10
|
-
When I build the site
|
11
|
-
Then output file "index.html" should contain "<p>blah blah</p>"
|
12
|
-
|
13
|
-
Scenario: include a partial in the same sub-directory
|
14
|
-
|
15
|
-
Given input file "subdir/page.html.haml" contains "= include('_fragment.haml')"
|
16
|
-
And input file "subdir/_fragment.haml" contains "%p blah blah"
|
17
|
-
When I build the site
|
18
|
-
Then output file "subdir/page.html" should contain "<p>blah blah</p>"
|
19
|
-
|
20
|
-
Scenario: nested includes, differing directories
|
21
|
-
|
22
|
-
Given input file "page.html.haml" contains "= include('_partials/foo.haml')"
|
23
|
-
And input file "_partials/foo.haml" contains "= include('bar.haml')"
|
24
|
-
And input file "_partials/bar.haml" contains "bananas"
|
25
|
-
When I build the site
|
26
|
-
Then output file "page.html" should contain "bananas"
|
27
|
-
|
28
|
-
Scenario: include a partial located relative to site root
|
29
|
-
|
30
|
-
Given input file "subdir/page.html.haml" contains "= include('/_partials/fragment.haml')"
|
31
|
-
And input file "_partials/fragment.haml" contains "%p blah blah"
|
32
|
-
When I build the site
|
33
|
-
Then output file "subdir/page.html" should contain "<p>blah blah</p>"
|
34
|
-
|
35
|
-
Scenario: pass local variable to a partial
|
36
|
-
|
37
|
-
Given input file "index.html.haml" contains
|
38
|
-
"""
|
39
|
-
= include("_list.haml", :items => [1,2,3])
|
40
|
-
"""
|
41
|
-
|
42
|
-
And input file "_list.haml" contains
|
43
|
-
"""
|
44
|
-
%ul
|
45
|
-
- items.each do |i|
|
46
|
-
%li= i
|
47
|
-
"""
|
48
|
-
|
49
|
-
When I build the site
|
50
|
-
|
51
|
-
Then output file "index.html" should contain
|
52
|
-
"""
|
53
|
-
<ul>
|
54
|
-
<li>1</li>
|
55
|
-
<li>2</li>
|
56
|
-
<li>3</li>
|
57
|
-
</ul>
|
58
|
-
"""
|
59
|
-
|
60
|
-
Scenario: use instance variable in a partial
|
61
|
-
|
62
|
-
Given input file "index.html.haml" contains
|
63
|
-
"""
|
64
|
-
- @items = [1,2,3]
|
65
|
-
= include("_list.haml")
|
66
|
-
"""
|
67
|
-
|
68
|
-
And input file "_list.haml" contains
|
69
|
-
"""
|
70
|
-
%ul
|
71
|
-
- @items.each do |i|
|
72
|
-
%li= i
|
73
|
-
"""
|
74
|
-
|
75
|
-
When I build the site
|
76
|
-
|
77
|
-
Then output file "index.html" should contain
|
78
|
-
"""
|
79
|
-
<ul>
|
80
|
-
<li>1</li>
|
81
|
-
<li>2</li>
|
82
|
-
<li>3</li>
|
83
|
-
</ul>
|
84
|
-
"""
|
@@ -1,24 +0,0 @@
|
|
1
|
-
Feature: incremental rebuilding
|
2
|
-
|
3
|
-
I want to rebuild just the outputs whose inputs have changed
|
4
|
-
So that that I can bring the project up-to-date efficiently
|
5
|
-
|
6
|
-
Scenario: alter an input, and the output changes
|
7
|
-
|
8
|
-
Given input file "page.html.haml" contains "Old content"
|
9
|
-
And the site is up-to-date
|
10
|
-
|
11
|
-
When I change input file "page.html.haml" to contain "New content"
|
12
|
-
And I rebuild the site
|
13
|
-
|
14
|
-
Then output file "page.html" should be re-generated
|
15
|
-
And output file "page.html" should contain "New content"
|
16
|
-
|
17
|
-
Scenario: don't alter an input, and the output is untouched
|
18
|
-
|
19
|
-
Given input file "page.html.haml" contains "Content"
|
20
|
-
And the site is up-to-date
|
21
|
-
|
22
|
-
When I rebuild the site
|
23
|
-
|
24
|
-
Then output file "page.html" should not be re-generated
|
data/features/layouts.feature~
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
Feature: templates can be used as layouts
|
2
|
-
|
3
|
-
I want to be able to apply a layout
|
4
|
-
So that I can reuse template patterns
|
5
|
-
|
6
|
-
Scenario: Haml template with a layout
|
7
|
-
|
8
|
-
Given input file "index.html.haml" contains
|
9
|
-
"""
|
10
|
-
= include "layouts/_simple.haml" do
|
11
|
-
blah blah
|
12
|
-
"""
|
13
|
-
And input file "layouts/_simple.haml" contains
|
14
|
-
"""
|
15
|
-
%p= yield
|
16
|
-
"""
|
17
|
-
|
18
|
-
When I build the site
|
19
|
-
Then output file "index.html" should contain
|
20
|
-
"""
|
21
|
-
<p>blah blah</p>
|
22
|
-
"""
|
23
|
-
|
24
|
-
Scenario: instance variable assigned within the layed-out block
|
25
|
-
|
26
|
-
Given input file "index.html.haml" contains
|
27
|
-
"""
|
28
|
-
= include "layouts/_with_header.haml" do
|
29
|
-
- @title = "XXX"
|
30
|
-
%p blah blah
|
31
|
-
"""
|
32
|
-
And input file "layouts/_with_header.haml" contains
|
33
|
-
"""
|
34
|
-
%h1= @title
|
35
|
-
= yield
|
36
|
-
"""
|
37
|
-
|
38
|
-
When I build the site
|
39
|
-
Then output file "index.html" should contain
|
40
|
-
"""
|
41
|
-
<h1>XXX</h1>
|
42
|
-
<p>blah blah</p>
|
43
|
-
"""
|
44
|
-
|
45
|
-
Scenario: Layout specified in meta-data
|
46
|
-
|
47
|
-
Given input file "index.html.haml" contains
|
48
|
-
"""
|
49
|
-
-# ---
|
50
|
-
-# layout: layouts/_simple.haml
|
51
|
-
-#...
|
52
|
-
blah blah
|
53
|
-
"""
|
54
|
-
And input file "layouts/_simple.haml" contains
|
55
|
-
"""
|
56
|
-
%p= yield
|
57
|
-
"""
|
58
|
-
|
59
|
-
When I build the site
|
60
|
-
Then output file "index.html" should contain
|
61
|
-
"""
|
62
|
-
<p>blah blah</p>
|
63
|
-
"""
|
data/features/linking.feature~
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
Feature: linking between files
|
2
|
-
|
3
|
-
I want to be able to link pages easily
|
4
|
-
|
5
|
-
Scenario: link from one top-level page to another
|
6
|
-
|
7
|
-
Given input file "index.html.haml" contains
|
8
|
-
"""
|
9
|
-
= link("page.html", "Page")
|
10
|
-
"""
|
11
|
-
|
12
|
-
When I build the site
|
13
|
-
Then output file "index.html" should contain
|
14
|
-
"""
|
15
|
-
<a href="page.html">Page</a>
|
16
|
-
"""
|
17
|
-
|
18
|
-
Scenario: link from a sub-directory to a root-level page
|
19
|
-
|
20
|
-
Given input file "subdir/page.html.haml" contains
|
21
|
-
"""
|
22
|
-
= link("/help.html", "Help")
|
23
|
-
"""
|
24
|
-
|
25
|
-
When I build the site
|
26
|
-
Then output file "subdir/page.html" should contain
|
27
|
-
"""
|
28
|
-
<a href="../help.html">Help</a>
|
29
|
-
"""
|
30
|
-
|
31
|
-
Scenario: link to an image
|
32
|
-
|
33
|
-
Given input file "subdir/page.html.haml" contains
|
34
|
-
"""
|
35
|
-
%img{:src => href("/logo.png")}
|
36
|
-
"""
|
37
|
-
|
38
|
-
When I build the site
|
39
|
-
Then output file "subdir/page.html" should contain
|
40
|
-
"""
|
41
|
-
<img src='../logo.png' />
|
42
|
-
"""
|
43
|
-
|
44
|
-
Scenario: links within a layout block
|
45
|
-
|
46
|
-
Given input file "subdir/page.html.haml" contains
|
47
|
-
"""
|
48
|
-
= include "/common/_layout.haml" do
|
49
|
-
= link "other.html", "Other page"
|
50
|
-
"""
|
51
|
-
|
52
|
-
And input file "common/_layout.haml" contains
|
53
|
-
"""
|
54
|
-
= yield
|
55
|
-
"""
|
56
|
-
|
57
|
-
When I build the site
|
58
|
-
Then output file "subdir/page.html" should contain
|
59
|
-
"""
|
60
|
-
<a href="other.html">Other page</a>
|
61
|
-
"""
|
62
|
-
|
63
|
-
Scenario: links included from a partial
|
64
|
-
|
65
|
-
Given input file "subdir/page.html.haml" contains
|
66
|
-
"""
|
67
|
-
= include "/common/_partial.haml"
|
68
|
-
"""
|
69
|
-
|
70
|
-
And input file "common/_partial.haml" contains
|
71
|
-
"""
|
72
|
-
%link{ :href=>href("/stylesheets/app.css"), :rel=>"stylesheet", :type=>"text/css" }
|
73
|
-
"""
|
74
|
-
|
75
|
-
When I build the site
|
76
|
-
Then output file "subdir/page.html" should contain
|
77
|
-
"""
|
78
|
-
<link href='../stylesheets/app.css' rel='stylesheet' type='text/css' />
|
79
|
-
"""
|
data/features/metadata.feature~
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: metadata
|
2
|
-
|
3
|
-
I want extract metadata from page source
|
4
|
-
So that I can use it elsewhere
|
5
|
-
|
6
|
-
Scenario: link from one top-level page to another
|
7
|
-
|
8
|
-
Given input file "page.html.haml" contains
|
9
|
-
"""
|
10
|
-
-# ---
|
11
|
-
-# title: PAGE TITLE
|
12
|
-
-# ...
|
13
|
-
%h1= meta["title"]
|
14
|
-
"""
|
15
|
-
|
16
|
-
When I build the site
|
17
|
-
Then output file "page.html" should contain
|
18
|
-
"""
|
19
|
-
<h1>PAGE TITLE</h1>
|
20
|
-
"""
|
@@ -1,109 +0,0 @@
|
|
1
|
-
Feature: linking between files
|
2
|
-
|
3
|
-
I want to be able to generate relative reference to other pages
|
4
|
-
So that the generated site is re-locateable
|
5
|
-
|
6
|
-
Scenario: link from one top-level page to another
|
7
|
-
|
8
|
-
Given input file "index.html.haml" contains
|
9
|
-
"""
|
10
|
-
= link("page.html", "Page")
|
11
|
-
"""
|
12
|
-
And input file "page.html" exists
|
13
|
-
|
14
|
-
When I build the site
|
15
|
-
Then output file "index.html" should contain
|
16
|
-
"""
|
17
|
-
<a href="page.html">Page</a>
|
18
|
-
"""
|
19
|
-
|
20
|
-
Scenario: link from a sub-directory to a root-level page
|
21
|
-
|
22
|
-
Given input file "subdir/page.html.haml" contains
|
23
|
-
"""
|
24
|
-
= link("/help.html", "Help")
|
25
|
-
"""
|
26
|
-
And input file "help.html" exists
|
27
|
-
|
28
|
-
When I build the site
|
29
|
-
Then output file "subdir/page.html" should contain
|
30
|
-
"""
|
31
|
-
<a href="../help.html">Help</a>
|
32
|
-
"""
|
33
|
-
|
34
|
-
Scenario: link to an image
|
35
|
-
|
36
|
-
Given input file "subdir/page.html.haml" contains
|
37
|
-
"""
|
38
|
-
%img{:src => href("/logo.png")}
|
39
|
-
"""
|
40
|
-
And input file "logo.png" exists
|
41
|
-
|
42
|
-
When I build the site
|
43
|
-
Then output file "subdir/page.html" should contain
|
44
|
-
"""
|
45
|
-
<img src='../logo.png' />
|
46
|
-
"""
|
47
|
-
|
48
|
-
Scenario: links within a layout block
|
49
|
-
|
50
|
-
Given input file "subdir/page.html.haml" contains
|
51
|
-
"""
|
52
|
-
= include "/common/_layout.haml" do
|
53
|
-
= link "other.html", "Other page"
|
54
|
-
"""
|
55
|
-
|
56
|
-
And input file "common/_layout.haml" contains
|
57
|
-
"""
|
58
|
-
= yield
|
59
|
-
"""
|
60
|
-
|
61
|
-
And input file "subdir/other.html" exists
|
62
|
-
|
63
|
-
When I build the site
|
64
|
-
Then output file "subdir/page.html" should contain
|
65
|
-
"""
|
66
|
-
<a href="other.html">Other page</a>
|
67
|
-
"""
|
68
|
-
|
69
|
-
Scenario: links included from a partial
|
70
|
-
|
71
|
-
Given input file "subdir/page.html.haml" contains
|
72
|
-
"""
|
73
|
-
= include "/common/_partial.haml"
|
74
|
-
"""
|
75
|
-
|
76
|
-
And input file "common/_partial.haml" contains
|
77
|
-
"""
|
78
|
-
%link{ :href=>href("/stylesheets/app.css"), :rel=>"stylesheet", :type=>"text/css" }
|
79
|
-
"""
|
80
|
-
|
81
|
-
And input file "stylesheets/app.css" exists
|
82
|
-
|
83
|
-
When I build the site
|
84
|
-
Then output file "subdir/page.html" should contain
|
85
|
-
"""
|
86
|
-
<link href='../stylesheets/app.css' rel='stylesheet' type='text/css' />
|
87
|
-
"""
|
88
|
-
|
89
|
-
Scenario: use "title" meta-data attribute in link
|
90
|
-
|
91
|
-
Given input file "index.html.haml" contains
|
92
|
-
"""
|
93
|
-
= link("page.html")
|
94
|
-
"""
|
95
|
-
|
96
|
-
And input file "page.html.haml" contains
|
97
|
-
"""
|
98
|
-
-# ---
|
99
|
-
-# title: "Title from meta-data"
|
100
|
-
-# ...
|
101
|
-
Target content
|
102
|
-
"""
|
103
|
-
|
104
|
-
When I build the site
|
105
|
-
|
106
|
-
Then output file "index.html" should contain
|
107
|
-
"""
|
108
|
-
<a href="page.html">Title from meta-data</a>
|
109
|
-
"""
|