pith 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +46 -0
- data/features/compass.feature +38 -0
- data/features/step_definitions/build_steps.rb +2 -2
- data/lib/pith/config.rb +2 -0
- data/lib/pith/plugins/compass.rb +28 -0
- data/lib/pith/version.rb +1 -1
- metadata +27 -25
data/README.markdown
CHANGED
@@ -214,6 +214,52 @@ For even quicker prototyping, Pith includes a simple HTTP server. Start it by u
|
|
214
214
|
|
215
215
|
Pith will incrementally re-build the site as you browse -- that is, if you alter any input files, Pith will regenerate the affected outputs.
|
216
216
|
|
217
|
+
Plugins
|
218
|
+
-------
|
219
|
+
|
220
|
+
Pith includes a couple of optional "plugins". Actually, "plugin" is a bit strong: they're just plain old Ruby modules that extend Pith's functionality.
|
221
|
+
|
222
|
+
### Publication plugin
|
223
|
+
|
224
|
+
The 'publication' plugin makes it easier to build a weblog using Pith.
|
225
|
+
|
226
|
+
Enable it by requiring it in your "`config.rb`", like so:
|
227
|
+
|
228
|
+
require "pith/plugins/publication"
|
229
|
+
|
230
|
+
Now you can specify a "published" date/time in the metadata of any pages you consider to be "articles", e.g.
|
231
|
+
|
232
|
+
---
|
233
|
+
title: Introducing ShamRack
|
234
|
+
published: 3-July-2009, 15:50
|
235
|
+
...
|
236
|
+
|
237
|
+
This exposes "`page.published_at`" for use in your templates.
|
238
|
+
|
239
|
+
In addition, "`project.published_inputs`" lists all the pages that have such a timestamp, in order of publication, making it easy to build index pages and XML feeds. Here's a example, used to build the article index for [dogbiscuit.org](http://dogbiscuit.org/mdub/weblog):
|
240
|
+
|
241
|
+
%ul.articles
|
242
|
+
- project.published_inputs.reverse.each do |entry|
|
243
|
+
%li
|
244
|
+
%p
|
245
|
+
= link(entry)
|
246
|
+
%span.teaser
|
247
|
+
%span.published_at
|
248
|
+
on
|
249
|
+
= entry.published_at.strftime("%e %b, %Y")
|
250
|
+
|
251
|
+
### Compass plugin
|
252
|
+
|
253
|
+
The Compass plugin gives you the full power of [Compass][compass] in your Sass stylesheets. Enable it by requiring it in your "`config.rb`":
|
254
|
+
|
255
|
+
require "pith/plugins/compass"
|
256
|
+
|
257
|
+
Note that if you're using Bundler, you'll also need to include the Compass gem in your `Gemfile`.
|
258
|
+
|
259
|
+
gem "compass"
|
260
|
+
|
217
261
|
[tilt]: http://github.com/rtomayko/tilt/
|
218
262
|
[haml]: http://haml-lang.com
|
219
263
|
[sass]: http://sass-lang.com
|
264
|
+
[compass]: http://compass-style.org
|
265
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Feature: Compass integration
|
2
|
+
|
3
|
+
I want to integrate Compass
|
4
|
+
So that I can use it inside a layout
|
5
|
+
|
6
|
+
Background:
|
7
|
+
|
8
|
+
Given input file "_pith/config.rb" contains
|
9
|
+
"""
|
10
|
+
require 'pith/plugins/compass'
|
11
|
+
"""
|
12
|
+
|
13
|
+
Scenario: Sass template
|
14
|
+
|
15
|
+
Given input file "style.css.sass" contains
|
16
|
+
"""
|
17
|
+
@import "compass/typography/links/hover-link"
|
18
|
+
|
19
|
+
a.mylink
|
20
|
+
@include hover-link
|
21
|
+
"""
|
22
|
+
|
23
|
+
When I build the site
|
24
|
+
Then output file "style.css" should contain /a.mylink { text-decoration: none; }/
|
25
|
+
|
26
|
+
Scenario: Scss template
|
27
|
+
|
28
|
+
Given input file "style.css.scss" contains
|
29
|
+
"""
|
30
|
+
@import "compass/typography/links/hover-link";
|
31
|
+
|
32
|
+
a.mylink {
|
33
|
+
@include hover-link;
|
34
|
+
}
|
35
|
+
"""
|
36
|
+
|
37
|
+
When I build the site
|
38
|
+
Then output file "style.css" should contain /a.mylink { text-decoration: none; }/
|
@@ -7,11 +7,11 @@ Given /^input file "([^\"]*)" contains$/ do |path, content|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
Given /^input file "([^\"]*)" exists$/ do |path|
|
10
|
-
|
10
|
+
step %{input file "#{path}" contains "something"}
|
11
11
|
end
|
12
12
|
|
13
13
|
Given "the site is up-to-date" do
|
14
|
-
|
14
|
+
step "I build the site"
|
15
15
|
end
|
16
16
|
|
17
17
|
Given /^the config file contains$/ do |content|
|
data/lib/pith/config.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "compass"
|
2
|
+
require "tilt/css"
|
3
|
+
|
4
|
+
module Pith
|
5
|
+
module Compass
|
6
|
+
|
7
|
+
module Initialize
|
8
|
+
|
9
|
+
def initialize(file=nil, line=1, options={}, &block)
|
10
|
+
options = options.merge(::Compass.sass_engine_options)
|
11
|
+
super(file, line, options, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
class SassTemplate < Tilt::SassTemplate
|
17
|
+
include Initialize
|
18
|
+
end
|
19
|
+
|
20
|
+
class ScssTemplate < Tilt::ScssTemplate
|
21
|
+
include Initialize
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Tilt.register Pith::Compass::SassTemplate, 'sass'
|
28
|
+
Tilt.register Pith::Compass::ScssTemplate, 'scss'
|
data/lib/pith/version.rb
CHANGED
metadata
CHANGED
@@ -1,75 +1,75 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.1
|
5
4
|
prerelease:
|
5
|
+
version: 0.3.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Williams
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
|
15
|
+
type: :runtime
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.3'
|
22
|
-
|
22
|
+
name: tilt
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.3'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
|
32
|
-
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: 1.2.1
|
38
|
-
|
38
|
+
name: rack
|
39
39
|
prerelease: false
|
40
|
-
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 1.2.1
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
|
48
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 1.2.7
|
54
|
-
|
54
|
+
name: thin
|
55
55
|
prerelease: false
|
56
|
-
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.2.7
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
|
64
|
-
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 0.3.0
|
70
|
-
|
70
|
+
name: clamp
|
71
71
|
prerelease: false
|
72
|
-
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/pith/output.rb
|
97
97
|
- lib/pith/pathname_ext.rb
|
98
98
|
- lib/pith/pathname_ext.rb~
|
99
|
+
- lib/pith/plugins/compass.rb
|
99
100
|
- lib/pith/plugins/publication/input.rb
|
100
101
|
- lib/pith/plugins/publication/input.rb~
|
101
102
|
- lib/pith/plugins/publication/project.rb
|
@@ -131,6 +132,7 @@ files:
|
|
131
132
|
- spec/pith/server_spec.rb
|
132
133
|
- spec/spec_helper.rb
|
133
134
|
- features/cleanup.feature
|
135
|
+
- features/compass.feature
|
134
136
|
- features/content_for.feature
|
135
137
|
- features/content_for.feature~
|
136
138
|
- features/error_handling.feature
|
@@ -164,8 +166,7 @@ files:
|
|
164
166
|
- features/textile.feature~
|
165
167
|
- features/verbatim.feature~
|
166
168
|
- cucumber.yml
|
167
|
-
-
|
168
|
-
YmluL3BpdGg=
|
169
|
+
- bin/pith
|
169
170
|
homepage: http://github.com/mdub/pith
|
170
171
|
licenses: []
|
171
172
|
post_install_message:
|
@@ -177,22 +178,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
178
|
requirements:
|
178
179
|
- - ! '>='
|
179
180
|
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
181
|
segments:
|
182
182
|
- 0
|
183
|
-
hash:
|
183
|
+
hash: -4121132495916590095
|
184
|
+
version: '0'
|
184
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
186
|
none: false
|
186
187
|
requirements:
|
187
188
|
- - ! '>='
|
188
189
|
- !ruby/object:Gem::Version
|
189
|
-
version: '0'
|
190
190
|
segments:
|
191
191
|
- 0
|
192
|
-
hash:
|
192
|
+
hash: -4121132495916590095
|
193
|
+
version: '0'
|
193
194
|
requirements: []
|
194
195
|
rubyforge_project:
|
195
|
-
rubygems_version: 1.8.
|
196
|
+
rubygems_version: 1.8.24
|
196
197
|
signing_key:
|
197
198
|
specification_version: 3
|
198
199
|
summary: A static website generator
|
@@ -206,6 +207,7 @@ test_files:
|
|
206
207
|
- spec/pith/server_spec.rb
|
207
208
|
- spec/spec_helper.rb
|
208
209
|
- features/cleanup.feature
|
210
|
+
- features/compass.feature
|
209
211
|
- features/content_for.feature
|
210
212
|
- features/content_for.feature~
|
211
213
|
- features/error_handling.feature
|