webgen 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/ChangeLog +487 -0
  2. data/Rakefile +13 -28
  3. data/VERSION +1 -1
  4. data/bin/webgen +1 -2
  5. data/data/webgen/passive_sources/templates/atom_feed.template +1 -0
  6. data/data/webgen/website_bundles/style/andreas07/src/default.css +2 -2
  7. data/data/webgen/website_skeleton/config.yaml +22 -5
  8. data/doc/contentprocessor.template +2 -2
  9. data/doc/contentprocessor/blocks.page +4 -4
  10. data/doc/contentprocessor/builder.page +2 -3
  11. data/doc/contentprocessor/erb.page +1 -1
  12. data/doc/contentprocessor/erubis.page +5 -5
  13. data/doc/contentprocessor/fragments.page +5 -4
  14. data/doc/contentprocessor/haml.page +2 -3
  15. data/doc/contentprocessor/head.page +16 -6
  16. data/doc/contentprocessor/kramdown.page +49 -0
  17. data/doc/contentprocessor/less.page +34 -0
  18. data/doc/contentprocessor/maruku.page +6 -3
  19. data/doc/contentprocessor/rdiscount.page +3 -3
  20. data/doc/contentprocessor/rdoc.page +1 -1
  21. data/doc/contentprocessor/redcloth.page +1 -1
  22. data/doc/contentprocessor/sass.page +1 -1
  23. data/doc/contentprocessor/tags.page +2 -2
  24. data/doc/contentprocessor/tidy.page +2 -2
  25. data/doc/extensions.page +1 -2
  26. data/doc/extensions.template +5 -5
  27. data/doc/getting_started.page +16 -12
  28. data/doc/index.page +21 -21
  29. data/doc/manual.page +109 -61
  30. data/doc/reference_configuration.page +63 -38
  31. data/doc/reference_metainfo.page +68 -45
  32. data/doc/reference_website_styles.page +5 -1
  33. data/doc/source/filesystem.page +4 -4
  34. data/doc/source/tararchive.page +4 -4
  35. data/doc/sourcehandler.template +2 -2
  36. data/doc/sourcehandler/feed.page +3 -4
  37. data/doc/sourcehandler/metainfo.page +1 -1
  38. data/doc/sourcehandler/page.page +3 -3
  39. data/doc/sourcehandler/sitemap.page +2 -3
  40. data/doc/sourcehandler/template.page +2 -2
  41. data/doc/sourcehandler/virtual.page +5 -5
  42. data/doc/tag.template +1 -1
  43. data/doc/tag/coderay.page +2 -2
  44. data/doc/tag/includefile.page +1 -1
  45. data/doc/tag/langbar.page +4 -1
  46. data/doc/tag/menu.page +3 -3
  47. data/doc/tag/relocatable.page +1 -1
  48. data/doc/upgrading.page +30 -31
  49. data/doc/webgen_page_format.page +6 -6
  50. data/lib/webgen/cache.rb +4 -5
  51. data/lib/webgen/cli/utils.rb +18 -7
  52. data/lib/webgen/cli/webgui_command.rb +4 -2
  53. data/lib/webgen/common.rb +10 -0
  54. data/lib/webgen/configuration.rb +1 -3
  55. data/lib/webgen/contentprocessor.rb +4 -2
  56. data/lib/webgen/contentprocessor/blocks.rb +1 -0
  57. data/lib/webgen/contentprocessor/builder.rb +3 -9
  58. data/lib/webgen/contentprocessor/erb.rb +3 -9
  59. data/lib/webgen/contentprocessor/erubis.rb +3 -9
  60. data/lib/webgen/contentprocessor/haml.rb +10 -11
  61. data/lib/webgen/contentprocessor/head.rb +64 -0
  62. data/lib/webgen/contentprocessor/kramdown.rb +26 -0
  63. data/lib/webgen/contentprocessor/kramdown/html.rb +32 -0
  64. data/lib/webgen/contentprocessor/less.rb +35 -0
  65. data/lib/webgen/contentprocessor/maruku.rb +14 -0
  66. data/lib/webgen/contentprocessor/tags.rb +25 -7
  67. data/lib/webgen/default_config.rb +9 -3
  68. data/lib/webgen/node.rb +92 -0
  69. data/lib/webgen/output.rb +3 -1
  70. data/lib/webgen/source/resource.rb +2 -1
  71. data/lib/webgen/source/tararchive.rb +3 -2
  72. data/lib/webgen/sourcehandler.rb +8 -4
  73. data/lib/webgen/sourcehandler/base.rb +1 -2
  74. data/lib/webgen/sourcehandler/feed.rb +1 -1
  75. data/lib/webgen/sourcehandler/virtual.rb +1 -0
  76. data/lib/webgen/tag/base.rb +1 -1
  77. data/lib/webgen/tag/langbar.rb +5 -2
  78. data/lib/webgen/version.rb +1 -1
  79. data/lib/webgen/website.rb +7 -8
  80. data/misc/default.template +1 -1
  81. data/misc/htmldoc.virtual +13 -1
  82. data/test/test_contentprocessor.rb +1 -1
  83. data/test/test_contentprocessor_blocks.rb +16 -1
  84. data/test/test_contentprocessor_erb.rb +1 -1
  85. data/test/test_contentprocessor_fragments.rb +1 -1
  86. data/test/test_contentprocessor_haml.rb +2 -2
  87. data/test/test_contentprocessor_head.rb +54 -8
  88. data/test/test_contentprocessor_kramdown.rb +50 -0
  89. data/test/test_contentprocessor_less.rb +40 -0
  90. data/test/test_contentprocessor_tags.rb +8 -0
  91. data/test/test_node.rb +102 -41
  92. data/test/test_source_tararchive.rb +5 -1
  93. data/test/test_sourcehandler_feed.rb +5 -2
  94. data/test/test_sourcehandler_virtual.rb +5 -0
  95. data/test/test_tag_langbar.rb +2 -3
  96. metadata +22 -16
  97. data/lib/webgen/deprecated.rb +0 -87
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Website Styles Reference
3
3
  ---
4
+ # Website Styles Reference
4
5
 
5
6
  Following is a list of all website styles that are included in the webgen distribution. Each style
6
7
  can be used when creating a website by using the command
@@ -13,7 +14,10 @@ or applied later using the command
13
14
 
14
15
  When you click on the link provided for each website style, you will get a full browser preview of
15
16
  the respective website style. You can then return to this list by using the *back button* of your
16
- browser:
17
+ browser.
18
+
19
+ If you want to create such a style yourself, you may want to read
20
+ [this](manual.html#create-website-style)!
17
21
 
18
22
  <%
19
23
  context.content_node.tree.node_access[:alcn].select do |name, node|
@@ -7,7 +7,7 @@ This is the default source extension used when creating a new webgen website. It
7
7
  match a certain glob (default value for the glob is to match all files) under a specific directory.
8
8
 
9
9
  > The default configuration for a new website uses all files under the `src` directory.
10
- {.information}
10
+ {:.information}
11
11
 
12
12
  The first parameter for the file system source is the directory under which the to-be-used files are
13
13
  and the second, optional, parameter specifies a glob (see [Dir.glob]).
@@ -16,9 +16,9 @@ and the second, optional, parameter specifies a glob (see [Dir.glob]).
16
16
 
17
17
  ## Examples
18
18
 
19
- The used sources can be specified via the [`sources` configuration option]({relocatable:
20
- ../reference_configuration.html#sources}), so each of the examples below can be specified in the
21
- `config.yaml` file.
19
+ The used sources can be specified via the [`sources` configuration
20
+ option](../reference_configuration.html#sources), so each of the examples below can be specified in
21
+ the `config.yaml` file.
22
22
 
23
23
  1. The default configuration: all files under the `src` folder of the website directory
24
24
 
@@ -11,7 +11,7 @@ accessible via the http(s) and ftp protcols.
11
11
  > preferred way to do this is via Rubygems:
12
12
  >
13
13
  > gem install archive-tar-minitar
14
- {.warning}
14
+ {:.warning}
15
15
 
16
16
  The first parameter for the tar archive source is the URL of the archive and the second, optional,
17
17
  parameter specifies a glob (see [File.fnmatch]) for selecting the to-be-used files/directories in the
@@ -22,9 +22,9 @@ tar archive.
22
22
 
23
23
  ## Examples
24
24
 
25
- The used sources can be specified via the [`sources` configuration option]({relocatable:
26
- ../reference_configuration.html#sources}), so each of the examples below can be specified in the
27
- `config.yaml` file.
25
+ The used sources can be specified via the [`sources` configuration
26
+ option](../reference_configuration.html#sources), so each of the examples below can be specified in
27
+ the `config.yaml` file.
28
28
 
29
29
  1. Using all files/directories from a local tar archive in addition the default configuration:
30
30
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  template: extensions.template
3
- --- name:summary pipeline:erb,tags,maruku,blocks
3
+ --- name:summary pipeline:erb,tags,kramdown,blocks
4
4
  <%
5
5
  patterns = context.website.config['sourcehandler.patterns'][context.content_node['title']]
6
6
  if patterns
7
7
  %>
8
- This source handler operates on paths that match one of the following path patterns (see the [path pattern documentation]({relocatable: manual.html#source-pathpattern}) for more information): `<%= patterns.join(', ') %>`
8
+ This source handler operates on paths that match one of the following path patterns (see the [path pattern documentation](manual.html#source-pathpattern) for more information): `<%= patterns.join(', ') %>`
9
9
  <% end %>
10
10
 
11
11
  <%
@@ -4,8 +4,7 @@ title: Webgen::SourceHandler::Feed
4
4
  ## Description
5
5
 
6
6
  This source handler automatically generates an atom or RSS feed for a set of files from a file in
7
- [Webgen Page Format]({relocatable: ../webgen_page_format.html}) (the format which is also used for
8
- page files).
7
+ [Webgen Page Format](../webgen_page_format.html) (the format which is also used for page files).
9
8
 
10
9
  The following meta information keys are supported:
11
10
 
@@ -17,7 +16,7 @@ The following meta information keys are supported:
17
16
  > Be aware that if you want to include a single file or files in a specific language only you
18
17
  > need to include the language part since this is a LCN and not a CN pattern, eg. `mypage.html`
19
18
  > won't work but `mypage.en.html` will!
20
- {.information}
19
+ {:.information}
21
20
 
22
21
  * `number_of_entries` (OPTIONAL)
23
22
 
@@ -80,7 +79,7 @@ The following meta information keys of page files are used if they are specified
80
79
  updated.
81
80
 
82
81
  > This is the field that is used to sort the entries.
83
- {.information}
82
+ {:.information}
84
83
 
85
84
  * `title`
86
85
 
@@ -4,7 +4,7 @@ title: Webgen::SourceHandler::Metainfo
4
4
  ## Description
5
5
 
6
6
  This source handler provides the ability to set meta information for any path. It uses files in
7
- [Webgen Page Format]({relocatable: ../webgen_page_format.html}) which can have two special blocks:
7
+ [Webgen Page Format](../webgen_page_format.html) which can have two special blocks:
8
8
 
9
9
  * `paths`: This block specifies meta information for paths and therefore this meta information is
10
10
  applied before a node for a path is created. This can be used, for example, to change the output
@@ -4,9 +4,9 @@ title: Webgen::SourceHandler::Page
4
4
  ## Description
5
5
 
6
6
  This source handler uses page files which are used to specify the actual content for the website.
7
- These files are written using [Webgen Page Format]({relocatable: ../webgen_page_format.html}).
8
- Therefore they contain the content for the web page and, optionally, meta information. The extension
9
- `page` is changed to `html` for the output file and canonical names.
7
+ These files are written using [Webgen Page Format](../webgen_page_format.html). Therefore they
8
+ contain the content for the web page and, optionally, meta information. The extension `page` is
9
+ changed to `html` for the output file and canonical names.
10
10
 
11
11
  *In contrast* to other handled files, page files can never be unlocalized! If they have no language
12
12
  set, the default language specified using the configuration option `website.lang` is used. This
@@ -4,9 +4,8 @@ title: Webgen::SourceHandler::Sitemap
4
4
  ## Description
5
5
 
6
6
  This source handler automatically generates a sitemap based on the specification of
7
- [sitemaps.org](http://sitemaps.org) from a file in [Webgen Page Format]({relocatable:
8
- ../webgen_page_format.html}). The output and canonical names have the extension `xml` instead of
9
- `sitemap`.
7
+ [sitemaps.org](http://sitemaps.org) from a file in [Webgen Page Format](../webgen_page_format.html).
8
+ The output and canonical names have the extension `xml` instead of `sitemap`.
10
9
 
11
10
  The following meta information keys are supported:
12
11
 
@@ -5,8 +5,8 @@ title: Webgen::SourceHandler::Template
5
5
 
6
6
  The template handler processes the templates files. Templates, as the name already implies, normally
7
7
  specify the layout and the overall "picture" of a web page that is defined using a page file. These
8
- files are in [Webgen Page Format]({relocatable: ../webgen_page_format.html}) (the format which is
9
- also used for page files).
8
+ files are in [Webgen Page Format](../webgen_page_format.html) (the format which is also used for
9
+ page files).
10
10
 
11
11
  The configuration option `sourcehandler.template.default_template` specifies the name of the default
12
12
  template which is used when no explicit template is set via the meta information `template`. webgen
@@ -3,10 +3,10 @@ title: Webgen::SourceHandler::Virtual
3
3
  ---
4
4
  ## Description
5
5
 
6
- This source handler uses files in [Webgen Page Format]({relocatable: ../webgen_page_format.html})
7
- which are used to specify virtual paths. Virtual paths don't really exist as source paths but are
8
- useful nonetheless. For example, they allow to include links to external content in automatically
9
- generated menus. They are never written out since they define no real content!
6
+ This source handler uses files in [Webgen Page Format](../webgen_page_format.html) which are used to
7
+ specify virtual paths. Virtual paths don't really exist as source paths but are useful nonetheless.
8
+ For example, they allow to include links to external content in automatically generated menus. They
9
+ are never written out since they define no real content!
10
10
 
11
11
  The `content` block of the source path is used and its content needs to be a hash in YAML
12
12
  format. The keys are relative or absolute source paths names and the values meta information for
@@ -34,7 +34,7 @@ Following is a sample virtual source files with explanations afterwards:
34
34
 
35
35
  > The example does not use a normal hash but an ordered YAML map. This ensures that the virtual
36
36
  > nodes are created in the order they appear in the file.
37
- {.information}
37
+ {:.information}
38
38
 
39
39
  The first entry specifies that a directory `/documentation` should be created. The virtual file
40
40
  handler recognizes this because the given path ends in a slash!. Then a virtual index file for the
@@ -14,7 +14,7 @@ This tag uses the following options:
14
14
  for option in context.content_node['used_options']
15
15
  temp = 'mandatory' if !context.website.config.meta_info[option][:mandatory].nil?
16
16
  temp += ' default' if context.website.config.meta_info[option][:mandatory] == 'default'
17
- %>* [`<%= option %>`]({relocatable: reference_configuration.html#<%= option.tr('.', '') %>}) <%= temp ? '(' + temp + ')' : '' %>
17
+ %>* [`<%= option %>`]({relocatable: reference_configuration.html#<%= option.tr('._', '') %>}) <%= temp ? '(' + temp + ')' : '' %>
18
18
  <%
19
19
  temp = nil
20
20
  end
@@ -22,13 +22,13 @@ styles, the default external stylesheet file or your own stylesheet file.
22
22
  > It is easy to include and highlight an entire file by combining this tag with the `include_file` tag:
23
23
  >
24
24
  > \{coderay:: ruby}{include_file: test.rb}{coderay}
25
- {.information}
25
+ {:.information}
26
26
 
27
27
  > This extension is only available if you have installed the [coderay][1] library. The preferred
28
28
  > way to do this is via Rubygems:
29
29
  >
30
30
  > gem install coderay
31
- {.warning}
31
+ {:.warning}
32
32
 
33
33
  [1]: http://coderay.rubychan.de/ "The Coderay homepage"
34
34
 
@@ -12,7 +12,7 @@ relative to the website directory or as an absolute filename.
12
12
 
13
13
  > By surrounding the include file tag with a syntax highlighting tag it is possible to highlight the
14
14
  > contents of a file.
15
- {.information}
15
+ {:.information}
16
16
 
17
17
 
18
18
  ## Examples
@@ -24,9 +24,12 @@ display language flags. For example, you can use the following entries in `confi
24
24
  tag.langbar.process_output: true
25
25
 
26
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
27
+ under `src/img/` (otherwise the `relocatable` tag cannot correctly find the paths). To work around
28
28
  this, you could specify the `lang_names` directly in the `langbar` tag.
29
29
 
30
+ The CSS class `webgen-langbar-current-lang` is assigned to the HTML tag for the currently selected
31
+ language.
32
+
30
33
  ## Examples
31
34
 
32
35
  <table class="examples">
@@ -16,7 +16,7 @@ its many options that let you decide every detail of the menu.
16
16
  > The menu is constructed using HTML lists with `ul` and `li` tags. However, the menu normally
17
17
  > looks better if no discs are shown for the menu items (using the CSS directive `list-style-type:
18
18
  > none`).
19
- {.information}
19
+ {:.information}
20
20
 
21
21
  It uses the meta information `in_menu` and `sort_info` to determine which nodes should be in the
22
22
  menu and how they should be ordered. A separate menu tree is then created from all nodes for each
@@ -30,7 +30,7 @@ generating an in-page content menu of all the header sections.
30
30
  >
31
31
  > However, when using the value `all` for `tag.menu.used_nodes`, some nodes which have `in_menu` set
32
32
  > to `false` may appear in the menu if they have fragments beneath them that are in the menu!
33
- {.important}
33
+ {:.important}
34
34
 
35
35
  The rendered menu consists of `ul` and `li` tags and the links (or `span` elements) to the menu
36
36
  entries . The `li` tags have special CSS classes set for styling. These CSS class names are as
@@ -51,7 +51,7 @@ menu.
51
51
 
52
52
  > Set `tag.menu.nested` to `false` if you want to generate, for example, a horizontal menu, ie. a
53
53
  > menu that has one horizontal bar for each menu level.
54
- {.information}
54
+ {:.information}
55
55
 
56
56
  ## "Static" Menus
57
57
 
@@ -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
- {.important}
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
@@ -8,12 +8,11 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
8
8
  * **Update the configuration file `config.yaml`**
9
9
 
10
10
  The configuration file syntax as well as the names of the configuration options and some defaults
11
- changed. For example, the default processing pipeline now uses Maruku (a Markdown converter) as
11
+ changed. For example, the default processing pipeline now uses kramdown (a Markdown converter) as
12
12
  markup language processor instead of Textile. You can find an overview over all available
13
- configuration options in the [configuration option reference]({relocatable:
14
- reference_configuration.html}). Also have a look at the [configuration file
15
- documentation]({relocatable: manual.html#website-configfile}) for more information on the syntax
16
- of this file and the available helpers.
13
+ configuration options in the [configuration option reference](reference_configuration.html). Also
14
+ have a look at the [configuration file documentation](manual.html#website-configfile) for more
15
+ information on the syntax of this file and the available helpers.
17
16
 
18
17
  * Name changes: All configuration options now use underscores to separate word parts instead of
19
18
  camelCase.
@@ -32,22 +31,22 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
32
31
  This file is not supported anymore since webgen 0.5.x uses a more flexible way for specifying meta
33
32
  information and virtual paths. You need to migrate its data to `metainfo` and `virtual` files in
34
33
  the source directory. Have a look at the documentation of the [metainfo source
35
- handler]({relocatable: sourcehandler/metainfo.html}) and the [virtual source
36
- handler]({relocatable: sourcehandler/virtual.html}).
34
+ handler](sourcehandler/metainfo.html) and the [virtual source
35
+ handler](sourcehandler/virtual.html).
37
36
 
38
37
  * **Update meta information names and values**
39
38
 
40
39
  The names of some meta information keys have been changed. Meta information names are not
41
- specified in camelCase anymore but with under\_scores. You can find a complete list of supported
42
- meta information names in the [meta information reference]({relocatable:
43
- reference_metainfo.html}). The most notable changes are:
40
+ specified in camelCase anymore but with under_scores. You can find a complete list of supported
41
+ meta information names in the [meta information reference](reference_metainfo.html). The most
42
+ notable changes are:
44
43
 
45
- * directoryName → routed\_title
46
- * inMenu → in\_menu
47
- * indexFile → index\_path
48
- * omitIndexPath → omit\_index\_path
49
- * outputNameStyle → output\_path\_style
50
- * orderInfo → sort\_info
44
+ * directoryName → routed_title
45
+ * inMenu → in_menu
46
+ * indexFile → index_path
47
+ * omitIndexPath → omit_index_path
48
+ * outputNameStyle → output_path_style
49
+ * orderInfo → sort_info
51
50
 
52
51
  Also be aware that the syntax of some meta information keys has changed. For example, all meta
53
52
  information keys that took a source path name, e.g. `index_path`, now take an localized canonical
@@ -59,7 +58,7 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
59
58
  * `virtual` files
60
59
  * page and template files
61
60
 
62
- * **Files in [Webgen Page Format]({relocatable: webgen_page_format.html})**
61
+ * **Files in [Webgen Page Format](webgen_page_format.html)**
63
62
 
64
63
  Since the format of these files changed a little bit you may need to adapt all your files that use
65
64
  it, that are primarily page and template files. The main change in the format was a different use
@@ -71,15 +70,15 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
71
70
  options. Two options are currently used by webgen: `name` and `pipeline`. So you could change the
72
71
  name and the processing pipeline of a block by using a block start line like:
73
72
 
74
- --- name:other pipeline:tags,maruku,blocks
73
+ --- name:other pipeline:tags,kramdown,blocks
75
74
 
76
75
  * **Block inclusion in template/page files**
77
76
 
78
77
  The way how named blocks are included has changed. This feature is now provided by the content
79
- processor [blocks]({relocatable: contentprocessor/blocks.html}) instead of the tag `block`. This
80
- allows you to specify the point in the processing pipeline when a block should be included. So you
81
- definitely need to update your `default.template` file as well as any other page/template file
82
- where you used the `block` tag.
78
+ processor [blocks](contentprocessor/blocks.html) instead of the tag `block`. This allows you to
79
+ specify the point in the processing pipeline when a block should be included. So you definitely
80
+ need to update your `default.template` file as well as any other page/template file where you used
81
+ the `block` tag.
83
82
 
84
83
  So you need to look for `\{block: content}` tags (where `content` is just a place holder for the
85
84
  name of the block that should be included) and replace them with `<webgen:block name='content'
@@ -87,16 +86,16 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
87
86
 
88
87
  * **Update tag names and parameters**
89
88
 
90
- Since the names of the configuration options changed (from using camelCase to using under\_scores)
89
+ Since the names of the configuration options changed (from using camelCase to using under_scores)
91
90
  and some tags have different options, you need to change all tag parameters. You may also need to
92
- convert old tag names to new ones (same reason: camelCase to under\_score), for example,
91
+ convert old tag names to new ones (same reason: camelCase to under_score), for example,
93
92
  `includeFile` is now `include_file`.
94
93
 
95
94
  * **Update your ERB code**
96
95
 
97
96
  If you have any ERB code in your template or page files you will most certainly have to adapt them
98
- to the new [API]({relocatable: api.html}). One thing that has been used often is the check if a
99
- page file has a certain block:
97
+ to the new [API](api.html). One thing that has been used often is the check if a page file has a
98
+ certain block:
100
99
 
101
100
  <%% if node.node_info[:page_data].blocks.has_key?('NAME') %>
102
101
  ...
@@ -111,10 +110,10 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
111
110
  * **Extensions development**
112
111
 
113
112
  Since the complete core of webgen has changed you need to rewrite all your plugins for the 0.5.x
114
- series. Howver, webgen has complete [API documentation]({relocatable: api.html}) now which
115
- provides you with all needed information as well as examples on how to implement source handlers,
116
- tags, content processors, ... If you still have any questions, don't hesitate to contact me or
117
- write a mail to the mailing list!
113
+ series. Howver, webgen has complete [API documentation](api.html) now which provides you with all
114
+ needed information as well as examples on how to implement source handlers, tags, content
115
+ processors, ... If you still have any questions, don't hesitate to contact me or write a mail to
116
+ the mailing list!
118
117
 
119
118
  * **Running webgen on the converted website**
120
119
 
@@ -136,4 +135,4 @@ Here are step-by-step instructions on how to update your webgen website from 0.4
136
135
  * misc: smiley replacer, html validators
137
136
  * CLI commands: check, show, use
138
137
 
139
- If you need any of those you have to wait till they are implemented or port them on your on.
138
+ If you need any of those you have to wait till they are implemented or port them on your on.
@@ -73,8 +73,8 @@ Each content block needs to have a unique name and additional options can also b
73
73
  uniquely identifies a content block and is used to access it. The only option used by webgen is the
74
74
  `pipeline` option which specifies the processing pipeline for the block. The processing pipeline is
75
75
  used for rendering the block by using the specified content processors in the specified order. There
76
- are many different content processors available - have a look at the [extensions page]({relocatable:
77
- extensions.html}) for an overview.
76
+ are many different content processors available - have a look at the [extensions
77
+ page](extensions.html) for an overview.
78
78
 
79
79
  webgen extensions that use files in Webgen Page Format may specify defaults for the name and the
80
80
  options of a block but these defaults can be overwritten. You can use one of two ways to do this:
@@ -88,14 +88,14 @@ options of a block but these defaults can be overwritten. You can use one of two
88
88
  The following example uses the first technique to override the name and/or the `pipeline` option:
89
89
 
90
90
  1. content block of the file
91
- --- name:sidebar pipeline:maruku,tags
91
+ --- name:sidebar pipeline:kramdown,tags
92
92
  2. content block of the file
93
93
  --- name:other
94
94
  3. content block of the file
95
95
 
96
96
  The first block has no identifieres set (there is no line with three dashes and the identifieres).
97
97
  Therefore the default value for the name is used: `content`. The second block is named `sidebar` and
98
- uses the processing pipeline `maruku,tags`. As you can see, the name of a block as well as
98
+ uses the processing pipeline `kramdown,tags`. As you can see, the name of a block as well as
99
99
  additional options are specified by stating the key (e.g. `name` or `pipeline`) followed by a colon
100
100
  and the value. Multiple options are separated via one or more spaces. The value of a block option is
101
101
  parsed with YAML. For example, when specifying `use_something:true` the value `true` is
@@ -103,14 +103,14 @@ automatically converted from the string `true` to the boolean `true`.
103
103
 
104
104
  > Only the first block gets the default name of `content`. The second and following blocks have
105
105
  > numbered names like `block2`, `block3` and so on.
106
- {.information}
106
+ {:.information}
107
107
 
108
108
  You can also set the name and additional options of the content blocks by using the special `blocks`
109
109
  meta information. It is a hash using the index of a block (or the special value `default`) as key
110
110
  and the options as values. The above example can therefore also be written like this:
111
111
 
112
112
  ---
113
- blocks: \{2: {name: sidebar, pipeline: maruku,tags}, 3: {name: other}}
113
+ blocks: \{2: {name: sidebar, pipeline: kramdown,tags}, 3: {name: other}}
114
114
  ---
115
115
  1. content block of the file
116
116
  ---
@@ -1,7 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  require 'set'
4
- require 'facets/kernel/constant'
5
4
 
6
5
  module Webgen
7
6
 
@@ -74,12 +73,12 @@ module Webgen
74
73
  @volatile = {:classes => @volatile[:classes]}
75
74
  end
76
75
 
77
- # Return the unique instance of the class +name+. This method should be used when it is
78
- # essential that webgen uses only one object of a class or when an object should automatically
79
- # be recreated upon cache restoration (see #restore).
76
+ # Return the unique instance of the class +name+ (a String). This method should be used when it
77
+ # is essential that webgen uses only one object of a class or when an object should
78
+ # automatically be recreated upon cache restoration (see #restore).
80
79
  def instance(name)
81
80
  @permanent[:classes] << name unless @permanent[:classes].include?(name)
82
- (@volatile[:classes] ||= {})[name] ||= constant(name).new
81
+ (@volatile[:classes] ||= {})[name] ||= Common.const_for_name(name).new
83
82
  end
84
83
 
85
84
  end