webgen 0.5.0 → 0.5.1
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/Rakefile +32 -2
- data/VERSION +1 -1
- data/doc/contentprocessor.template +10 -0
- data/doc/contentprocessor/blocks.page +67 -0
- data/doc/contentprocessor/builder.page +80 -0
- data/doc/contentprocessor/erb.page +51 -33
- data/doc/contentprocessor/haml.page +47 -0
- data/doc/contentprocessor/maruku.page +41 -0
- data/doc/contentprocessor/rdoc.page +36 -0
- data/doc/contentprocessor/redcloth.page +40 -0
- data/doc/contentprocessor/sass.page +32 -0
- data/doc/contentprocessor/tags.page +56 -44
- data/doc/extensions.metainfo +29 -0
- data/doc/extensions.page +15 -4
- data/doc/extensions.template +17 -0
- data/doc/reference_configuration.page +242 -5
- data/doc/reference_metainfo.page +9 -0
- data/doc/sourcehandler.template +21 -0
- data/doc/sourcehandler/copy.page +20 -0
- data/doc/sourcehandler/directory.page +27 -0
- data/doc/sourcehandler/metainfo.page +38 -115
- data/doc/sourcehandler/page.page +9 -27
- data/doc/sourcehandler/template.page +45 -0
- data/doc/sourcehandler/virtual.page +49 -0
- data/doc/tag.template +26 -0
- data/doc/tag/breadcrumbtrail.page +32 -0
- data/doc/tag/coderay.page +49 -0
- data/doc/tag/date.page +31 -0
- data/doc/tag/executecommand.page +26 -0
- data/doc/tag/includefile.page +32 -0
- data/doc/tag/langbar.page +22 -0
- data/doc/tag/menu.page +90 -0
- data/doc/tag/metainfo.page +29 -0
- data/doc/tag/relocatable.page +38 -0
- data/doc/webgen_page_format.page +2 -2
- data/lib/webgen/cli/utils.rb +1 -1
- data/lib/webgen/contentprocessor.rb +5 -0
- data/lib/webgen/contentprocessor/builder.rb +26 -0
- data/lib/webgen/contentprocessor/context.rb +4 -0
- data/lib/webgen/contentprocessor/erb.rb +24 -0
- data/lib/webgen/contentprocessor/haml.rb +25 -0
- data/lib/webgen/contentprocessor/maruku.rb +1 -1
- data/lib/webgen/contentprocessor/rdoc.rb +17 -0
- data/lib/webgen/contentprocessor/sass.rb +18 -0
- data/lib/webgen/default_config.rb +41 -10
- data/lib/webgen/node.rb +3 -2
- data/lib/webgen/path.rb +8 -1
- data/lib/webgen/sourcehandler.rb +15 -10
- data/lib/webgen/sourcehandler/page.rb +9 -1
- data/lib/webgen/tag.rb +6 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +39 -0
- data/lib/webgen/tag/coderay.rb +32 -0
- data/lib/webgen/tag/date.rb +18 -0
- data/lib/webgen/tag/executecommand.rb +26 -0
- data/lib/webgen/tag/includefile.rb +42 -0
- data/lib/webgen/tag/langbar.rb +24 -0
- data/lib/webgen/tag/metainfo.rb +1 -1
- data/lib/webgen/version.rb +1 -1
- data/lib/webgen/webgentask.rb +5 -10
- data/misc/default.css +19 -0
- data/misc/default.template +3 -1
- data/misc/htmldoc.metainfo +3 -0
- data/misc/htmldoc.virtual +1 -1
- data/test/test_contentprocessor_builder.rb +19 -0
- data/test/test_contentprocessor_erb.rb +20 -0
- data/test/test_contentprocessor_haml.rb +20 -0
- data/test/test_contentprocessor_rdoc.rb +16 -0
- data/test/test_contentprocessor_sass.rb +20 -0
- data/test/test_node.rb +6 -2
- data/test/test_path.rb +5 -0
- data/test/test_sourcehandler_page.rb +8 -0
- data/test/test_tag_breadcrumbtrail.rb +78 -0
- data/test/test_tag_coderay.rb +30 -0
- data/test/test_tag_date.rb +16 -0
- data/test/test_tag_executecommand.rb +40 -0
- data/test/test_tag_includefile.rb +48 -0
- data/test/test_tag_langbar.rb +53 -0
- data/test/test_tag_menu.rb +1 -1
- data/test/test_webgentask.rb +21 -0
- metadata +81 -2
data/doc/reference_metainfo.page
CHANGED
@@ -73,6 +73,15 @@ path.
|
|
73
73
|
|
74
74
|
Specifies whether an output path for this node gets written or not.
|
75
75
|
|
76
|
+
### omit_index_path
|
77
|
+
|
78
|
+
{:miref}
|
79
|
+
* Boolean: `false`
|
80
|
+
* Index paths
|
81
|
+
|
82
|
+
Controls whether the index path should appear in a breadcrumb trail despite the setting of the
|
83
|
+
`tag.breadcrumbtrail.omit_index_path` option.
|
84
|
+
|
76
85
|
### output\_path\_style
|
77
86
|
|
78
87
|
{:miref}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
template: extensions.template
|
3
|
+
--- name:summary pipeline:erb,tags,maruku,blocks
|
4
|
+
<%
|
5
|
+
patterns = context.website.config['sourcehandler.patterns'][context.content_node['title']]
|
6
|
+
if patterns
|
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(', ') %>`
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<%
|
12
|
+
meta_info = context.website.config['sourcehandler.default_meta_info'][context.content_node['title']]
|
13
|
+
if meta_info
|
14
|
+
%>
|
15
|
+
Following is the default meta information set on any node created by this source handler:
|
16
|
+
<pre>
|
17
|
+
<%= meta_info.to_yaml.gsub(/^---/, '').strip %>
|
18
|
+
</pre>
|
19
|
+
<% end %>
|
20
|
+
--- name:content
|
21
|
+
<webgen:block name='content' />
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::SourceHandler::Copy
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
This source handler copies files from the source to the output directory, optionally running a
|
7
|
+
content processor over the content. It is useful, for example, for CSS stylesheets, javascript files
|
8
|
+
and images.
|
9
|
+
|
10
|
+
It decides using the file extension if a content processor should be used and which one. If the
|
11
|
+
short name of a content processor is the first part of the file extension, the file is processed by
|
12
|
+
this content processor and the first part is removed from the file extension. Otherwise no
|
13
|
+
processing is done at all. For example, a file named `hello.jpg` just gets copied verbatimly but a
|
14
|
+
file named `usage.erb.html` gets preprocessed by the `erb` content processor and written to a file
|
15
|
+
named `usage.html`. As you can see in this example, the processor name gets stripped from the file
|
16
|
+
extension.
|
17
|
+
|
18
|
+
If you want to use a specific content processor for processing a file, have a look at its
|
19
|
+
documentation page which shows the unique identification string that needs to be used in the file
|
20
|
+
extension.
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::SourceHandler::Directory
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
The directory handler is used for handling directories, ie. it creates the target directories.
|
7
|
+
Additionally an index path for each directory can be specified which is used instead of the plain
|
8
|
+
directory index for displaying purposes. This means that when the directory path is specified
|
9
|
+
(e.g. by Webgen::Tag::Relocatable) the index path is returned.
|
10
|
+
|
11
|
+
The name of the index path is specified with the meta information `index_path` which is set to
|
12
|
+
`index.html` by default. This meta information needs to be set directly on the directory node (for
|
13
|
+
example, via a meta information backing file).
|
14
|
+
|
15
|
+
The title for a directory can be set via the `title` meta information on the directory itself.
|
16
|
+
However, if the directory has an index path, the meta information `routed_title` of the index path
|
17
|
+
is used for the directory title. This enables webgen to provide correctly localized directory names.
|
18
|
+
|
19
|
+
Normally, webgen shows a warning if it could not find the directory index path for a directory.
|
20
|
+
However, there are most certainly directories which should not have an index path, for example, a
|
21
|
+
directory containing only images. To prevent webgen from displaying warnings for such directories,
|
22
|
+
you can set a null index path using a meta information backing file:
|
23
|
+
|
24
|
+
dirWithOnlyImages:
|
25
|
+
index_path: ~
|
26
|
+
|
27
|
+
This will prevent webgen from showing warnings because you explicitly define a null index path.
|
@@ -1,117 +1,40 @@
|
|
1
1
|
---
|
2
|
-
title: SourceHandler::Metainfo
|
2
|
+
title: Webgen::SourceHandler::Metainfo
|
3
3
|
---
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
* If the path ends in an slash, a directory node is created with the meta information.
|
42
|
-
|
43
|
-
* Otherwise, a virtual node is created with the specified meta information and empty content - a
|
44
|
-
virtual node _never_ creates a real output file!
|
45
|
-
|
46
|
-
This facility can be used, for example, to specify meta information common to a set of nodes (for
|
47
|
-
example, the author of blog pages), to include links to external web pages in menus or to create a
|
48
|
-
whole menu with custom sections and multiple references in different sections to the same node!
|
49
|
-
|
50
|
-
Following is a sample meta information backing file with explanations afterwards:
|
51
|
-
|
52
|
-
index.page:
|
53
|
-
inMenu: true
|
54
|
-
sort_info: 2
|
55
|
-
|
56
|
-
images:
|
57
|
-
indexFile: ~
|
58
|
-
---
|
59
|
-
index.html:
|
60
|
-
inMenu: false
|
61
|
-
|
62
|
-
wiki.html:
|
63
|
-
title: Link to wiki
|
64
|
-
url: http://myhost.com/path/to/my/wiki
|
65
|
-
inMenu: true
|
66
|
-
sort_info: 5
|
67
|
-
|
68
|
-
api.html:
|
69
|
-
title: API Reference
|
70
|
-
url: http://myhost.com/api
|
71
|
-
|
72
|
-
virtdir/:
|
73
|
-
indexFile: index.html
|
74
|
-
|
75
|
-
virtdir/index.html:
|
76
|
-
title: A virtual index file
|
77
|
-
inMenu: true
|
78
|
-
url: /index.page
|
79
|
-
|
80
|
-
virtdir/other.html:
|
81
|
-
inMenu: true
|
82
|
-
url: /otherdir/linked.de.page
|
83
|
-
|
84
|
-
**/*.html:
|
85
|
-
author: The Real Author
|
86
|
-
|
87
|
-
The above sample meta information backing file consists of both sections: the mandatory source
|
88
|
-
section and the optional output section. As you can see each section is described using a hash of
|
89
|
-
hashes, i.e. the keys are paths and the values are the meta information hashes.
|
90
|
-
|
91
|
-
The source section specifies additional meta information for the `index.page` file and for the
|
92
|
-
`images` directory: the `index.page` gets the `inMenu` and `sort_info` meta information set and it
|
93
|
-
is specified that the `images` directory has no `indexFile`.
|
94
|
-
|
95
|
-
The output section is more interesting than the source section:
|
96
|
-
|
97
|
-
* The first entry references an existing file, therefore the meta information for that file
|
98
|
-
(`index.html`) is set appropriately.
|
99
|
-
|
100
|
-
* The second entry specifies that under the `root` directory a virtual node with the path
|
101
|
-
`wiki.html` should be created (the node will be virtual as the path references no existing file).
|
102
|
-
It should have the specified title and should be in the menu with the specified
|
103
|
-
order. Furthermore, a special *`url`* key is used. This key can only be used for virtual file
|
104
|
-
nodes (not directory nodes) in the output section and it specifies the link target for the node.
|
105
|
-
So, whenever a reference to `wiki.html` is requested the resolved `url` is returned. This `url`
|
106
|
-
can be a link to an outside page or it can refer to another node, as described below. The `url` is
|
107
|
-
assumed to be relative to the directory the virtual node is in.
|
108
|
-
|
109
|
-
* The third entry also specifies a virtual node linking to an external page, but one which will not
|
110
|
-
appear in a menu. Such nodes are normally inserted into the output section so that the
|
111
|
-
Tag/Relocatable plugin can be used.
|
112
|
-
|
113
|
-
* The next three entries add virtual entries to the menu to show how one page can appear in more
|
114
|
-
than one directory: the `virtdir/index.html` links to the top level `index.page` and
|
115
|
-
`virtdir/other.html` links to a page in another subdirectory, namely `/otherdir/linked.de.page`.
|
116
|
-
|
117
|
-
* The last entry set the `author` meta information on all nodes that end with `.html`.
|
4
|
+
## Description
|
5
|
+
|
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:
|
8
|
+
|
9
|
+
* `paths`: This block specifies meta information for paths and therefore this meta information is
|
10
|
+
applied before a node for a path is created. This can be used, for example, to change the output
|
11
|
+
path style. When specifying patterns, remember that the patterns are matched against paths!
|
12
|
+
|
13
|
+
* `alcn`: This block specifies meta information for nodes and this meta information is applied
|
14
|
+
directly after a node has been created. When specifying patterns, remember that the patterns
|
15
|
+
are matched against absolute localized canonical names!
|
16
|
+
|
17
|
+
When no name is specified in the meta information file, the first block is assumed to be the `paths`
|
18
|
+
block and the second block is assumed to be the `alcn` block. The format of the two blocks is the
|
19
|
+
same: they need to be in YAML format and provide a hash with path patterns as keys and the
|
20
|
+
to-be-assigned meta information as values. This is best showed in an example:
|
21
|
+
|
22
|
+
--- name:paths
|
23
|
+
/**/index.page:
|
24
|
+
output_path_style: [:parent, :cnbase, :ext, [., :lang]]
|
25
|
+
|
26
|
+
mypic.jpg:
|
27
|
+
in_menu: true
|
28
|
+
--- name:alcn
|
29
|
+
**/index.en.html:
|
30
|
+
in_menu: true
|
31
|
+
|
32
|
+
All paths named `index.page` are assigned a new output path style. This has to be done in the
|
33
|
+
`paths` block because otherwise it would have no effect. And the file `mypic.jpg` will show up in
|
34
|
+
the menu. Notice, that the first form is specified as an absolute path pattern and the second
|
35
|
+
not. If this meta information file lies in the root directory there is no difference between those
|
36
|
+
two approaches. However, when it lies in a sub directory, the first form is still absolute but the
|
37
|
+
second form is taken relative to the directory in which the meta information file is in.
|
38
|
+
|
39
|
+
And last but not least, all nodes with a localized canonical name of `index.en.html` will show up in
|
40
|
+
the menu (again, notice that the pattern is relative).
|
data/doc/sourcehandler/page.page
CHANGED
@@ -1,32 +1,14 @@
|
|
1
1
|
---
|
2
2
|
title: Webgen::SourceHandler::Page
|
3
3
|
---
|
4
|
+
## Description
|
4
5
|
|
5
|
-
|
6
|
-
{
|
6
|
+
This source handler uses page files which are used to specify the actual content for the
|
7
|
+
website. These files are written using [Webgen Page Format]({relocatable:
|
8
|
+
../webgen_page_format.html}). Therefore they contain the content for the web page and, optionally,
|
9
|
+
meta information.
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
There is a well defined procesing order for files in WebPage Format:
|
14
|
-
|
15
|
-
* After reading in the file, it is split into the blocks.
|
16
|
-
|
17
|
-
* Each content block is converted to HTML (depends on the format specifier) and the HTML sections
|
18
|
-
are resolved (caveat: only those with an `id` attribute)
|
19
|
-
|
20
|
-
* When writing out the file, the converted content is first processed with ERB (if specified to do
|
21
|
-
so),
|
22
|
-
|
23
|
-
* then webgen tags are replaced and,
|
24
|
-
|
25
|
-
* finally, the result is written.
|
26
|
-
|
27
|
-
The first two steps happen when the file is read and the last three when the file is written.
|
28
|
-
|
29
|
-
#### Converting to HTML
|
30
|
-
|
31
|
-
The conversion of a content block to HTML is done via the ContentConverter plugins. Each plugin is
|
32
|
-
able to convert a special marked-up text to HTML.
|
11
|
+
*In contrast* to other handled files, page files can never be unlocalized! If they have no language
|
12
|
+
set, the default language specified using the configuration option `website.lang` is used. This
|
13
|
+
means that for the default language set to English and a source path named `index.page`, the
|
14
|
+
language meta information is automatically set to English.
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::SourceHandler::Template
|
3
|
+
---
|
4
|
+
## Description
|
5
|
+
|
6
|
+
The template handler processes the templates files. Templates, as the name already implies, normally
|
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).
|
10
|
+
|
11
|
+
The configuration option `sourcehandler.template.default_template` specifies the name of the default
|
12
|
+
template which is used when no explicit template is set via the meta information `template`. webgen
|
13
|
+
assumes that the default template is in the same directory as the page file. However, if it can not
|
14
|
+
be found there, the parent directory is searched for it and so on. If a default template isn't found
|
15
|
+
in the root directory, no template is used at all. This means that when you create a default
|
16
|
+
template in the root directory, it is used as template for all page files that have no explicit
|
17
|
+
template set.
|
18
|
+
|
19
|
+
webgen also uses the concept of a template chain to support multiple templates for one page
|
20
|
+
file. For example, assume that
|
21
|
+
|
22
|
+
* the page file `index.page` has set the `template` meta information to `special.template`,
|
23
|
+
* the template `special.template` has no `template` meta information set and
|
24
|
+
* the page file `other.page` also has no `template` meta information set.
|
25
|
+
|
26
|
+
The template chain for `index.page` would look like this
|
27
|
+
|
28
|
+
default.template <-- special.template <-- index.page
|
29
|
+
|
30
|
+
whereas the template chain for `other.page` would look like this
|
31
|
+
|
32
|
+
default.template <-- index.page
|
33
|
+
|
34
|
+
The first case also means that the `special.template` is nested in the `default.template`. This
|
35
|
+
makes it possible, for example, to create a general website layout and then to create a special
|
36
|
+
image gallery layout which uses the general one.
|
37
|
+
|
38
|
+
To stop the template handler from further searching for a template, you explicitly need to set a
|
39
|
+
null template for the page or template file:
|
40
|
+
|
41
|
+
template: ~
|
42
|
+
|
43
|
+
This is useful if you want to have a different `default.template` in a sub directory which should
|
44
|
+
provide a different look-and-feel for this subtree as the `default.template` in the root of the
|
45
|
+
website.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::SourceHandler::Virtual
|
3
|
+
---
|
4
|
+
## Description
|
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!
|
10
|
+
|
11
|
+
The `content` block of the source path is used and its content needs to be a hash in YAML
|
12
|
+
format. The keys are relative or absolute source paths names and the values meta information for
|
13
|
+
them. Any meta information can be set on a virtual path but one meta information key is special:
|
14
|
+
`url`. This meta information specifies, relative to the directory in which the source file is in,
|
15
|
+
the output path for the virtual node. If no `url` meta information is specified, the source path
|
16
|
+
itself is used as output path.
|
17
|
+
|
18
|
+
Following is a sample virtual source files with explanations afterwards:
|
19
|
+
|
20
|
+
\--- !omap
|
21
|
+
- /documentation/:
|
22
|
+
|
23
|
+
- /documentation/index.html:
|
24
|
+
routed_title: Documentation
|
25
|
+
|
26
|
+
- download_and_installation.html:
|
27
|
+
in_menu: true
|
28
|
+
sort_info: 25
|
29
|
+
url: index.html#download__installation
|
30
|
+
|
31
|
+
- /documentation/api.html:
|
32
|
+
title: API Reference
|
33
|
+
url: http://myhost.com/api
|
34
|
+
|
35
|
+
> The example does not use a normal hash but an ordered YAML map. This ensures that the virtual
|
36
|
+
> nodes are created in the order they appear in the file.
|
37
|
+
{.information}
|
38
|
+
|
39
|
+
The first entry specifies that a directory `/documentation` should be created. The virtual file
|
40
|
+
handler recognizes this because the given path ends in a slash!. Then a virtual index file for the
|
41
|
+
virtual directory is created. This would be done, for example, when the documentation directory is
|
42
|
+
created by an external program.
|
43
|
+
|
44
|
+
The third entry specifies a virtual file that should in the menu and should have a certain sort
|
45
|
+
information. When this virtual file is referenced, the path given by the `url` key is returned. This
|
46
|
+
example shows how to make a single link to a fragment appear in automatically generated menus.
|
47
|
+
|
48
|
+
And the fourth entry specifies another virtual file whose output path is an URL pointing to
|
49
|
+
`http://myhost.com/api`.
|
data/doc/tag.template
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
template: extensions.template
|
3
|
+
--- name:summary pipeline:erb,tags,maruku,blocks
|
4
|
+
|
5
|
+
The following tag names are registered for this tag class:
|
6
|
+
<%= context.website.config['contentprocessor.tags.map'].
|
7
|
+
select {|k,v| v == context.content_node['title']}.
|
8
|
+
map {|k,v| '`' + (k.kind_of?(Symbol) ? k.inspect : k.to_s) + '`'}.join(', ') %>
|
9
|
+
|
10
|
+
<% if context.content_node['used_options'] %>
|
11
|
+
This tag uses the following options (see [configuration option reference]({relocatable:
|
12
|
+
reference_configuration.html}) for detailed information on the options):
|
13
|
+
|
14
|
+
<%
|
15
|
+
for option in context.content_node['used_options']
|
16
|
+
temp = 'mandatory' if !context.website.config.meta_info[option][:mandatory].nil?
|
17
|
+
temp += ' default' if context.website.config.meta_info[option][:mandatory] == 'default'
|
18
|
+
%>* `<%= option %>` <%= temp ? '(' + temp + ')' : '' %>
|
19
|
+
<%
|
20
|
+
temp = nil
|
21
|
+
end
|
22
|
+
%>
|
23
|
+
|
24
|
+
<% end %>
|
25
|
+
--- name:content
|
26
|
+
<webgen:block name='content' />
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::Tag::BreadcrumbTrail
|
3
|
+
used_options:
|
4
|
+
- tag.breadcrumbtrail.separator
|
5
|
+
- tag.breadcrumbtrail.omit_last
|
6
|
+
- tag.breadcrumbtrail.omit_index_path
|
7
|
+
---
|
8
|
+
## Description
|
9
|
+
|
10
|
+
The breadcrumb trail tag is used for displaying the hierarchy of the current page. The behavior of
|
11
|
+
the `tag.breadcrumbtrail.omit_index_path` option can be overridden for individual index paths by
|
12
|
+
setting the meta information `omit_index_path` accordingly.
|
13
|
+
|
14
|
+
## Examples
|
15
|
+
|
16
|
+
<table class="examples">
|
17
|
+
<tr>
|
18
|
+
<th>Usage</th><th>Output</th>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<td>\{breadcrumb_trail:}</td>
|
22
|
+
<td>{breadcrumb_trail:}</td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<td>\{breadcrumb_trail: {separator: " HELLO "}}</td>
|
26
|
+
<td>{breadcrumb_trail: {separator: " HELLO "}}</td>
|
27
|
+
</tr>
|
28
|
+
<tr>
|
29
|
+
<td>\{breadcrumb_trail: {omit_last: true}}</td>
|
30
|
+
<td>{breadcrumb_trail: {omit_last: true}}</td>
|
31
|
+
</tr>
|
32
|
+
</table>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
title: Webgen::Tag::Coderay
|
3
|
+
used_options:
|
4
|
+
- tag.coderay.lang
|
5
|
+
- tag.coderay.process_body
|
6
|
+
- tag.coderay.wrap
|
7
|
+
- tag.coderay.line_numbers
|
8
|
+
- tag.coderay.line_number_start
|
9
|
+
- tag.coderay.bold_every
|
10
|
+
- tag.coderay.tab_width
|
11
|
+
---
|
12
|
+
## Description
|
13
|
+
|
14
|
+
This tag applies syntax highlighting to its body by using the [coderay][1] library which can be used
|
15
|
+
to highlight many different languages (see `tag.coderay.lang` documentation). The body of the tag
|
16
|
+
specifies what should be highlighted.
|
17
|
+
|
18
|
+
> It is easy to include and highlight an entire file by combining this tag with the `include_file` tag:
|
19
|
+
>
|
20
|
+
> \{coderay:: ruby}{include_file: test.rb}{coderay}
|
21
|
+
{.information}
|
22
|
+
|
23
|
+
> This extension is only available if you have installed the [coderay][1] library. The preferred
|
24
|
+
> way to do this is via Rubygems:
|
25
|
+
>
|
26
|
+
> gem install coderay
|
27
|
+
{.exclamation}
|
28
|
+
|
29
|
+
[1]: http://coderay.rubychan.de/ "The Coderay homepage"
|
30
|
+
|
31
|
+
## Examples
|
32
|
+
|
33
|
+
<table class="examples">
|
34
|
+
<tr>
|
35
|
+
<th>Usage</th><th>Output</th>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td>\{coderay:: {lang: ruby, bold_every: 2}}{include_file: lib/webgen/version.rb}{coderay}</td>
|
39
|
+
<% if File.exists?(File.join(context.website.directory, 'lib/webgen/version.rb')) %>
|
40
|
+
<td>{coderay:: {lang: ruby, bold_every: 2}}{include_file: lib/webgen/version.rb}{coderay}</td>
|
41
|
+
<% else %>
|
42
|
+
<td>{coderay:: {lang: ruby, bold_every: 2}}{include_file: ../lib/webgen/version.rb}{coderay}</td>
|
43
|
+
<% end %>
|
44
|
+
</tr>
|
45
|
+
<tr>
|
46
|
+
<td>\{coderay:: {lang: ruby, wrap: span}}puts 5+5{coderay}</td>
|
47
|
+
<td><code>{coderay:: {lang: ruby, wrap: span}}puts 5+5{coderay}</code></td>
|
48
|
+
</tr>
|
49
|
+
</table>
|