nanoc3 3.0.9 → 3.1.0a1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/NEWS.md +360 -0
- data/README.md +85 -0
- data/Rakefile +2 -2
- data/bin/nanoc3 +0 -4
- data/lib/nanoc3/base/code_snippet.rb +14 -6
- data/lib/nanoc3/base/compiler.rb +68 -49
- data/lib/nanoc3/base/compiler_dsl.rb +70 -29
- data/lib/nanoc3/base/context.rb +47 -0
- data/lib/nanoc3/base/core_ext/array.rb +4 -0
- data/lib/nanoc3/base/core_ext/hash.rb +5 -1
- data/lib/nanoc3/base/core_ext/string.rb +2 -0
- data/lib/nanoc3/base/data_source.rb +132 -96
- data/lib/nanoc3/base/dependency_tracker.rb +160 -185
- data/lib/nanoc3/base/directed_graph.rb +252 -0
- data/lib/nanoc3/base/errors.rb +52 -4
- data/lib/nanoc3/base/filter.rb +43 -28
- data/lib/nanoc3/base/item.rb +93 -25
- data/lib/nanoc3/base/item_rep.rb +166 -55
- data/lib/nanoc3/base/layout.rb +16 -13
- data/lib/nanoc3/base/notification_center.rb +28 -12
- data/lib/nanoc3/base/plugin_registry.rb +158 -0
- data/lib/nanoc3/base/rule.rb +27 -8
- data/lib/nanoc3/base/rule_context.rb +59 -46
- data/lib/nanoc3/base/site.rb +124 -77
- data/lib/nanoc3/base.rb +7 -2
- data/lib/nanoc3/cli/base.rb +4 -1
- data/lib/nanoc3/cli/commands/autocompile.rb +5 -4
- data/lib/nanoc3/cli/commands/compile.rb +28 -7
- data/lib/nanoc3/cli/commands/create_item.rb +1 -1
- data/lib/nanoc3/cli/commands/create_layout.rb +1 -1
- data/lib/nanoc3/cli/commands/create_site.rb +46 -22
- data/lib/nanoc3/cli/commands/debug.rb +100 -0
- data/lib/nanoc3/cli/commands/help.rb +1 -1
- data/lib/nanoc3/cli/commands/info.rb +1 -1
- data/lib/nanoc3/cli/commands/view.rb +85 -0
- data/lib/nanoc3/cli/commands.rb +2 -0
- data/lib/nanoc3/cli/logger.rb +7 -0
- data/lib/nanoc3/cli.rb +0 -3
- data/lib/nanoc3/data_sources/{delicious.rb → deprecated/delicious.rb} +1 -24
- data/lib/nanoc3/data_sources/{last_fm.rb → deprecated/last_fm.rb} +1 -27
- data/lib/nanoc3/data_sources/{twitter.rb → deprecated/twitter.rb} +1 -14
- data/lib/nanoc3/data_sources/filesystem.rb +188 -176
- data/lib/nanoc3/data_sources/filesystem_unified.rb +107 -0
- data/lib/nanoc3/data_sources/filesystem_verbose.rb +80 -0
- data/lib/nanoc3/data_sources.rb +18 -9
- data/lib/nanoc3/extra/core_ext/enumerable.rb +39 -0
- data/lib/nanoc3/extra/core_ext/time.rb +2 -2
- data/lib/nanoc3/extra/core_ext.rb +1 -0
- data/lib/nanoc3/extra/deployers/rsync.rb +49 -3
- data/lib/nanoc3/extra/file_proxy.rb +7 -0
- data/lib/nanoc3/extra/vcs.rb +25 -24
- data/lib/nanoc3/extra/vcses/bazaar.rb +4 -0
- data/lib/nanoc3/extra/vcses/dummy.rb +4 -0
- data/lib/nanoc3/extra/vcses/git.rb +4 -0
- data/lib/nanoc3/extra/vcses/mercurial.rb +4 -0
- data/lib/nanoc3/extra/vcses/subversion.rb +4 -0
- data/lib/nanoc3/extra.rb +4 -1
- data/lib/nanoc3/filters/erb.rb +1 -1
- data/lib/nanoc3/filters/erubis.rb +1 -1
- data/lib/nanoc3/filters/haml.rb +1 -1
- data/lib/nanoc3/filters/kramdown.rb +14 -0
- data/lib/nanoc3/filters/maruku.rb +1 -1
- data/lib/nanoc3/filters/rainpress.rb +1 -1
- data/lib/nanoc3/filters/rdiscount.rb +3 -1
- data/lib/nanoc3/filters.rb +2 -0
- data/lib/nanoc3/helpers/blogging.rb +91 -75
- data/lib/nanoc3/helpers/breadcrumbs.rb +18 -10
- data/lib/nanoc3/helpers/capturing.rb +24 -29
- data/lib/nanoc3/helpers/filtering.rb +20 -17
- data/lib/nanoc3/helpers/html_escape.rb +7 -4
- data/lib/nanoc3/helpers/link_to.rb +51 -41
- data/lib/nanoc3/helpers/rendering.rb +15 -8
- data/lib/nanoc3/helpers/tagging.rb +27 -21
- data/lib/nanoc3/helpers/text.rb +12 -8
- data/lib/nanoc3/helpers/xml_sitemap.rb +13 -15
- data/lib/nanoc3/tasks/deploy/rsync.rake +4 -1
- data/lib/nanoc3/tasks.rb +2 -1
- data/lib/nanoc3.rb +24 -1
- metadata +43 -87
- data/NEWS.rdoc +0 -328
- data/README.rdoc +0 -83
- data/lib/nanoc3/base/plugin.rb +0 -88
- data/lib/nanoc3/base/preprocessor_context.rb +0 -37
- data/lib/nanoc3/data_sources/filesystem_combined.rb +0 -214
- data/lib/nanoc3/data_sources/filesystem_common.rb +0 -22
- data/lib/nanoc3/data_sources/filesystem_compact.rb +0 -256
- data/lib/nanoc3/extra/context.rb +0 -24
- data/lib/nanoc3/package.rb +0 -107
- data/vendor/cri/ChangeLog +0 -0
- data/vendor/cri/LICENSE +0 -19
- data/vendor/cri/NEWS +0 -0
- data/vendor/cri/README +0 -4
- data/vendor/cri/Rakefile +0 -25
- data/vendor/cri/lib/cri/base.rb +0 -153
- data/vendor/cri/lib/cri/command.rb +0 -105
- data/vendor/cri/lib/cri/core_ext/string.rb +0 -41
- data/vendor/cri/lib/cri/core_ext.rb +0 -8
- data/vendor/cri/lib/cri/option_parser.rb +0 -186
- data/vendor/cri/lib/cri.rb +0 -12
- data/vendor/cri/test/test_base.rb +0 -6
- data/vendor/cri/test/test_command.rb +0 -6
- data/vendor/cri/test/test_core_ext.rb +0 -21
- data/vendor/cri/test/test_option_parser.rb +0 -279
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2007-
|
1
|
+
Copyright (c) 2007-2009 Denis Defreyne and contributors
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/NEWS.md
ADDED
@@ -0,0 +1,360 @@
|
|
1
|
+
# nanoc News
|
2
|
+
|
3
|
+
## 3.1
|
4
|
+
|
5
|
+
New:
|
6
|
+
|
7
|
+
* An `Item#rep(name)` function for quickly getting a certain rep
|
8
|
+
* An `Item#compiled_content` function for quickly getting compiled content
|
9
|
+
* An `Item#path` function for quickly getting the path of an item rep
|
10
|
+
* A new “+” wildcard in rule patterns that matches one or more characters
|
11
|
+
* A `view` command that starts a web server in the output directory
|
12
|
+
* A `debug` command that shows information about the items, reps and layouts
|
13
|
+
* A `kramdown` filter ([kramdown site](http://kramdown.rubyforge.org/))
|
14
|
+
* A plugin-loading system
|
15
|
+
* A diff between the previously compiled content and the last compiled content
|
16
|
+
is now written to `output.diff`
|
17
|
+
|
18
|
+
Changed:
|
19
|
+
|
20
|
+
* New sites now come with a stylesheet item instead of a `style.css` file in
|
21
|
+
the output directory
|
22
|
+
* The `deploy:rsync` task now use sensible default options
|
23
|
+
* The `deploy:rsync` task now accepts a config environment variable
|
24
|
+
* The `deploy:rsync` task now uses a lowercase `dry_run` environment variable
|
25
|
+
* The `maruku` filter now accepts parameters
|
26
|
+
* The `rainpress` filter now accepts parameters
|
27
|
+
* The `filesystem` data source is now known as `filesystem_verbose`
|
28
|
+
* Meta files and content files are now optional
|
29
|
+
* The `filesystem_compact` and `filesystem_combined` data sources have been
|
30
|
+
merged into a new `filesystem_unified` data source
|
31
|
+
* The metadata section in `filesystem_unified` is now optional [Christopher
|
32
|
+
Eppstein]
|
33
|
+
* The `--server` autocompile option is now known as `--handler`
|
34
|
+
* Assigns in filters are now available as instance variables and methods
|
35
|
+
* The `#breadcrumbs_trail` function now allows missing parents
|
36
|
+
|
37
|
+
Deprecated:
|
38
|
+
|
39
|
+
* `Nanoc3::FileProxy`; use one of the filename attributes instead
|
40
|
+
* `ItemRep#content_at_snapshot`; use `#compiled_content` instead
|
41
|
+
* The `last_fm`, `delicious` and `twitter` data sources; fetch online content
|
42
|
+
into a cache by a rake task and load data from this cache instead
|
43
|
+
|
44
|
+
## 3.0.7
|
45
|
+
|
46
|
+
* Fixed a bug which could cause layout rules not be matched in order
|
47
|
+
|
48
|
+
## 3.0.6
|
49
|
+
|
50
|
+
* Error checking in `filesystem_combined` has been improved [Brian Candler]
|
51
|
+
* Generated HTML files now have a default encoding of UTF-8
|
52
|
+
* Periods in identifiers for layouts now behave correctly
|
53
|
+
* The `relativize_paths` filter now correctly handles “/” [Eric Sunshine]
|
54
|
+
|
55
|
+
## 3.0.5
|
56
|
+
|
57
|
+
* Restored pre-3.0.3 behaviour of periods in identifiers. By default, a file
|
58
|
+
can have multiple extensions (e.g. `content/foo.html.erb` will have the
|
59
|
+
identifier `/foo/`), but if `allow_periods_in_identifiers` in the site
|
60
|
+
configuration is true, a file can have only one extension (e.g.
|
61
|
+
`content/blog/stuff.entry.html` will have the identifier
|
62
|
+
`/blog/stuff.entry/`).
|
63
|
+
|
64
|
+
## 3.0.4
|
65
|
+
|
66
|
+
* Fixed a bug which would cause the `filesystem_compact` data source to
|
67
|
+
incorrectly determine the content filename, leading to weird “Expected 1
|
68
|
+
content file but found 3” errors [Eric Sunshine]
|
69
|
+
|
70
|
+
## 3.0.3
|
71
|
+
|
72
|
+
* The `Blogging` helper now properly handles item reps without paths
|
73
|
+
* The `relativize_paths` filter now only operates inside tags
|
74
|
+
* The autocompiler now handles escaped paths
|
75
|
+
* The `LinkTo` and `Tagging` helpers now output escaped HTML
|
76
|
+
* Fixed `played_at` attribute assignment in the `LastFM` data source for
|
77
|
+
tracks playing now, and added a `now_playing` attribute [Nicky Peeters]
|
78
|
+
* The `filesystem_*` data sources can now handle dots in identifiers
|
79
|
+
* Required enumerator to make sure `#enum_with_index` always works
|
80
|
+
* `Array#stringify_keys` now properly recurses
|
81
|
+
|
82
|
+
## 3.0.2
|
83
|
+
|
84
|
+
* Children-only identifier patterns no longer erroneously also match parent
|
85
|
+
(e.g.` /foo/*/` no longer matches `/foo/`)
|
86
|
+
* The `create_site` command no longer uses those ugly HTML entities
|
87
|
+
* Install message now mentions the IRC channel
|
88
|
+
|
89
|
+
## 3.0.1
|
90
|
+
|
91
|
+
* The proper exception is now raised when no matching compilation rules can
|
92
|
+
be found
|
93
|
+
* The autocompile command no longer has a duplicate `--port` option
|
94
|
+
* The `#url_for` and `#feed_url` methods now check the presence of the
|
95
|
+
`base_url` site configuration attribute
|
96
|
+
* Several outdated URLs are now up-to-date
|
97
|
+
* Error handling has been improved in general
|
98
|
+
|
99
|
+
## 3.0
|
100
|
+
|
101
|
+
New:
|
102
|
+
|
103
|
+
* Multiple data sources
|
104
|
+
* Dependency tracking between items
|
105
|
+
* Filters can now optionally take arguments
|
106
|
+
* `#create_page` and `#create_layout` methods in data sources
|
107
|
+
* A new way to specify compilation/routing rules using a Rules file
|
108
|
+
* A `coderay` filter ([CodeRay site](http://coderay.rubychan.de/))
|
109
|
+
* A `filesystem_compact` data source which uses less directories
|
110
|
+
|
111
|
+
Changed:
|
112
|
+
|
113
|
+
* Pages and textual assets are now known as “items”
|
114
|
+
|
115
|
+
Removed:
|
116
|
+
|
117
|
+
* Support for drafts
|
118
|
+
* Support for binary assets
|
119
|
+
* Support for templates
|
120
|
+
* Everything that was deprecated in nanoc 2.x
|
121
|
+
* `save_*`, `move_*` and `delete_*` methods in data sources
|
122
|
+
* Processing instructions in metadata
|
123
|
+
|
124
|
+
## 2.2.2
|
125
|
+
|
126
|
+
* Removed `relativize_paths` filter; use `relativize_paths_in_html` or
|
127
|
+
`relativize_paths_in_css` instead
|
128
|
+
* Fixed bug which could cause nanoc to eat massive amounts of memory when an
|
129
|
+
exception occurs
|
130
|
+
* Fixed bug which would cause nanoc to complain about the open file limit
|
131
|
+
being reached when using a large amount of assets
|
132
|
+
|
133
|
+
## 2.2.1
|
134
|
+
|
135
|
+
* Fixed bug which prevented `relative_path_to` from working
|
136
|
+
* Split `relativize_paths` filter into two filter: `relativize_paths_in_html`
|
137
|
+
and `relativize_paths_in_css`
|
138
|
+
* Removed bundled mime-types library
|
139
|
+
|
140
|
+
## 2.2
|
141
|
+
|
142
|
+
New:
|
143
|
+
|
144
|
+
* `--pages` and `--assets` compiler options
|
145
|
+
* `--no-color` commandline option
|
146
|
+
* `Filtering` helper
|
147
|
+
* `#relative_path_to` function in `LinkTo` helper
|
148
|
+
* `rainpress` filter ([Rainpress site](http://code.google.com/p/rainpress/))
|
149
|
+
* `relativize_paths` filter
|
150
|
+
* The current layout is now accessible through the `@layout` variable
|
151
|
+
* Much more informative stack traces when something goes wrong
|
152
|
+
|
153
|
+
Changed:
|
154
|
+
|
155
|
+
* The commandline option parser is now a lot more reliable
|
156
|
+
* `#atom_feed` now takes optional `:content_proc`, `:excerpt_proc` and
|
157
|
+
`:articles` parameters
|
158
|
+
* The compile command show non-written items (those with `skip_output: true`)
|
159
|
+
* The compile command compiles everything by default
|
160
|
+
* Added `--only-outdated` option to compile only outdated pages
|
161
|
+
|
162
|
+
Removed:
|
163
|
+
|
164
|
+
* deprecated extension-based code
|
165
|
+
|
166
|
+
## 2.1.6
|
167
|
+
|
168
|
+
* The `filesystem_combined` data source now supports empty metadata sections
|
169
|
+
* The `rdoc` filter now works for both RDoc 1.x and 2.x
|
170
|
+
* The autocompiler now serves a 500 when an exception occurs outside
|
171
|
+
compilation
|
172
|
+
* The autocompiler no longer serves index files when the request path does not
|
173
|
+
end with a slash
|
174
|
+
* The autocompiler now always serves asset content correctly
|
175
|
+
|
176
|
+
## 2.1.5
|
177
|
+
|
178
|
+
* Added Ruby 1.9 compatibility
|
179
|
+
* The `filesystem` and `filesystem_combined` data sources now preserve custom
|
180
|
+
extensions
|
181
|
+
|
182
|
+
## 2.1.4
|
183
|
+
|
184
|
+
* Fixed an issue where the autocompiler in Windows would serve broken assets
|
185
|
+
|
186
|
+
## 2.1.3
|
187
|
+
|
188
|
+
* The `haml` and `sass` filters now correctly take their options from assets
|
189
|
+
* The autocompiler now serves index files instead of 404s
|
190
|
+
* Layouts named “index” are now handled correctly
|
191
|
+
* The `filesystem_combined` data source now properly handles assets
|
192
|
+
|
193
|
+
## 2.1.2
|
194
|
+
|
195
|
+
* The utocompiler now compiles assets as well
|
196
|
+
* The `sass` filter now takes options (just like the `haml` filter)
|
197
|
+
* Haml/Sass options are now taken from the page *rep* instead of the page
|
198
|
+
|
199
|
+
## 2.1.1
|
200
|
+
|
201
|
+
* Fixed issue which would cause files not to be required in the right order
|
202
|
+
|
203
|
+
## 2.1
|
204
|
+
|
205
|
+
This is only a short summary of all changes in 2.1. For details, see the
|
206
|
+
[nanoc web site](http://nanoc.stoneship.org/). Especially the blog and the
|
207
|
+
updated manual will be useful.
|
208
|
+
|
209
|
+
New:
|
210
|
+
|
211
|
+
* New `rdiscount` filter ([RDiscount site](http://github.com/rtomayko/rdiscount))
|
212
|
+
* New `maruku` filter ([Maruku site](http://maruku.rubyforge.org/))
|
213
|
+
* New `erubis` filter ([Erubis site](http://www.kuwata-lab.com/erubis/))
|
214
|
+
* A better commandline frontend
|
215
|
+
* A new filesystem data source named `filesystem_combined`
|
216
|
+
* Routers, which decide where compiled pages should be written to
|
217
|
+
* Page/layout mtimes can now be retrieved through `page.mtime`/`layout.mtime`
|
218
|
+
|
219
|
+
Changed:
|
220
|
+
|
221
|
+
* Already compiled pages will no longer be re-compiled unless outdated
|
222
|
+
* Layout processors and filters have been merged
|
223
|
+
* Layouts no longer rely on file extensions to determine the layout processor
|
224
|
+
* Greatly improved source code documentation
|
225
|
+
* Greatly improved unit test suite
|
226
|
+
|
227
|
+
Removed:
|
228
|
+
|
229
|
+
* Several filters have been removed and replaced by newer filters:
|
230
|
+
* `eruby`: use `erb` or `erubis` instead
|
231
|
+
* `markdown`: use `bluecloth`, `rdiscount` or `maruku` instead
|
232
|
+
* `textile`: use `redcloth` instead
|
233
|
+
|
234
|
+
## 2.0.4
|
235
|
+
|
236
|
+
* Fixed `default.rb`’s `#html_escape`
|
237
|
+
* Updated Haml filter and layout processor so that @page, @pages and @config
|
238
|
+
are now available as instance variables instead of local variables
|
239
|
+
|
240
|
+
## 2.0.3
|
241
|
+
|
242
|
+
* The autocompiler now honors custom paths
|
243
|
+
* The autocompiler now attempts to serve pages with the most appropriate MIME
|
244
|
+
type, instead of always serving everything as `text/html`
|
245
|
+
|
246
|
+
## 2.0.2
|
247
|
+
|
248
|
+
* nanoc now requires Ruby 1.8.5 instead of 1.8.6
|
249
|
+
|
250
|
+
## 2.0.1
|
251
|
+
|
252
|
+
* Fixed a “too many open files” error that could appear during (auto)compiling
|
253
|
+
|
254
|
+
## 2.0
|
255
|
+
|
256
|
+
New:
|
257
|
+
|
258
|
+
* Support for custom layout processors
|
259
|
+
* Support for custom data sources
|
260
|
+
* Database data source
|
261
|
+
* An auto-compiler
|
262
|
+
* Pages have `parent` and `children`
|
263
|
+
|
264
|
+
Changed:
|
265
|
+
|
266
|
+
* The source has been restructured and cleaned up a great deal
|
267
|
+
* Filters are defined in a different way now
|
268
|
+
* The `eruby` filter now uses ERB instead of Erubis
|
269
|
+
|
270
|
+
Removed:
|
271
|
+
|
272
|
+
* The `filters` property; use `filters_pre` instead
|
273
|
+
* Support for Liquid
|
274
|
+
|
275
|
+
## 1.6.2
|
276
|
+
|
277
|
+
* Fixed an issue which prevented the content capturing plugin from working
|
278
|
+
|
279
|
+
## 1.6.1
|
280
|
+
|
281
|
+
* Removed a stray debug message
|
282
|
+
|
283
|
+
## 1.6
|
284
|
+
|
285
|
+
* Added support for post-layout filters
|
286
|
+
* Added support for getting a File object for the page, so you can now e.g.
|
287
|
+
easily get the modification time for a given page (`@page.file.mtime`)
|
288
|
+
* Cleaned up the source code a lot
|
289
|
+
* Removed deprecated asset-copying functionality
|
290
|
+
|
291
|
+
## 1.5
|
292
|
+
|
293
|
+
* Added support for custom filters
|
294
|
+
* Improved Liquid support -- Liquid is now a first-class nanoc citizen
|
295
|
+
* Deprecated assets -- use something like rsync instead
|
296
|
+
* Added `eruby_engine` option, which can be `erb` or `erubis`
|
297
|
+
|
298
|
+
## 1.4
|
299
|
+
|
300
|
+
* nanoc now supports ERB (as well as Erubis); Erubis no longer is a dependency
|
301
|
+
* `meta.yaml` can now have `haml_options` property, which is passed to Haml
|
302
|
+
* Pages can now have a `filename` property, which defaults to `index` [Dennis
|
303
|
+
Sutch]
|
304
|
+
* Pages now know in what order they should be compiled, eliminating the need
|
305
|
+
for custom page ordering [Dennis Sutch]
|
306
|
+
|
307
|
+
## 1.3.1
|
308
|
+
|
309
|
+
* The contents of the `assets` directory are now copied into the output
|
310
|
+
directory specified in `config.yaml`
|
311
|
+
|
312
|
+
## 1.3
|
313
|
+
|
314
|
+
* The `@pages` array now also contains uncompiled pages
|
315
|
+
* Pages with `skip_output` set to true will not be outputted
|
316
|
+
* Added new filters
|
317
|
+
* Textile/RedCloth
|
318
|
+
* Sass
|
319
|
+
* nanoc now warns before overwriting in `create_site`, `create_page` and
|
320
|
+
`create_template` (but not in compile)
|
321
|
+
|
322
|
+
## 1.2
|
323
|
+
|
324
|
+
* Sites now have an `assets` directory, whose contents are copied to the
|
325
|
+
`output` directory when compiling [Soryu]
|
326
|
+
* Added support for non-eRuby layouts (Markaby, Haml, Liquid, ...)
|
327
|
+
* Added more filters (Markaby, Haml, Liquid, RDoc [Dmitry Bilunov])
|
328
|
+
* Improved error reporting
|
329
|
+
* Accessing page attributes using instance variables, and not through `@page`,
|
330
|
+
is no longer possible
|
331
|
+
* Page attributes can now be accessed using dot notation, i.e. `@page.title`
|
332
|
+
as well as `@page[:title]`
|
333
|
+
|
334
|
+
## 1.1.3
|
335
|
+
|
336
|
+
* Fixed bug which would cause layoutless pages to be outputted incorrectly
|
337
|
+
|
338
|
+
## 1.1.2
|
339
|
+
|
340
|
+
* Backup files (files ending with a “~”) are now ignored
|
341
|
+
* Fixed bug which would cause subpages not to be generated correctly
|
342
|
+
|
343
|
+
## 1.1
|
344
|
+
|
345
|
+
* Added support for nested layouts
|
346
|
+
* Added coloured logging
|
347
|
+
* `@page` now hold the page that is currently being processed
|
348
|
+
* Index files are now called “content” files and are now named after the
|
349
|
+
directory they are in [Colin Barrett]
|
350
|
+
* It is now possible to access `@page` in the page’s content file
|
351
|
+
|
352
|
+
## 1.0.1
|
353
|
+
|
354
|
+
* Fixed a bug which would cause a “no such template” error to be displayed
|
355
|
+
when the template existed but compiling it would raise an exception
|
356
|
+
* Fixed bug which would cause pages not to be sorted by order before compiling
|
357
|
+
|
358
|
+
## 1.0
|
359
|
+
|
360
|
+
* Initial release
|
data/README.md
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# nanoc 3
|
2
|
+
|
3
|
+
nanoc is a simple but very flexible static site generator written in Ruby.
|
4
|
+
It operates on local files, and therefore does not run on the server. nanoc
|
5
|
+
"compiles" the local source files into HTML (usually), by evaluating eRuby,
|
6
|
+
Markdown, etc.
|
7
|
+
|
8
|
+
## Documentation
|
9
|
+
|
10
|
+
The [nanoc3 web site](http://nanoc.stoneship.org) contains a few useful
|
11
|
+
resources to help you get started with nanoc:
|
12
|
+
|
13
|
+
* The [tutorial](http://nanoc.stoneship.org/tutorial)
|
14
|
+
* The [manual](http://nanoc.stoneship.org/manual)
|
15
|
+
* The [migration guide](http://nanoc.stoneship.org/migrating)
|
16
|
+
|
17
|
+
It is probably also worth checking out and perhaps subscribing to the
|
18
|
+
discussion groups:
|
19
|
+
|
20
|
+
* The [discussion group in English](http://groups.google.com/group/nanoc)
|
21
|
+
* The [discussion group in Spanish](http://groups.google.com/group/nanoc-es)
|
22
|
+
|
23
|
+
### Source Code Documentation
|
24
|
+
|
25
|
+
The source code is structured in a few directories:
|
26
|
+
|
27
|
+
* `bin` contains the commandline tool aptly named `nanoc3`
|
28
|
+
* `lib`
|
29
|
+
* `nanoc3`
|
30
|
+
* `base` contains the bare essentials necessary for nanoc to function
|
31
|
+
* `cli` contains the commandline interface
|
32
|
+
* `data_sources` contains the standard data sources (Nanoc3::DataSource
|
33
|
+
subclasses), such as the filesystem data source
|
34
|
+
* `helpers` contains helpers, which provide functionality some sites
|
35
|
+
may find useful, such as the blogging and tagging helpers
|
36
|
+
* `extra` contains stuff that is not needed by nanoc itself, but which may
|
37
|
+
be used by helpers, data sources, filters or VCSes.
|
38
|
+
* `filters` contains the standard filters (Nanoc3::Filter subclasses) such
|
39
|
+
as ERB, Markdown, Haml, ...
|
40
|
+
* `test` contains testing code, structured in the same way as lib/nanoc
|
41
|
+
|
42
|
+
The namespaces (modules) are organised like this:
|
43
|
+
|
44
|
+
* `Nanoc3` is the namespace for everything nanoc-related (obviously). The
|
45
|
+
classes in `lib/nanoc3/base` are part of this module (not `Nanoc3::Base`)
|
46
|
+
* `CLI` containing everything related to the commandline tool.
|
47
|
+
* `DataSources` contains the data sources
|
48
|
+
* `Helpers` contains the helpers
|
49
|
+
* `Extra` contains useful stuff not needed by nanoc itself
|
50
|
+
* `Filters` contains the (textual) filters
|
51
|
+
|
52
|
+
The central class in nanoc is `Nanoc3::Site`, so you should start there if
|
53
|
+
you want to explore nanoc from a technical perspective.
|
54
|
+
|
55
|
+
## Dependencies
|
56
|
+
|
57
|
+
nanoc itself can be used without installing any dependencies. Some
|
58
|
+
components, however, do have dependencies:
|
59
|
+
|
60
|
+
* The **autocompiler** depends on `mime-types` and `rack`.
|
61
|
+
* For **documentation generation** you’ll need `yard`.
|
62
|
+
* For **packaging** you’ll need `rubygems` (1.3 or newer).
|
63
|
+
* For **testing** you’ll need `mocha`.
|
64
|
+
|
65
|
+
## Contributors
|
66
|
+
|
67
|
+
(In alphabetical order)
|
68
|
+
|
69
|
+
* Colin Barrett
|
70
|
+
* Dmitry Bilunov
|
71
|
+
* Brian Candler
|
72
|
+
* Chris Eppstein
|
73
|
+
* Starr Horne
|
74
|
+
* Nicky Peeters
|
75
|
+
* Christian Plessl
|
76
|
+
* Šime Ramov
|
77
|
+
* "Soryu"
|
78
|
+
* Eric Sunshine
|
79
|
+
* Dennis Sutch
|
80
|
+
|
81
|
+
Special thanks to Ale Muñoz.
|
82
|
+
|
83
|
+
## Contact
|
84
|
+
|
85
|
+
You can reach me at <denis.defreyne@stoneship.org>.
|
data/Rakefile
CHANGED
data/bin/nanoc3
CHANGED
@@ -8,9 +8,5 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
|
|
8
8
|
require 'nanoc3'
|
9
9
|
require 'nanoc3/cli'
|
10
10
|
|
11
|
-
# Load custom code that can't be load later
|
12
|
-
Dir['lib/commands/*.rb'].sort.each { |f| require f }
|
13
|
-
Dir['lib/data_sources/*.rb'].sort.each { |f| require f }
|
14
|
-
|
15
11
|
# Run base
|
16
12
|
Nanoc3::CLI::Base.shared_base.run(ARGV)
|
@@ -7,25 +7,31 @@ module Nanoc3
|
|
7
7
|
# speed up site compilation.
|
8
8
|
class CodeSnippet
|
9
9
|
|
10
|
-
# The Nanoc3::Site this code snippet belongs to.
|
10
|
+
# The {Nanoc3::Site} this code snippet belongs to.
|
11
|
+
#
|
12
|
+
# @return [Nanoc3::Site]
|
11
13
|
attr_accessor :site
|
12
14
|
|
13
15
|
# A string containing the actual code in this code snippet.
|
16
|
+
#
|
17
|
+
# @return [String]
|
14
18
|
attr_reader :data
|
15
19
|
|
16
20
|
# The filename corresponding to this code snippet.
|
21
|
+
#
|
22
|
+
# @return [String]
|
17
23
|
attr_reader :filename
|
18
24
|
|
19
25
|
# The time where this code snippet was last modified.
|
26
|
+
#
|
27
|
+
# @return [Time]
|
20
28
|
attr_reader :mtime
|
21
29
|
|
22
30
|
# Creates a new code snippet.
|
23
31
|
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
# +mtime+:: The time when the code was last modified (can be nil).
|
32
|
+
# @param [String] data The raw source code which will be executed before compilation
|
33
|
+
# @param [String] filename The filename corresponding to this code snippet
|
34
|
+
# @param [Time] mtime The time when the code was last modified (can be nil)
|
29
35
|
def initialize(data, filename, mtime=nil)
|
30
36
|
@data = data
|
31
37
|
@filename = filename
|
@@ -33,6 +39,8 @@ module Nanoc3
|
|
33
39
|
end
|
34
40
|
|
35
41
|
# Loads the code by executing it.
|
42
|
+
#
|
43
|
+
# @return [void]
|
36
44
|
def load
|
37
45
|
eval(@data, TOPLEVEL_BINDING, @filename)
|
38
46
|
end
|