parchemin 1.0.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.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Rawane ZOSSOU
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,27 @@
1
+ # parchemin #
2
+
3
+ Parchemin allows you to create and manage a blog whose contents are not stored in a database but directly in files.
4
+
5
+ ## Installation ##
6
+
7
+ Just run the following command :
8
+
9
+ gem install parchemin
10
+
11
+ ## Usage ##
12
+
13
+ For more information, visit [http://parchemin.raw1z.fr](http://parchemin.raw1z.fr).
14
+
15
+ ## Note on Patches/Pull Requests ##
16
+
17
+ * Fork the project.
18
+ * Make your feature addition or bug fix.
19
+ * Add tests for it. This is important so I don't break it in a
20
+ future version unintentionally.
21
+ * Commit, do not mess with rakefile, version, or history.
22
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
23
+ * Send me a pull request. Bonus points for topic branches.
24
+
25
+ ## Copyright ##
26
+
27
+ Copyright (c) 2010 Rawane ZOSSOU. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "parchemin"
8
+ gem.summary = "File-based blog engine"
9
+ gem.description = "Parchemin allows you to create and manage a blog whose contents are not stored in a database but directly in files"
10
+ gem.email = "dev@raw1z.fr"
11
+ gem.homepage = "http://github.com/raw1z/parchemin"
12
+ gem.authors = ["Rawane ZOSSOU"]
13
+ gem.add_development_dependency "rspec", ">= 1.2.9"
14
+ gem.add_development_dependency "rack-test", ">= 0.5.3"
15
+ gem.add_development_dependency "nokogiri", ">= 1.4.2"
16
+ gem.add_dependency 'sinatra', '>= 1.0'
17
+ gem.add_dependency 'haml', '>= 3.0.4'
18
+ gem.add_dependency 'compass', '>= 0.10.1'
19
+ gem.add_dependency 'compass-susy-plugin', '>= 0.7.0.pre8'
20
+ gem.add_dependency 'rdiscount', '>= 1.6.3'
21
+ gem.files = FileList["[A-Z]*", "{lib}/**/*", "{bin}/**/*", "{app}/**/*"]
22
+ end
23
+ Jeweler::GemcutterTasks.new
24
+ rescue LoadError
25
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
26
+ end
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ Rspec::Core::RakeTask.new(:spec) do |spec|
31
+ end
32
+
33
+ Rspec::Core::RakeTask.new(:rcov) do |spec|
34
+ end
35
+
36
+ task :spec => :check_dependencies
37
+
38
+ task :default => :spec
39
+
40
+ require 'rake/rdoctask'
41
+ Rake::RDocTask.new do |rdoc|
42
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
43
+
44
+ rdoc.rdoc_dir = 'rdoc'
45
+ rdoc.title = "parchemin #{version}"
46
+ rdoc.rdoc_files.include('README*')
47
+ rdoc.rdoc_files.include('lib/**/*.rb')
48
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
Binary file
Binary file
Binary file
@@ -0,0 +1,242 @@
1
+ //** */
2
+ // Susy: Elastic-Fluid grids without all the math
3
+ // by Eric Meyer and OddBird Collective
4
+ // Site: www.oddbird.net/susy/
5
+ //** */
6
+
7
+ //** */
8
+ // GRID
9
+ // un-comment and override these values as needed for your grid layout
10
+ // (defaults are shown)
11
+ // !grid_unit = "em"
12
+ // !total_cols = 12
13
+ // !col_width = 4
14
+ // !gutter_width = 1
15
+ // !side_gutter_width = !gutter_width
16
+
17
+ //** */
18
+ // OMEGA_FLOAT
19
+ // By default, +omega elements are floated right.
20
+ // You can override that globally here:
21
+ // !omega_float = "right"
22
+
23
+ //** */
24
+ // HACKS
25
+ // Are you using hacks or conditional comments? Susy makes both possible.
26
+ // Leave this as 'true' to use hacks, set it as false for conditional comments.
27
+ // Conditional comments will require overrides for +omega, +inline-block and
28
+ // several other mixins.
29
+ // !hacks = true
30
+
31
+ //** */
32
+ // FONT-SIZE
33
+ // un-comment and override these values as needed (defaults are shown)
34
+ // - you set the font and line heights in pixels.
35
+ // - Susy will do the math and give you !base_font_size and !base_line_height
36
+ // variables, set flexibly against the common browser default of 16px
37
+ // !base_font_size_px = 16
38
+ // !base_line_height_px = 24
39
+
40
+ // SUSY
41
+ // (don't move this @import above the GRID and FONT-SIZE overrides)
42
+ @import susy/susy
43
+
44
+ // COLORS
45
+ // set any colors you will need later
46
+ $font_color: #444444
47
+ $quiet_color: $font_color + #333333
48
+ $loud_color: $font_color - #222222
49
+ $header_color: $font_color - #111111
50
+ $link_color: black
51
+ $visited_color: $link_color
52
+ $hover_color: $link_color
53
+ $focus_color: $hover_color
54
+ $active_color: $hover_color
55
+
56
+ /* @group colors */
57
+
58
+ $logo_link_color: black
59
+
60
+ $footer_text_color: #555555
61
+ $footer_bg_color: #eeeeee
62
+
63
+ /* @end */
64
+
65
+ // FONTS
66
+ // Give yourself some font stacks to work with
67
+ =sans-family
68
+ font-family: Verdana, Arial, sans-serif
69
+
70
+ =serif-family
71
+ font-family: Baskerville, Palatino, serif
72
+
73
+ =title-family
74
+ +serif-family
75
+
76
+ =rounded
77
+ -moz-border-radius: $px2em * 3px
78
+ -webkit-border-radius: $px2em * 3px
79
+
80
+ // Remember to add default styles to everything!
81
+
82
+ body
83
+ +sans-family
84
+ color: $font_color
85
+ line-height: 1.5em
86
+
87
+ /* @group links */
88
+
89
+ \:focus
90
+ outline: 1px dotted $quiet_color
91
+ color: $hover_color
92
+
93
+ a
94
+ &:link, &:visited
95
+ color: $link_color
96
+ text-decoration: none
97
+ font-weight: bold
98
+ &:focus, &:hover, &:active
99
+ color: $hover_color
100
+ border-bottom:
101
+ width: $px2em * 2px
102
+ style: dashed
103
+ color: black
104
+
105
+ /* @end */
106
+
107
+ /* @group headers */
108
+
109
+ h1, h2, h3, h4, h5, h6
110
+ color: $header_color
111
+ font-weight: bold
112
+
113
+ h1, h2, h3
114
+ +serif-family
115
+
116
+ h1
117
+ font-size: $base_line_height
118
+
119
+ /* @end */
120
+
121
+ /* @group forms */
122
+
123
+ form *:focus
124
+ outline: none
125
+
126
+ fieldset
127
+ margin: $base_line_height 0
128
+
129
+ legend
130
+ font-weight: bold
131
+ font-variant: small-caps
132
+
133
+ label
134
+ display: block
135
+
136
+ legend + label
137
+ margin-top: 0
138
+
139
+ textarea, input[type=text]
140
+ +rounded
141
+ color: black
142
+ +box-sizing(border-box)
143
+ width: 100%
144
+ font-size: 1em
145
+ padding: $px2em * 5px
146
+ border:
147
+ width: $px2em * 2px
148
+ style: solid
149
+ color: #aaaaaa
150
+
151
+ /* @end */
152
+
153
+ /* @group tables */
154
+
155
+ /* tables still need 'cellspacing="0"' in the markup */
156
+
157
+ table
158
+ width: 100%
159
+ border: 1 / 16 + unquote("em solid") $quiet_color + #333333
160
+ left: none
161
+ right: none
162
+ padding: 7 / 16 + unquote("em 0")
163
+ margin: 8 / 16 + unquote("em 0")
164
+
165
+ tbody
166
+ color: $quiet_color
167
+
168
+ th
169
+ font-weight: bold
170
+
171
+ /* @end */
172
+
173
+ /* @group block tags */
174
+
175
+ p
176
+ margin: $base_line_height 0
177
+
178
+ =list-default($ol: false)
179
+ @if $ol
180
+ list-style: decimal
181
+ margin: 0 1.5em 1.5em 1.5em
182
+ @else
183
+ list-style: disc
184
+ margin: 0 1.5em 1.5em 1.5em
185
+
186
+ =no-style-list
187
+ +no-bullets
188
+ margin: 0
189
+ padding: 0
190
+
191
+ ol
192
+ +list-default(ol)
193
+
194
+ ul
195
+ +list-default
196
+
197
+ blockquote
198
+ margin: $base_line_height
199
+ color: $quiet_color
200
+
201
+ dl
202
+ margin-bottom: 1em
203
+
204
+ dt
205
+ +title-family
206
+ font-weight: bold
207
+ font-size: 1.2em
208
+ color: black
209
+
210
+ /* @end */
211
+
212
+ /* @group inline tags */
213
+
214
+ cite
215
+ font-style: italic
216
+ color: $quiet_color
217
+
218
+ em
219
+ font-style: italic
220
+
221
+ strong
222
+ font-weight: bold
223
+
224
+ ins
225
+ text-decoration: underline
226
+
227
+ del
228
+ text-decoration: line-through
229
+
230
+ q
231
+ font-style: italic
232
+ em
233
+ font-style: normal
234
+
235
+ /* @end */
236
+
237
+ /* @group replaced tags */
238
+
239
+ img
240
+ vertical-align: bottom
241
+
242
+ /* @end */
@@ -0,0 +1,7 @@
1
+ .details
2
+ %span tags :
3
+
4
+ - article.tags.each do |tag|
5
+ %a{:href => "/tags/#{tag}"}= tag
6
+
7
+ %span= "| commentaires : #{article.comments.count}"
@@ -0,0 +1,17 @@
1
+ - if @tag
2
+ .description= "Articles dans la catégorie '<b>#{@tag}</b>' :"
3
+
4
+ - if @search
5
+ .description= "#{@articles.count} résultat(s) pour la recherche '<b>#{@search}</b>' :"
6
+
7
+ - @articles.each do |article|
8
+ .abstract
9
+ .created_at
10
+ .month= article.month.upcase
11
+ .day= article.day
12
+ .content
13
+ .title
14
+ %a{:href => "/articles/#{article.id}"}= article.title
15
+ .body
16
+ %div= article.abstract
17
+ = partial :article_details, :locals => {:article => article}
@@ -0,0 +1,37 @@
1
+ !!!5
2
+ %html{html_attrs('fr')}
3
+ %head
4
+ %title= @blog_name
5
+ %meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8'}
6
+ %link{:href=>"/layout.css", :media=>"screen", :rel=>"stylesheet", :type=>"text/css"}
7
+
8
+ %body
9
+ #page
10
+
11
+ #header
12
+ .brand
13
+ %a{:href => '/'}= @blog_name
14
+ .tagline= "par #{@author_name}"
15
+
16
+ #contents= yield
17
+
18
+ #sidebar
19
+ %dl
20
+ %dt Recherche
21
+ %dd
22
+ %form{:method => :get, :action => '/search'}
23
+ %input{:type => 'text', :name => 'search'}
24
+ %dl
25
+ %dt A propos
26
+ %dd
27
+ %img{:src => '/images/user.png'}
28
+ = @abstract.body(false)
29
+ %a{:href => '/statics/about'}= "Plus..."
30
+
31
+ %dl
32
+ %dt
33
+ %dd
34
+ %a{:href => '/rss', :class => 'syndication'}
35
+ %img{:src => '/images/feed-icon.png', :alt => 'Syndication'}
36
+
37
+ #footer= "Créé par Rawane ZOSSOU"
@@ -0,0 +1,191 @@
1
+ /* @group reset */
2
+ @import compass/reset
3
+
4
+ /* @end */
5
+
6
+ /* @group defaults */
7
+ @import base
8
+
9
+ /* @end */
10
+
11
+ /* @group structure mixins */
12
+ =details
13
+ +rounded
14
+ padding: $px2em * 5px
15
+ background-color: #eeeeee
16
+
17
+ span
18
+ font-weight: bold
19
+ color: #aaaaaa
20
+ a:link, a:visited
21
+ font-weight: bold
22
+
23
+ /* @end */
24
+
25
+ body
26
+ +susy
27
+
28
+ #page
29
+ +container
30
+ color: $font_color
31
+
32
+ #header
33
+ +columns(11)
34
+ +prefix(1)
35
+ +full
36
+ +title-family
37
+ margin-bottom: 2em
38
+ margin-top: 2em
39
+
40
+ .brand
41
+ font-size: 4em
42
+ font-weight: bold
43
+ a
44
+ &:hover
45
+ border: none
46
+
47
+ .tagline
48
+ font-size: 1.2em
49
+ margin-top: 1em
50
+ color: #aaaaaa
51
+
52
+ #contents
53
+ +columns(9)
54
+ +alpha
55
+
56
+ .description
57
+ +columns(9, 9)
58
+ +full
59
+ font-size: 1.2em
60
+ margin-bottom: 1em
61
+
62
+ .bottom
63
+ +columns(7, 9)
64
+ +prefix(1, 9)
65
+ margin-top: 1em
66
+
67
+ #flash
68
+ +columns(7, 9)
69
+ +prefix(1, 9)
70
+ margin-top: 1em
71
+ margin-bottom: 1em
72
+ .flash
73
+ +rounded
74
+ padding: $px2em * 5px
75
+ color: white
76
+ .notice
77
+ background-color: #50ca1d
78
+ .error
79
+ background-color: #bc3739
80
+
81
+ .article
82
+ +columns(7, 9)
83
+ +prefix(1, 9)
84
+ .title
85
+ +title-family
86
+ font-size: 2em
87
+ margin-bottom: $px2em * 2px
88
+ font-weight: bold
89
+ color: black
90
+ .created_at
91
+ font-size: 0.8em
92
+ color: #aaaaaa
93
+ .details
94
+ +details
95
+
96
+ #comments
97
+ padding-top: 1em
98
+ .hint
99
+ +title-family
100
+ font-weight: bold
101
+ margin-bottom: 1em
102
+ font-size: 1.1em
103
+
104
+ .main
105
+ border-bottom:
106
+ width: $px2em * 2px
107
+ style: solid
108
+ color: black
109
+
110
+ .comment
111
+ +columns(7, 7)
112
+ +full
113
+ margin-bottom: 1em
114
+
115
+ .infos
116
+ +columns(2, 7)
117
+ text-align: right
118
+
119
+ .author
120
+ +title-family
121
+ font-weight: bold
122
+
123
+ .email, .website, .date
124
+ font-size: 0.8em
125
+ color: #aaaaaa
126
+
127
+ .content
128
+ +columns(4, 7)
129
+ +suffix(1, 7)
130
+ +omega(7)
131
+
132
+ .add
133
+ +columns(7, 7)
134
+ +full
135
+ padding-top: 1em
136
+
137
+ form
138
+ +columns(5, 7)
139
+ +prefix(1, 7)
140
+ label
141
+ font-weight: bold
142
+ textarea
143
+ height: 10em
144
+ .hint
145
+ color: #aaaaaa
146
+ font-size: 0.8em
147
+ text-align: right
148
+
149
+ .abstract
150
+ +columns(7, 9)
151
+ +prefix(1, 9)
152
+ margin-bottom: 2em
153
+
154
+ .created_at
155
+ +columns(1, 7)
156
+ +rounded
157
+ background-color: black
158
+ color: white
159
+ text-align: center
160
+ font-family: Georgia, serif
161
+ font-weight: bold
162
+
163
+ .content
164
+ +columns(6, 7)
165
+ +omega(7)
166
+ .title
167
+ +title-family
168
+ font-size: 1.5em
169
+ margin-bottom: $px2em * 5px
170
+ font-weight: bold
171
+
172
+ .details
173
+ margin-top: 1em
174
+ +details
175
+
176
+ #sidebar
177
+ +columns(3)
178
+ +omega
179
+ dt
180
+ margin-bottom: $px2em * 5px
181
+ img
182
+ +rounded
183
+ float: left
184
+ margin-right: $px2em * 5px
185
+
186
+ #footer
187
+ +columns(12)
188
+ +full
189
+ text-align: center
190
+ font-size: 0.7em
191
+ margin-top: 1em
@@ -0,0 +1,23 @@
1
+ .add
2
+ .hint.main Ecrire un commentaire
3
+ %form{:method => :post, :action => "/comment", :id => 'new_comment'}
4
+
5
+ %label Nom :
6
+ %input{:type => :text, :name => 'comment[author]', :value => @comment.author}
7
+ .hint (Obligatoire)
8
+
9
+ %label Email :
10
+ %input{:type => :text, :name => 'comment[email]', :value => @comment.email}
11
+ .hint (Facultatif. Ne sera pas publié)
12
+
13
+ %label Site web:
14
+ %input{:type => :text, :name => 'comment[website]', :value => @comment.website}
15
+ .hint (Facultatif)
16
+
17
+ %label Commentaire :
18
+ %textarea{:name => 'comment[body]', :value => @comment.body}
19
+ .hint (Obligatoire)
20
+
21
+ %input{:type => 'hidden', :name => 'comment[article]', :value => @article.filename}
22
+
23
+ %input{:type => 'submit', :value => 'Envoyer'}
@@ -0,0 +1,18 @@
1
+ xml.instruct! :xml, :version => '1.0'
2
+ xml.rss :version => "2.0" do
3
+ xml.channel do
4
+ xml.title "Papyrus"
5
+ xml.description "Par Rawane ZOSSOU"
6
+ xml.link "#{@host}"
7
+
8
+ @articles.each do |article|
9
+ xml.item do
10
+ xml.title article.title
11
+ xml.link "#{@host}/articles/#{article.filename}"
12
+ xml.description article.abstract
13
+ xml.pubDate Time.parse(article.created_at.to_s).rfc822()
14
+ xml.guid "#{@host}/articles/#{article.filename}"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ #flash
2
+ - flash.each do |name, msg|
3
+ %div{:class => "flash #{name}"}= msg
4
+
5
+ .article
6
+ .title= @article.title
7
+ .created_at= "posté le #{@article.date}"
8
+ .body= @article.body
9
+ .details= partial :article_details, :locals => {:article => @article}
10
+
11
+ #comments
12
+ - if @comments.count > 0
13
+ .hint.main Commentaires
14
+ - @comments.each do |comment|
15
+ .comment
16
+ .infos
17
+ .author= comment.author
18
+ - if not comment.website.nil? and not comment.website.empty?
19
+ .website= comment.website
20
+ .date= comment.created_at.strftime('%d/%m/%Y')
21
+ .content
22
+ = comment.body
23
+ = partial :new_comment
24
+
@@ -0,0 +1 @@
1
+ = @static.body