gettalong-webgen 0.5.6.20081020 → 0.5.7.20090227
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +3 -0
- data/THANKS +1 -0
- data/bin/webgen +2 -0
- data/data/webgen/webgui/controller/main.rb +2 -0
- data/data/webgen/website_skeleton/ext/init.rb +4 -0
- data/doc/contentprocessor/blocks.page +44 -14
- data/doc/contentprocessor/builder.page +1 -1
- data/doc/contentprocessor/erb.page +1 -1
- data/doc/contentprocessor/erubis.page +1 -1
- data/doc/contentprocessor/fragments.page +1 -1
- data/doc/contentprocessor/haml.page +1 -1
- data/doc/contentprocessor/rdiscount.page +1 -1
- data/doc/contentprocessor/rdoc.page +1 -1
- data/doc/contentprocessor/redcloth.page +1 -1
- data/doc/contentprocessor/sass.page +1 -1
- data/doc/faq.page +7 -2
- data/doc/manual.page +6 -5
- data/doc/reference_metainfo.page +1 -1
- data/doc/sourcehandler/feed.page +9 -1
- data/doc/sourcehandler/sitemap.page +1 -1
- data/doc/tag/coderay.page +1 -1
- data/doc/tag/langbar.page +15 -0
- data/doc/tag/menu.page +1 -1
- data/doc/tag/relocatable.page +2 -2
- data/lib/webgen/blackboard.rb +9 -4
- data/lib/webgen/cache.rb +2 -0
- data/lib/webgen/cli.rb +6 -1
- data/lib/webgen/cli/create_command.rb +2 -0
- data/lib/webgen/cli/run_command.rb +2 -0
- data/lib/webgen/cli/utils.rb +2 -0
- data/lib/webgen/cli/webgui_command.rb +2 -0
- data/lib/webgen/common.rb +12 -1
- data/lib/webgen/common/sitemap.rb +12 -4
- data/lib/webgen/configuration.rb +2 -0
- data/lib/webgen/contentprocessor.rb +2 -0
- data/lib/webgen/contentprocessor/blocks.rb +22 -8
- data/lib/webgen/contentprocessor/builder.rb +2 -0
- data/lib/webgen/contentprocessor/context.rb +2 -0
- data/lib/webgen/contentprocessor/erb.rb +2 -0
- data/lib/webgen/contentprocessor/erubis.rb +2 -0
- data/lib/webgen/contentprocessor/fragments.rb +2 -0
- data/lib/webgen/contentprocessor/haml.rb +2 -0
- data/lib/webgen/contentprocessor/maruku.rb +2 -0
- data/lib/webgen/contentprocessor/rdiscount.rb +2 -0
- data/lib/webgen/contentprocessor/rdoc.rb +2 -0
- data/lib/webgen/contentprocessor/redcloth.rb +2 -0
- data/lib/webgen/contentprocessor/sass.rb +2 -0
- data/lib/webgen/contentprocessor/tags.rb +2 -0
- data/lib/webgen/coreext.rb +2 -0
- data/lib/webgen/default_config.rb +4 -1
- data/lib/webgen/languages.rb +2 -0
- data/lib/webgen/loggable.rb +2 -0
- data/lib/webgen/logger.rb +2 -0
- data/lib/webgen/node.rb +22 -8
- data/lib/webgen/output.rb +3 -1
- data/lib/webgen/output/filesystem.rb +2 -0
- data/lib/webgen/page.rb +2 -0
- data/lib/webgen/path.rb +3 -1
- data/lib/webgen/source.rb +2 -0
- data/lib/webgen/source/filesystem.rb +5 -2
- data/lib/webgen/source/resource.rb +2 -0
- data/lib/webgen/source/stacked.rb +2 -0
- data/lib/webgen/sourcehandler.rb +8 -0
- data/lib/webgen/sourcehandler/base.rb +2 -0
- data/lib/webgen/sourcehandler/copy.rb +2 -0
- data/lib/webgen/sourcehandler/directory.rb +2 -0
- data/lib/webgen/sourcehandler/feed.rb +3 -1
- data/lib/webgen/sourcehandler/fragment.rb +2 -0
- data/lib/webgen/sourcehandler/memory.rb +2 -0
- data/lib/webgen/sourcehandler/metainfo.rb +3 -1
- data/lib/webgen/sourcehandler/page.rb +2 -0
- data/lib/webgen/sourcehandler/sitemap.rb +2 -0
- data/lib/webgen/sourcehandler/template.rb +2 -0
- data/lib/webgen/sourcehandler/virtual.rb +3 -1
- data/lib/webgen/tag.rb +2 -0
- data/lib/webgen/tag/base.rb +2 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +2 -0
- data/lib/webgen/tag/coderay.rb +2 -0
- data/lib/webgen/tag/date.rb +2 -0
- data/lib/webgen/tag/executecommand.rb +2 -0
- data/lib/webgen/tag/includefile.rb +2 -0
- data/lib/webgen/tag/langbar.rb +4 -1
- data/lib/webgen/tag/link.rb +2 -0
- data/lib/webgen/tag/menu.rb +2 -0
- data/lib/webgen/tag/metainfo.rb +2 -0
- data/lib/webgen/tag/relocatable.rb +2 -0
- data/lib/webgen/tag/sitemap.rb +2 -0
- data/lib/webgen/tag/tikz.rb +3 -1
- data/lib/webgen/tree.rb +5 -0
- data/lib/webgen/version.rb +3 -1
- data/lib/webgen/webgentask.rb +2 -0
- data/lib/webgen/website.rb +104 -3
- data/lib/webgen/websiteaccess.rb +2 -0
- data/lib/webgen/websitemanager.rb +2 -0
- data/man/man1/webgen.1 +6 -0
- data/misc/default.css +36 -12
- data/misc/default.template +1 -1
- data/misc/images/error.png +0 -0
- data/misc/images/important.png +0 -0
- data/misc/images/information.png +0 -0
- data/misc/images/warning.png +0 -0
- data/test/helper.rb +4 -0
- data/test/test_blackboard.rb +2 -0
- data/test/test_cache.rb +2 -0
- data/test/test_cli.rb +7 -0
- data/test/test_common.rb +18 -0
- data/test/test_common_sitemap.rb +7 -5
- data/test/test_configuration.rb +2 -0
- data/test/test_contentprocessor.rb +2 -0
- data/test/test_contentprocessor_blocks.rb +22 -1
- data/test/test_contentprocessor_builder.rb +2 -0
- data/test/test_contentprocessor_context.rb +2 -0
- data/test/test_contentprocessor_erb.rb +2 -0
- data/test/test_contentprocessor_erubis.rb +2 -0
- data/test/test_contentprocessor_fragments.rb +2 -0
- data/test/test_contentprocessor_haml.rb +2 -0
- data/test/test_contentprocessor_maruku.rb +2 -0
- data/test/test_contentprocessor_rdiscount.rb +2 -0
- data/test/test_contentprocessor_rdoc.rb +2 -0
- data/test/test_contentprocessor_redcloth.rb +2 -0
- data/test/test_contentprocessor_sass.rb +2 -0
- data/test/test_contentprocessor_tags.rb +2 -0
- data/test/test_languages.rb +2 -0
- data/test/test_loggable.rb +2 -0
- data/test/test_logger.rb +2 -0
- data/test/test_node.rb +2 -0
- data/test/test_output_filesystem.rb +2 -0
- data/test/test_page.rb +2 -0
- data/test/test_path.rb +2 -0
- data/test/test_source_filesystem.rb +17 -0
- data/test/test_source_resource.rb +2 -0
- data/test/test_source_stacked.rb +2 -0
- data/test/test_sourcehandler_base.rb +2 -0
- data/test/test_sourcehandler_copy.rb +2 -0
- data/test/test_sourcehandler_directory.rb +2 -0
- data/test/test_sourcehandler_feed.rb +2 -0
- data/test/test_sourcehandler_fragment.rb +2 -0
- data/test/test_sourcehandler_memory.rb +2 -0
- data/test/test_sourcehandler_metainfo.rb +2 -0
- data/test/test_sourcehandler_page.rb +2 -0
- data/test/test_sourcehandler_sitemap.rb +2 -0
- data/test/test_sourcehandler_template.rb +2 -0
- data/test/test_sourcehandler_virtual.rb +2 -0
- data/test/test_tag_base.rb +4 -0
- data/test/test_tag_breadcrumbtrail.rb +2 -0
- data/test/test_tag_coderay.rb +2 -0
- data/test/test_tag_date.rb +2 -0
- data/test/test_tag_executecommand.rb +2 -0
- data/test/test_tag_includefile.rb +2 -0
- data/test/test_tag_langbar.rb +13 -6
- data/test/test_tag_link.rb +2 -0
- data/test/test_tag_menu.rb +2 -0
- data/test/test_tag_metainfo.rb +2 -0
- data/test/test_tag_relocatable.rb +2 -0
- data/test/test_tag_sitemap.rb +4 -1
- data/test/test_tag_tikz.rb +4 -1
- data/test/test_tree.rb +2 -0
- data/test/test_webgentask.rb +2 -0
- data/test/test_website.rb +6 -4
- data/test/test_websiteaccess.rb +2 -0
- data/test/test_websitemanager.rb +2 -0
- metadata +8 -5
- data/misc/images/error.gif +0 -0
- data/misc/images/exclamation.gif +0 -0
- data/misc/images/information.gif +0 -0
data/AUTHORS
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
The author of webgen is Thomas Leitner <t_leitner@gmx.at>.
|
2
|
+
|
1
3
|
The following persons have contributed to this version of webgen:
|
2
4
|
|
3
5
|
* Arnaud Cornet <arnaud.cornet@gmail.com>
|
4
6
|
* Jeremy Hinegardner <jeremy@hinegardner.org>
|
5
7
|
* Massimiliano Filacchioni <m.filacchioni@caspur.it>
|
8
|
+
* Paul van Tilburg <paulvt@debian.org>
|
data/THANKS
CHANGED
data/bin/webgen
CHANGED
@@ -4,3 +4,7 @@
|
|
4
4
|
# allows you to add your own extensions to webgen or to modify webgen's core!
|
5
5
|
#
|
6
6
|
# If you don't need this feature you can savely delete this file and the directory in which it is!
|
7
|
+
#
|
8
|
+
# The +config+ variable below can be used to access the Webgen::Configuration object for the current
|
9
|
+
# website.
|
10
|
+
config = Webgen::WebsiteAccess.website.config
|
@@ -8,20 +8,32 @@ templates to define the place where the actual page content should be.
|
|
8
8
|
|
9
9
|
The general syntax is as follows:
|
10
10
|
|
11
|
-
<webgen:block name='BLOCK_NAME' chain='(L)CN;(L)CN;...' />
|
11
|
+
<webgen:block name='BLOCK_NAME' chain='(L)CN;(L)CN;...' node='first' notfound='ignore' />
|
12
12
|
|
13
|
-
So it is basically an XML tag with
|
14
|
-
|
15
|
-
the used node chain needs to have a block that is named so, otherwise an error is thrown (if there
|
16
|
-
is only one node left in the node chain that node is used). The block is rendered according to its
|
17
|
-
render pipeline and then inserted.
|
13
|
+
So it is basically an XML tag with the mandatory attribute `name` and the optional attributes
|
14
|
+
`chain`, `node` and `notfound`:
|
18
15
|
|
19
|
-
The
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
* The `name` attribute is the only mandatory attribute and it specifies the name of the block that
|
17
|
+
should be rendered in place of the block tag. The next node in the used node chain (if there is
|
18
|
+
only one node left in the node chain that node is used) needs to have a block that has such a name
|
19
|
+
(this behaviour can be changed with the `node` attribute), otherwise an error is raised. The
|
20
|
+
block is rendered according to its render pipeline and then inserted.
|
23
21
|
|
24
|
-
|
22
|
+
* The optional attribute `chain` specifies the node chain that should be used for rendering the
|
23
|
+
block. Its value needs to be a list of (localized) canonical names of nodes separated by
|
24
|
+
semicolons that should be used as node chain. If this attribute is not specified the default node
|
25
|
+
chain is used.
|
26
|
+
|
27
|
+
* The optional attribute `node` specifies which node in the node chain should be used. If this
|
28
|
+
attribute is not specified, the next node in the node chain is used. If it is specified with the
|
29
|
+
value `first`, then the node chain is traversed till a node is found that has a block with the
|
30
|
+
specified name. If no such node is in the node chain, an error is raised.
|
31
|
+
|
32
|
+
* If the optional attribute `notfound` has a value of `ignore`, all errors that can occur are
|
33
|
+
ignored. This is especially useful when used in templates to include blocks that may not be
|
34
|
+
defined in all page files.
|
35
|
+
|
36
|
+
All this is more easily explained with examples. Assume that we have a `default.template` file, a
|
25
37
|
`page.template` file and a `my.page` file with the following contents:
|
26
38
|
|
27
39
|
The `default.template` file:
|
@@ -32,6 +44,10 @@ The `default.template` file:
|
|
32
44
|
after default 1
|
33
45
|
<webgen:block name='content' chain='page.template;my.html' />
|
34
46
|
after default 2
|
47
|
+
<webgen:block name='optional' chain='page.template;my.html' node='first' />
|
48
|
+
after default 3
|
49
|
+
<webgen:block name='invalid' notfound='ignore' />
|
50
|
+
after default 4
|
35
51
|
|
36
52
|
The `page.template` file:
|
37
53
|
|
@@ -44,18 +60,28 @@ And the `my.page` file:
|
|
44
60
|
|
45
61
|
--- name:content pipeline:
|
46
62
|
The content of the page file.
|
63
|
+
--- name:optional pipeline:
|
64
|
+
Optional content.
|
47
65
|
|
48
66
|
When `my.page` gets rendered to `my.html`, the node chain looks like this by default:
|
49
67
|
|
50
|
-
default.template ---> my.
|
68
|
+
default.template ---> my.html
|
51
69
|
|
52
70
|
The first webgen block tag just inserts the rendered block named `content` of `my.page`. The second
|
53
71
|
block tag uses a custom node chain. Therefore the block named `content` of `page.template` gets
|
54
72
|
rendered using the node chain:
|
55
73
|
|
56
|
-
page.template ---> my.
|
74
|
+
page.template ---> my.html
|
57
75
|
|
58
|
-
and then inserted.
|
76
|
+
and then inserted. The third block tag uses the same custom node chain but for a block named
|
77
|
+
`optional`. This block does not exist in `page.template` but it does exist in `my.page`. Since the
|
78
|
+
`node` attribute is set to `first`, the first node `page.template` in the node chain is ignored and
|
79
|
+
the block is found in `my.page` (if the `node` attribute is not specified, an error will be raised).
|
80
|
+
|
81
|
+
The fourth block tag specifies a block name that does not occur in `my.page`. However, since the
|
82
|
+
optional attribute `notfound` is set to `ignore`, this error is ignored.
|
83
|
+
|
84
|
+
Summing up the above, the rendered file `my.html` will then look like this:
|
59
85
|
|
60
86
|
before default 1
|
61
87
|
The content of the page file.
|
@@ -64,3 +90,7 @@ and then inserted. Summing up the above, the rendered file `my.html` will then l
|
|
64
90
|
The content of the page file.
|
65
91
|
after page 1
|
66
92
|
after default 2
|
93
|
+
Optional content.
|
94
|
+
after default 3
|
95
|
+
|
96
|
+
after default 4
|
@@ -53,4 +53,4 @@ output the result of the Ruby code (note the equation sign!). And the fourth lin
|
|
53
53
|
> You may need to ensure that the ERB start and end tags are not processed by the content
|
54
54
|
> processor. For example, when using the RedCloth content processor, you may need to surround the
|
55
55
|
> ERB code with `<textile>` tags!
|
56
|
-
{.
|
56
|
+
{.important}
|
@@ -10,7 +10,7 @@ attribute set.
|
|
10
10
|
> context! This is to ensure that fragment nodes are not created from multiple block of one page
|
11
11
|
> file. So this content processor has no effect when used in the pipeline of blocks except if the
|
12
12
|
> block is named `content`.
|
13
|
-
{.
|
13
|
+
{.warning}
|
14
14
|
|
15
15
|
The default markup language Maruku automatically generates an `id` attribute for all headers. If you
|
16
16
|
use another markup language or plain old HTML, you might need to set the `id` attributes by hand.
|
@@ -11,7 +11,7 @@ for Ruby source files, [reference][1]) to HTML.
|
|
11
11
|
> implementation is via Rubygems:
|
12
12
|
>
|
13
13
|
> gem install rdoc
|
14
|
-
{.
|
14
|
+
{.warning}
|
15
15
|
|
16
16
|
[1]: http://rdoc.rubyforge.org/rdoc/ "RDoc Reference"
|
17
17
|
[2]: http://rubyforge.org/projects/rdoc/ "New RDoc implementation"
|
data/doc/faq.page
CHANGED
@@ -177,7 +177,7 @@ following to the sidebar part in your `default.template` (ensure that you haven'
|
|
177
177
|
the processing pipeline):
|
178
178
|
|
179
179
|
<%% if node.node_info[:page].blocks.has_key?('sidebar') %>
|
180
|
-
|
180
|
+
<webgen:block name='sidebar' />
|
181
181
|
<%% end %>
|
182
182
|
|
183
183
|
This will include the contents of the block `sidebar` in the sidebar if such a block exists for a
|
@@ -188,6 +188,11 @@ page file:
|
|
188
188
|
--- name:sidebar
|
189
189
|
This is the sidebar block and everything in here goes to the sidebar!
|
190
190
|
|
191
|
+
You can avoid using the ERB processor if you use the following syntax (available from version 0.5.7
|
192
|
+
upwards):
|
193
|
+
|
194
|
+
<webgen:block name='sidebar' node='first' notfound='ignore' />
|
195
|
+
|
191
196
|
### ... create XML output?
|
192
197
|
|
193
198
|
This can be achieved manually (by removing any markup processor in the processing pipeline of the
|
@@ -211,4 +216,4 @@ in the meta information block of the page file for which you want a short menu t
|
|
211
216
|
|
212
217
|
> Be aware that this changes not only how the page appears in a menu but also how it appears in
|
213
218
|
> breadcrumb trails and other links generated by webgen.
|
214
|
-
{.
|
219
|
+
{.important}
|
data/doc/manual.page
CHANGED
@@ -19,7 +19,8 @@ The executable for webgen is called... webgen ;-) It uses a command style syntax
|
|
19
19
|
possible commands run `webgen help`.
|
20
20
|
|
21
21
|
The main command is the `render` command which does the actual website generation. This command uses
|
22
|
-
the
|
22
|
+
either the environment variable `WEBGEN_WEBSITE` (if it is set and non-empty) or the current working
|
23
|
+
directory as website directory if none was specified via the gloabl `-d` option.
|
23
24
|
|
24
25
|
You can invoke a command by specifying its name after the executable name. Also counting the
|
25
26
|
executable `webgen` as a command, the options for a command are specified directly after the command
|
@@ -250,7 +251,7 @@ information can be extracted correctly from the path name:
|
|
250
251
|
> If two paths have the same `basename` and `extension` part, they should define the same
|
251
252
|
> content but for different languages. This allows webgen to automatically deliver the right
|
252
253
|
> language version of the content
|
253
|
-
{.
|
254
|
+
{.important}
|
254
255
|
|
255
256
|
* `lang`
|
256
257
|
|
@@ -297,7 +298,7 @@ language, it is first tried to get the path in the requested language. If this i
|
|
297
298
|
(ie. no such localization exists), the unlocalized path is returned if it exists.
|
298
299
|
|
299
300
|
> Directories and fragments are never localized, only files are!
|
300
|
-
{.
|
301
|
+
{.important}
|
301
302
|
|
302
303
|
It is also possible to use the _localized canonical name_ of a path to resolve it. The localized
|
303
304
|
canonical name is the same as the canonical name but with a language code inserted before the
|
@@ -330,9 +331,9 @@ information key is an array which can have the following values:
|
|
330
331
|
* `:year`, `:month`, `:day`: The creation year, month and day, respectively, of the source path.
|
331
332
|
An error is raised if the needed meta information `created_at` is not set on the path.
|
332
333
|
|
333
|
-
> The
|
334
|
+
> The constructed output path must always be an absolute one, ie. it has to start at the root of the
|
334
335
|
> output directory. Therefore, the `:parent` part should always be included!
|
335
|
-
{.
|
336
|
+
{.important}
|
336
337
|
|
337
338
|
Following are some examples of output path names for given source path names (assuming that `en` is
|
338
339
|
the default language and that the path is under a directory called `/img/`):
|
data/doc/reference_metainfo.page
CHANGED
@@ -171,7 +171,7 @@ at the [output path creation section]({relocatable: manual.html#source-output})
|
|
171
171
|
|
172
172
|
> This meta information has to be set BEFORE a node gets created. Setting this value is therefore
|
173
173
|
> only useful, for example, in the `paths` block of a meta information backing file.
|
174
|
-
{.
|
174
|
+
{.important}
|
175
175
|
|
176
176
|
### priority
|
177
177
|
|
data/doc/sourcehandler/feed.page
CHANGED
@@ -7,6 +7,12 @@ This source handler automatically generates an atom or RSS feed for a set of fil
|
|
7
7
|
[Webgen Page Format]({relocatable: ../webgen_page_format.html}) (the format which is also used for
|
8
8
|
page files).
|
9
9
|
|
10
|
+
> This extension is only available if you have installed the [feedtools][1] library. The preferred
|
11
|
+
> way to do this is via Rubygems:
|
12
|
+
>
|
13
|
+
> gem install feedtools
|
14
|
+
{.warning}
|
15
|
+
|
10
16
|
The following meta information keys are supported:
|
11
17
|
|
12
18
|
* `entries` (MANDATORY)
|
@@ -94,4 +100,6 @@ The following meta information keys of page files are used if they are specified
|
|
94
100
|
|
95
101
|
The default implementation supports the generation of atom and RSS feeds. You can override the
|
96
102
|
default generation mechanism by adding an `atom_template` and/or `rss_template` block in the feed
|
97
|
-
file which are then used to generate the atom or the RSS feed respectively.
|
103
|
+
file which are then used to generate the atom or the RSS feed respectively.
|
104
|
+
|
105
|
+
[1]: http://sporkmonger.com/projects/feedtools
|
@@ -11,7 +11,7 @@ This source handler automatically generates a sitemap based on the specification
|
|
11
11
|
> library. The preferred way to do this is via Rubygems:
|
12
12
|
>
|
13
13
|
> gem install builder
|
14
|
-
{.
|
14
|
+
{.warning}
|
15
15
|
|
16
16
|
The following meta information keys are supported:
|
17
17
|
|
data/doc/tag/coderay.page
CHANGED
data/doc/tag/langbar.page
CHANGED
@@ -12,6 +12,21 @@ This tag is used to display a list of links to translations of the page. The tex
|
|
12
12
|
can be set via the configuration option `tag.langbar.lang_names` (if not set, the language code is
|
13
13
|
shown).
|
14
14
|
|
15
|
+
The option `tag.langbar.process_output` is useful in conjunction with `tag.langbar.lang_names` to
|
16
|
+
display language flags. For example, you can use the following entries in `config.yaml`:
|
17
|
+
|
18
|
+
tag.langbar.lang_names:
|
19
|
+
en: |
|
20
|
+
<img src="\{relocatable: img/flag_english.gif}" alt="English flag"/> English
|
21
|
+
de: |
|
22
|
+
<img src="\{relocatable: img/flag_german.gif}" alt="German flag"/> Deutsch
|
23
|
+
|
24
|
+
tag.langbar.process_output: true
|
25
|
+
|
26
|
+
This assumes that the `langbar` tag is *only* used in `src/default.template` and the flag images are
|
27
|
+
under `src/img/` (otherwise the `relocatable` tag can correctly find the paths). To work around
|
28
|
+
this, you could specify the `lang_names` directly in the `langbar` tag.
|
29
|
+
|
15
30
|
## Examples
|
16
31
|
|
17
32
|
<table class="examples">
|
data/doc/tag/menu.page
CHANGED
@@ -27,7 +27,7 @@ generating an in-page content menu of all the header sections.
|
|
27
27
|
|
28
28
|
> When using the option value `files` for `tag.menu.used_nodes`, all nodes which are only in the
|
29
29
|
> menu because they have fragment nodes beneath them are not included in the menu.
|
30
|
-
{.
|
30
|
+
{.important}
|
31
31
|
|
32
32
|
The rendered menu consists of `ul` and `li` tags and the links (or `span` elements) to the menu
|
33
33
|
entries . The `li` tags have special CSS classes set for styling. These CSS class names are as
|
data/doc/tag/relocatable.page
CHANGED
@@ -5,7 +5,7 @@ used_options:
|
|
5
5
|
---
|
6
6
|
## Description
|
7
7
|
|
8
|
-
This tag ensures that the relative path to the specified path is always correct.
|
8
|
+
This tag ensures that the relative path to the specified path is always correct.
|
9
9
|
|
10
10
|
When the tag is used, it changes the directory part of the supplied path name to a relative path to
|
11
11
|
the destination and is most often used in template files. A relocatable tag looks like this:
|
@@ -15,7 +15,7 @@ ensuring that the relative path to file is valid.
|
|
15
15
|
|
16
16
|
> You can only use the `relocatable` tag with paths that are handled by webgen. If you want to
|
17
17
|
> handle paths that are not normally handled by webgen, create a virtual path for them.
|
18
|
-
{.
|
18
|
+
{.important}
|
19
19
|
|
20
20
|
If the specified path is an absolute URL (like `http://webgen.rubyforge.org`), it will just return
|
21
21
|
it. And if you specify an URL fragment, this fragment has to exist. If you don't want to resolve a
|
data/lib/webgen/blackboard.rb
CHANGED
@@ -1,14 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
module Webgen
|
2
4
|
|
3
5
|
# A blackboard object provides two features for inter-object communication:
|
4
6
|
#
|
5
7
|
# * services: An object can add a service to the blackboard which can be called by any other
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
8
|
+
# object by just specifing the service name. Therefore it is easy to change the underlying
|
9
|
+
# implementation of the service and there are no hard dependencies on specific class or method
|
10
|
+
# names.
|
9
11
|
#
|
10
12
|
# * listeners: Objects may register themselves for specific messsage names and get notified when
|
11
|
-
#
|
13
|
+
# such a message gets dispatched.
|
14
|
+
#
|
15
|
+
# For a list of all available services and messages have a look at the main Webgen documentation
|
16
|
+
# page.
|
12
17
|
class Blackboard
|
13
18
|
|
14
19
|
# Create a new Blackboard object.
|
data/lib/webgen/cache.rb
CHANGED
data/lib/webgen/cli.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
require 'cmdparse'
|
2
4
|
require 'webgen/website'
|
3
5
|
require 'webgen/version'
|
@@ -77,9 +79,12 @@ module Webgen
|
|
77
79
|
# The log level. Default: <tt>Logger::WARN</tt>
|
78
80
|
attr_reader :log_level
|
79
81
|
|
82
|
+
# Create a new CommandParser class. The default webgen website (if not specified via the
|
83
|
+
# <tt>-d</tt> option) is taken from the environment variable +WEBGEN_WEBSITE+ or, if it is not
|
84
|
+
# set or empty, the current working directory.
|
80
85
|
def initialize # :nodoc:
|
81
86
|
super(true)
|
82
|
-
@directory = Dir.pwd
|
87
|
+
@directory = (ENV['WEBGEN_WEBSITE'].to_s.empty? ? Dir.pwd : ENV['WEBGEN_WEBSITE'])
|
83
88
|
@verbosity = :normal
|
84
89
|
@log_level = ::Logger::WARN
|
85
90
|
@log_filter = nil
|