webgen 0.5.5 → 0.5.6
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/ChangeLog +3662 -0
- data/Rakefile +8 -1
- data/VERSION +1 -1
- data/data/webgen/website_styles/1024px/src/default.template +1 -1
- data/data/webgen/website_styles/andreas00/src/default.template +1 -1
- data/data/webgen/website_styles/andreas01/src/default.template +2 -1
- data/data/webgen/website_styles/andreas03/src/default.template +1 -1
- data/data/webgen/website_styles/andreas04/src/default.template +1 -1
- data/data/webgen/website_styles/andreas05/src/default.template +1 -1
- data/data/webgen/website_styles/andreas06/src/default.template +1 -1
- data/data/webgen/website_styles/andreas07/src/default.template +1 -1
- data/data/webgen/website_styles/andreas08/src/default.template +1 -1
- data/data/webgen/website_styles/andreas09/src/default.template +1 -1
- data/data/webgen/website_styles/simple/src/default.template +1 -1
- data/doc/contentprocessor/fragments.page +25 -0
- data/doc/extensions.page +1 -1
- data/doc/manual.page +33 -15
- data/doc/reference_configuration.page +339 -62
- data/doc/reference_metainfo.page +11 -2
- data/doc/sourcehandler/feed.page +19 -4
- data/doc/sourcehandler/page.page +0 -16
- data/doc/tag/langbar.page +8 -1
- data/doc/tag/link.page +44 -0
- data/doc/tag/tikz.page +158 -0
- data/lib/webgen/cli.rb +4 -4
- data/lib/webgen/common/sitemap.rb +2 -3
- data/lib/webgen/configuration.rb +3 -1
- data/lib/webgen/contentprocessor.rb +1 -0
- data/lib/webgen/contentprocessor/blocks.rb +0 -2
- data/lib/webgen/contentprocessor/context.rb +0 -3
- data/lib/webgen/contentprocessor/erubis.rb +0 -2
- data/lib/webgen/contentprocessor/fragments.rb +23 -0
- data/lib/webgen/default_config.rb +15 -2
- data/lib/webgen/languages.rb +9 -0
- data/lib/webgen/logger.rb +18 -1
- data/lib/webgen/node.rb +50 -25
- data/lib/webgen/page.rb +26 -16
- data/lib/webgen/path.rb +20 -10
- data/lib/webgen/sourcehandler.rb +85 -69
- data/lib/webgen/sourcehandler/base.rb +38 -15
- data/lib/webgen/sourcehandler/copy.rb +2 -2
- data/lib/webgen/sourcehandler/directory.rb +16 -13
- data/lib/webgen/sourcehandler/feed.rb +6 -12
- data/lib/webgen/sourcehandler/fragment.rb +6 -11
- data/lib/webgen/sourcehandler/memory.rb +41 -0
- data/lib/webgen/sourcehandler/metainfo.rb +21 -21
- data/lib/webgen/sourcehandler/page.rb +7 -27
- data/lib/webgen/sourcehandler/sitemap.rb +0 -2
- data/lib/webgen/sourcehandler/template.rb +0 -4
- data/lib/webgen/sourcehandler/virtual.rb +18 -18
- data/lib/webgen/tag.rb +2 -0
- data/lib/webgen/tag/breadcrumbtrail.rb +1 -4
- data/lib/webgen/tag/coderay.rb +0 -3
- data/lib/webgen/tag/date.rb +0 -2
- data/lib/webgen/tag/executecommand.rb +1 -2
- data/lib/webgen/tag/includefile.rb +1 -3
- data/lib/webgen/tag/langbar.rb +2 -5
- data/lib/webgen/tag/link.rb +23 -0
- data/lib/webgen/tag/menu.rb +1 -4
- data/lib/webgen/tag/metainfo.rb +0 -2
- data/lib/webgen/tag/relocatable.rb +2 -3
- data/lib/webgen/tag/sitemap.rb +0 -3
- data/lib/webgen/tag/tikz.rb +117 -0
- data/lib/webgen/tree.rb +11 -6
- data/lib/webgen/version.rb +1 -1
- data/lib/webgen/website.rb +2 -1
- data/test/test_cli.rb +14 -0
- data/test/test_common_sitemap.rb +4 -4
- data/test/test_contentprocessor_context.rb +1 -1
- data/test/test_contentprocessor_fragments.rb +40 -0
- data/test/test_contentprocessor_redcloth.rb +1 -0
- data/test/test_contentprocessor_tags.rb +1 -1
- data/test/test_languages.rb +12 -0
- data/test/test_logger.rb +19 -0
- data/test/test_node.rb +35 -15
- data/test/test_output_filesystem.rb +1 -1
- data/test/test_page.rb +15 -6
- data/test/test_path.rb +37 -5
- data/test/test_source_filesystem.rb +1 -1
- data/test/test_source_stacked.rb +1 -1
- data/test/test_sourcehandler_base.rb +30 -1
- data/test/test_sourcehandler_copy.rb +1 -1
- data/test/test_sourcehandler_directory.rb +16 -1
- data/test/test_sourcehandler_feed.rb +9 -8
- data/test/test_sourcehandler_fragment.rb +1 -1
- data/test/test_sourcehandler_memory.rb +42 -0
- data/test/test_sourcehandler_metainfo.rb +23 -21
- data/test/test_sourcehandler_page.rb +5 -12
- data/test/test_sourcehandler_template.rb +1 -1
- data/test/test_sourcehandler_virtual.rb +2 -2
- data/test/test_tag_base.rb +0 -1
- data/test/test_tag_breadcrumbtrail.rb +4 -4
- data/test/test_tag_includefile.rb +3 -3
- data/test/test_tag_langbar.rb +12 -7
- data/test/test_tag_link.rb +61 -0
- data/test/test_tag_menu.rb +7 -7
- data/test/test_tag_metainfo.rb +1 -1
- data/test/test_tag_relocatable.rb +1 -1
- data/test/test_tag_tikz.rb +66 -0
- data/test/test_tree.rb +8 -9
- metadata +15 -2
data/doc/reference_metainfo.page
CHANGED
|
@@ -60,6 +60,10 @@ never`.
|
|
|
60
60
|
Sets the time when the path was created. This information cannot automatically be derived for paths
|
|
61
61
|
provided by Webgen::Source::FileSystem, so this has to be set manually.
|
|
62
62
|
|
|
63
|
+
> Note that the value needs to be a valid [YAML timestamp](http://yaml.org/type/timestamp.html) and
|
|
64
|
+
> needs to include the time part.
|
|
65
|
+
{.information}
|
|
66
|
+
|
|
63
67
|
### draft
|
|
64
68
|
|
|
65
69
|
{:miref}
|
|
@@ -127,8 +131,13 @@ path.
|
|
|
127
131
|
* Any
|
|
128
132
|
|
|
129
133
|
Sets the time when the path was last modified. This information is automatically set for paths
|
|
130
|
-
provided by Webgen::Source::FileSystem but can be overridden by
|
|
131
|
-
valid time, the time when webgen is executed is used for this
|
|
134
|
+
provided by Webgen::Source::FileSystem (the file modification is used) but can be overridden by
|
|
135
|
+
setting it manually. If not set to a valid time, the time when webgen is executed is used for this
|
|
136
|
+
meta information.
|
|
137
|
+
|
|
138
|
+
> Note that the value needs to be a valid [YAML timestamp](http://yaml.org/type/timestamp.html) and
|
|
139
|
+
> needs to include the time part.
|
|
140
|
+
{.information}
|
|
132
141
|
|
|
133
142
|
### no\_output
|
|
134
143
|
|
data/doc/sourcehandler/feed.page
CHANGED
|
@@ -14,6 +14,11 @@ The following meta information keys are supported:
|
|
|
14
14
|
A LCN pattern (or an array of LCN patterns) which specify the page files that should be
|
|
15
15
|
used. Other matched files are excluded from the list.
|
|
16
16
|
|
|
17
|
+
> Be aware that if you want to include a single file or files in a specific language only you
|
|
18
|
+
> need to include the language part since this is a LCN and not a CN pattern, eg. `mypage.html`
|
|
19
|
+
> won't work but `mypage.en.html` will!
|
|
20
|
+
{.information}
|
|
21
|
+
|
|
17
22
|
* `number_of_entries` (OPTIONAL)
|
|
18
23
|
|
|
19
24
|
The number of entries that should be included in the feed. Defaults to 10.
|
|
@@ -26,6 +31,10 @@ The following meta information keys are supported:
|
|
|
26
31
|
|
|
27
32
|
A RSS feed is generated if this key is set to `true`. Defaults to `true`.
|
|
28
33
|
|
|
34
|
+
* `rss_version` (OPTIONAL)
|
|
35
|
+
|
|
36
|
+
The RSS version that should be used for generating the RSS feed. Defaults to `2.0`.
|
|
37
|
+
|
|
29
38
|
* `site_url` (MANDATORY)
|
|
30
39
|
|
|
31
40
|
The base url of the website for which the feed is generated.
|
|
@@ -48,11 +57,14 @@ The following meta information keys are supported:
|
|
|
48
57
|
|
|
49
58
|
* `created_at` (OPTIONAL)
|
|
50
59
|
|
|
51
|
-
The time at which this feed was created. Defaults to the current time if not set.
|
|
60
|
+
The time at which this feed was created. Defaults to the current time if not set. Has the same
|
|
61
|
+
format as the meta information `created_at`.
|
|
52
62
|
|
|
53
|
-
* `
|
|
63
|
+
* `content_block_name` (OPTIONAL)
|
|
54
64
|
|
|
55
|
-
The
|
|
65
|
+
The name of the block that should be used for the content of the feed entries. If not specified
|
|
66
|
+
the name `content` is used. Be aware that each page file that can appear in the feed needs to
|
|
67
|
+
have such a block!
|
|
56
68
|
|
|
57
69
|
The following meta information keys of page files are used if they are specified:
|
|
58
70
|
|
|
@@ -65,6 +77,9 @@ The following meta information keys of page files are used if they are specified
|
|
|
65
77
|
The time at which the page file was last modified, used as the time at which this feed entry was
|
|
66
78
|
updated.
|
|
67
79
|
|
|
80
|
+
> This is the field that is used to sort the entries.
|
|
81
|
+
{.information}
|
|
82
|
+
|
|
68
83
|
* `title`
|
|
69
84
|
|
|
70
85
|
The title of the page file, used as title of the feed entry.
|
|
@@ -79,4 +94,4 @@ The following meta information keys of page files are used if they are specified
|
|
|
79
94
|
|
|
80
95
|
The default implementation supports the generation of atom and RSS feeds. You can override the
|
|
81
96
|
default generation mechanism by adding an `atom_template` and/or `rss_template` block in the feed
|
|
82
|
-
file which are then used to generate the atom or the RSS feed respectively.
|
|
97
|
+
file which are then used to generate the atom or the RSS feed respectively.
|
data/doc/sourcehandler/page.page
CHANGED
|
@@ -12,19 +12,3 @@ meta information.
|
|
|
12
12
|
set, the default language specified using the configuration option `website.lang` is used. This
|
|
13
13
|
means that for the default language set to English and a source path named `index.page`, the
|
|
14
14
|
language meta information is automatically set to English.
|
|
15
|
-
|
|
16
|
-
## Fragment nodes
|
|
17
|
-
|
|
18
|
-
The page handler automatically generates fragment nodes for all found header tags in the block named
|
|
19
|
-
`content` (i.e. `h1`, `h2`, ...) that have an `id` attribute set. The default markup language Maruku
|
|
20
|
-
automatically generates an `id` attribute for all headers. If you use another markup language or
|
|
21
|
-
plain old HTML, you might need to set the `id` attributes by hand.
|
|
22
|
-
|
|
23
|
-
> The reason why only header tags with an `id` attribute are used is that only those can be
|
|
24
|
-
> referenced and linked to later.
|
|
25
|
-
{.information}
|
|
26
|
-
|
|
27
|
-
The generated fragment nodes can be used like any other node. So you can link to them and use them
|
|
28
|
-
in a menu. Concerning the menu, there is a setting for the `tag.menu.used_nodes` option called
|
|
29
|
-
`fragments` which only uses the fragment node of the current page to generate a menu. This allows to
|
|
30
|
-
generate a nice overview of the page.
|
data/doc/tag/langbar.page
CHANGED
|
@@ -4,10 +4,13 @@ used_options:
|
|
|
4
4
|
- tag.langbar.separator
|
|
5
5
|
- tag.langbar.show_own_lang
|
|
6
6
|
- tag.langbar.show_single_lang
|
|
7
|
+
- tag.langbar.lang_names
|
|
7
8
|
---
|
|
8
9
|
## Description
|
|
9
10
|
|
|
10
|
-
This tag is used to display a list of links to translations of the page.
|
|
11
|
+
This tag is used to display a list of links to translations of the page. The text that is displayed
|
|
12
|
+
can be set via the configuration option `tag.langbar.lang_names` (if not set, the language code is
|
|
13
|
+
shown).
|
|
11
14
|
|
|
12
15
|
## Examples
|
|
13
16
|
|
|
@@ -19,4 +22,8 @@ This tag is used to display a list of links to translations of the page.
|
|
|
19
22
|
<td>\{langbar:}</td>
|
|
20
23
|
<td>{langbar:}</td>
|
|
21
24
|
</tr>
|
|
25
|
+
<tr>
|
|
26
|
+
<td>\{langbar: {lang_names: {en: Englisch}}}</td>
|
|
27
|
+
<td>{langbar: {lang_names: {en: Englisch}}}</td>
|
|
28
|
+
</tr>
|
|
22
29
|
</table>
|
data/doc/tag/link.page
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Webgen::Tag::Link
|
|
3
|
+
used_options:
|
|
4
|
+
- tag.link.path
|
|
5
|
+
- tag.link.attr
|
|
6
|
+
---
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
This tag can be used to generate a link to an (absolute) (localized) canonical path. The generated
|
|
10
|
+
link will behave exactly like the ones generated by, for example, the breadcrumb trail tag or the
|
|
11
|
+
menu tag. So it respects the setting of the configuration option `website.link_to_current_page`
|
|
12
|
+
which means that if this option is set to `false` only a `span` element and not an `a` element is
|
|
13
|
+
created.
|
|
14
|
+
|
|
15
|
+
The configuration option `tag.link.attr` lets you specify additional HTML options that should be set
|
|
16
|
+
on the generated link. It can also be used to set the link text via the special `:link_text` key!
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
<table class="examples">
|
|
21
|
+
<tr>
|
|
22
|
+
<th>Usage</th><th>Output</th>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr>
|
|
25
|
+
<td>\{link: /default.css}</td>
|
|
26
|
+
<td>{link: /default.css}</td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<td>\{link: link.html}</td>
|
|
30
|
+
<td>{link: link.html}</td>
|
|
31
|
+
</tr>
|
|
32
|
+
<tr>
|
|
33
|
+
<td>\{link: link.html#description}</td>
|
|
34
|
+
<td>{link: link.html#description}</td>
|
|
35
|
+
</tr>
|
|
36
|
+
<tr>
|
|
37
|
+
<td>\{link: ../}</td>
|
|
38
|
+
<td>{link: ../}</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td>\{link: {path: relocatable.html, attr: {:link_text: A nicer link text, title: Just a title}}}</td>
|
|
42
|
+
<td>{link: {path: relocatable.html, attr: {:link_text: A nicer link text, title: Just a title}}}</td>
|
|
43
|
+
</tr>
|
|
44
|
+
</table>
|
data/doc/tag/tikz.page
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Webgen::Tag::TikZ
|
|
3
|
+
used_options:
|
|
4
|
+
- tag.tikz.path
|
|
5
|
+
- tag.tikz.libraries
|
|
6
|
+
- tag.tikz.opts
|
|
7
|
+
- tag.tikz.resolution
|
|
8
|
+
- tag.tikz.transparent
|
|
9
|
+
- tag.tikz.img_attr
|
|
10
|
+
---
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
This tag provides support for automatically generating graphics with the fantastic PGF/TikZ library
|
|
14
|
+
for LaTeX. You will need to have a current LaTeX distribution with the PGF/TikZ library installed
|
|
15
|
+
and ImageMagick for this to work. You will also need Ghostscript if you want support for transparent
|
|
16
|
+
PNG images. More exactly, you will need to have the programs `pdflatex` (usually included in the
|
|
17
|
+
LaTeX distribution - for generating a PDF from the LaTeX document that describes the PGF/TikZ
|
|
18
|
+
graphic), `pdfcrop` (usually included in the LaTeX distribution - to crop the generated PDF and
|
|
19
|
+
throw away useless borders), `convert` (provided by ImageMagick - to convert the generated PDF
|
|
20
|
+
document to an image file format and to optionally resize them) and `gs` (provided by the
|
|
21
|
+
Ghostscript package - to generate transparent PNG images).
|
|
22
|
+
|
|
23
|
+
When using this tag, you need to set at least the default mandatory parameter `tag.tikz.path`. This
|
|
24
|
+
path specifies the source path that should be used for generating the image and should not
|
|
25
|
+
exist. The output path is dervied from this path the usual way. The extension used for this
|
|
26
|
+
parameter specifies the final image format that is used (a good choice is PNG). All other parameters
|
|
27
|
+
are optional. The commands for creating the PGF/TikZ picture are specified in the body of the
|
|
28
|
+
tag. Have a look at some of the examples below to set the power of PGF/TikZ.
|
|
29
|
+
|
|
30
|
+
If you want to generate transparent images, you will need to set `tag.tikz.transparent` to `true`
|
|
31
|
+
and specify a `tag.tikz.path` with a `.png` extension.
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
These examples are taken (sometimes a little bit altered) from the great PGF Manual included in the
|
|
36
|
+
PGF/TikZ distribution.
|
|
37
|
+
|
|
38
|
+
<table class="examples">
|
|
39
|
+
<tr>
|
|
40
|
+
<th>Usage</th><th>Output</th>
|
|
41
|
+
</tr>
|
|
42
|
+
|
|
43
|
+
<tr>
|
|
44
|
+
<td>
|
|
45
|
+
<pre>
|
|
46
|
+
\{tikz:: house.png}
|
|
47
|
+
\tikz \draw[thick,rounded corners=8pt]
|
|
48
|
+
(0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) -- (2,0);
|
|
49
|
+
{tikz}
|
|
50
|
+
</pre>
|
|
51
|
+
</td>
|
|
52
|
+
<td>
|
|
53
|
+
{tikz:: house.png}
|
|
54
|
+
\tikz \draw[thick,rounded corners=8pt]
|
|
55
|
+
(0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) -- (2,0);
|
|
56
|
+
{tikz}
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
|
|
60
|
+
<tr>
|
|
61
|
+
<td>
|
|
62
|
+
<pre>
|
|
63
|
+
\{tikz:: {path: chain.png, libraries: [arrows,automata,shadows,positioning],
|
|
64
|
+
opts: "->,>=stealth,shorten >=1pt,auto,node distance=2.8cm,on grid,semithick,
|
|
65
|
+
every state/.style={fill=red,draw=none,circular drop shadow,text=white}",
|
|
66
|
+
resolution: 300 72}}
|
|
67
|
+
\node[initial,state] (A) {$q_a$};
|
|
68
|
+
\node[state] (B) [above right=of A] {$q_b$};
|
|
69
|
+
\node[state] (D) [below right=of A] {$q_d$};
|
|
70
|
+
\node[state] (C) [below right=of B] {$q_c$};
|
|
71
|
+
\node[state] (E) [below=of D] {$q_e$};
|
|
72
|
+
\path (A) edge node {0,1,L} (B)
|
|
73
|
+
edge node {1,1,R} (C)
|
|
74
|
+
(B) edge [loop above] node {1,1,L} (B)
|
|
75
|
+
edge node {0,1,L} (C)
|
|
76
|
+
(C) edge node {0,1,L} (D)
|
|
77
|
+
edge [bend left] node {1,0,R} (E)
|
|
78
|
+
(D) edge [loop below] node {1,1,R} (D)
|
|
79
|
+
edge node {0,1,R} (A)
|
|
80
|
+
(E) edge [bend left] node {1,0,R} (A);
|
|
81
|
+
{tikz}
|
|
82
|
+
</pre>
|
|
83
|
+
</td>
|
|
84
|
+
<td>
|
|
85
|
+
{tikz:: {path: chain.png, libraries: [arrows,automata,shadows,positioning],
|
|
86
|
+
opts: "->,>=stealth,shorten >=1pt,auto,node distance=2.8cm,on grid,semithick,
|
|
87
|
+
every state/.style={fill=red,draw=none,circular drop shadow,text=white}"}}
|
|
88
|
+
\node[initial,state] (A) {$q_a$};
|
|
89
|
+
\node[state] (B) [above right=of A] {$q_b$};
|
|
90
|
+
\node[state] (D) [below right=of A] {$q_d$};
|
|
91
|
+
\node[state] (C) [below right=of B] {$q_c$};
|
|
92
|
+
\node[state] (E) [below=of D] {$q_e$};
|
|
93
|
+
\path (A) edge node {0,1,L} (B)
|
|
94
|
+
edge node {1,1,R} (C)
|
|
95
|
+
(B) edge [loop above] node {1,1,L} (B)
|
|
96
|
+
edge node {0,1,L} (C)
|
|
97
|
+
(C) edge node {0,1,L} (D)
|
|
98
|
+
edge [bend left] node {1,0,R} (E)
|
|
99
|
+
(D) edge [loop below] node {1,1,R} (D)
|
|
100
|
+
edge node {0,1,R} (A)
|
|
101
|
+
(E) edge [bend left] node {1,0,R} (A);
|
|
102
|
+
{tikz}
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
|
|
106
|
+
<tr>
|
|
107
|
+
<td>
|
|
108
|
+
Not transparent and standard res
|
|
109
|
+
<pre>
|
|
110
|
+
\{tikz:: {path: mindmap.png, libraries: [mindmap]}}
|
|
111
|
+
\path[mindmap,concept color=black,text=white]
|
|
112
|
+
node[concept] {Computer Science}
|
|
113
|
+
[clockwise from=0]
|
|
114
|
+
child[concept color=red] { node[concept] {technical} }
|
|
115
|
+
child[concept color=orange] { node[concept] {theoretical} };
|
|
116
|
+
{tikz}
|
|
117
|
+
</pre>
|
|
118
|
+
</td>
|
|
119
|
+
<td>
|
|
120
|
+
{tikz:: {path: mindmap.png, libraries: [mindmap]}}
|
|
121
|
+
\path[mindmap,concept color=black,text=white]
|
|
122
|
+
node[concept] {Computer Science}
|
|
123
|
+
[clockwise from=0]
|
|
124
|
+
child[concept color=red] { node[concept] {technical} }
|
|
125
|
+
child[concept color=orange] { node[concept] {theoretical} };
|
|
126
|
+
{tikz}
|
|
127
|
+
</td>
|
|
128
|
+
</tr>
|
|
129
|
+
|
|
130
|
+
<tr>
|
|
131
|
+
<td>
|
|
132
|
+
Transparent and high res
|
|
133
|
+
<pre>
|
|
134
|
+
\{tikz:: {path: mindmap-low.png, libraries: [mindmap],
|
|
135
|
+
img_attr: {style: 'background:transparent'},
|
|
136
|
+
transparent: true, resolution: 300 72}}
|
|
137
|
+
\path[mindmap,concept color=black,text=white]
|
|
138
|
+
node[concept] {Computer Science}
|
|
139
|
+
[clockwise from=0]
|
|
140
|
+
child[concept color=red] { node[concept] {technical} }
|
|
141
|
+
child[concept color=orange] { node[concept] {theoretical} };
|
|
142
|
+
{tikz}
|
|
143
|
+
</pre>
|
|
144
|
+
</td>
|
|
145
|
+
<td>
|
|
146
|
+
{tikz:: {path: mindmap-high.png, libraries: [mindmap],
|
|
147
|
+
img_attr: {style: 'background:transparent'},
|
|
148
|
+
transparent: true, resolution: 300 72}}
|
|
149
|
+
\path[mindmap,concept color=black,text=white]
|
|
150
|
+
node[concept] {Computer Science}
|
|
151
|
+
[clockwise from=0]
|
|
152
|
+
child[concept color=red] { node[concept] {technical} }
|
|
153
|
+
child[concept color=orange] { node[concept] {theoretical} };
|
|
154
|
+
{tikz}
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
|
|
158
|
+
</table>
|
data/lib/webgen/cli.rb
CHANGED
|
@@ -88,16 +88,16 @@ module Webgen
|
|
|
88
88
|
self.program_version = Webgen::VERSION
|
|
89
89
|
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
90
90
|
opts.separator "Global options:"
|
|
91
|
-
opts.on("--directory DIR", "-d", String, "The website directory (default: the current directory)") {
|
|
91
|
+
opts.on("--directory DIR", "-d", String, "The website directory (default: the current directory)") {|p| @directory = p}
|
|
92
92
|
opts.on("--verbose", "-v", "Print more output") { @verbosity = :verbose }
|
|
93
93
|
opts.on("--quiet", "-q", "No output") { @verbosity = :quiet }
|
|
94
|
-
opts.on("--log-level LEVEL", "-l", Integer, "The logging level (0..debug, 3..error)") {
|
|
95
|
-
opts.on("--log-filter", "-f", Regexp, 'Filter for logging events') {
|
|
94
|
+
opts.on("--log-level LEVEL", "-l", Integer, "The logging level (0..debug, 3..error)") {|p| @log_level = p}
|
|
95
|
+
opts.on("--log-filter", "-f", Regexp, 'Filter for logging events') {|p| @log_filter = p}
|
|
96
96
|
end
|
|
97
97
|
self.add_command(CmdParse::HelpCommand.new)
|
|
98
98
|
self.add_command(CmdParse::VersionCommand.new)
|
|
99
99
|
Webgen::CLI.constants.select {|c| c =~ /.+Command$/ }.each do |c|
|
|
100
|
-
self.add_command(Webgen::CLI.const_get(c).new, (c == 'RunCommand' ? true : false))
|
|
100
|
+
self.add_command(Webgen::CLI.const_get(c).new, (c.to_s == 'RunCommand' ? true : false))
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require 'webgen/tag
|
|
1
|
+
require 'webgen/tag'
|
|
2
2
|
require 'webgen/websiteaccess'
|
|
3
3
|
|
|
4
4
|
module Webgen::Common
|
|
@@ -64,13 +64,12 @@ module Webgen::Common
|
|
|
64
64
|
(tree.flatten.any? do |alcn|
|
|
65
65
|
(n = node.tree[alcn]) && (r = n.routing_node(lang)) && r.meta_info_changed?
|
|
66
66
|
end)
|
|
67
|
-
node.dirty
|
|
67
|
+
node.flag(:dirty)
|
|
68
68
|
break
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
|
|
74
73
|
end
|
|
75
74
|
|
|
76
75
|
end
|
data/lib/webgen/configuration.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'facets/symbol/to_proc'
|
|
2
|
+
|
|
1
3
|
module Webgen
|
|
2
4
|
|
|
3
5
|
# Stores the configuration for a webgen website.
|
|
@@ -99,7 +101,7 @@ module Webgen
|
|
|
99
101
|
# Complete +sh_name+ by checking if a source handler called
|
|
100
102
|
# <tt>Webgen::SourceHandler::SH_NAME</tt> exists.
|
|
101
103
|
def complete_source_handler_name(sh_name)
|
|
102
|
-
(Webgen::SourceHandler.constants.include?(sh_name) ? 'Webgen::SourceHandler::' + sh_name : sh_name)
|
|
104
|
+
(Webgen::SourceHandler.constants.map(&:to_s).include?(sh_name) ? 'Webgen::SourceHandler::' + sh_name : sh_name)
|
|
103
105
|
end
|
|
104
106
|
private :complete_source_handler_name
|
|
105
107
|
|
|
@@ -65,6 +65,7 @@ module Webgen
|
|
|
65
65
|
autoload :Builder, 'webgen/contentprocessor/builder'
|
|
66
66
|
autoload :Erubis, 'webgen/contentprocessor/erubis'
|
|
67
67
|
autoload :RDiscount, 'webgen/contentprocessor/rdiscount'
|
|
68
|
+
autoload :Fragments, 'webgen/contentprocessor/fragments'
|
|
68
69
|
|
|
69
70
|
# Return the list of all available content processors.
|
|
70
71
|
def self.list
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Webgen::ContentProcessor
|
|
2
|
+
|
|
3
|
+
# Uses the HTML headers h1, h2, ..., h6 to generate nested fragment nodes.
|
|
4
|
+
class Fragments
|
|
5
|
+
|
|
6
|
+
include Webgen::WebsiteAccess
|
|
7
|
+
|
|
8
|
+
# Generate the nested fragment nodes from <tt>context.content</tt> under
|
|
9
|
+
# <tt>content.content_node</tt> but only if there is no associated <tt>:block</tt> data in
|
|
10
|
+
# +context+ or the block is named +content+.
|
|
11
|
+
def call(context)
|
|
12
|
+
if !context[:block] || context[:block].name == 'content'
|
|
13
|
+
sections = website.blackboard.invoke(:parse_html_headers, context.content)
|
|
14
|
+
website.blackboard.invoke(:create_fragment_nodes, sections, context.content_node,
|
|
15
|
+
website.blackboard.invoke(:source_paths)[context.content_node.node_info[:src]],
|
|
16
|
+
context.content_node.meta_info['fragments_in_menu'])
|
|
17
|
+
end
|
|
18
|
+
context
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -54,7 +54,7 @@ config.sourcehandler.patterns({
|
|
|
54
54
|
'Webgen::SourceHandler::Sitemap' => ['**/*.sitemap']
|
|
55
55
|
}, :doc => 'Source handler to path pattern map')
|
|
56
56
|
config.sourcehandler.invoke({
|
|
57
|
-
1 => ['Webgen::SourceHandler::Directory', 'Webgen::SourceHandler::Metainfo'
|
|
57
|
+
1 => ['Webgen::SourceHandler::Directory', 'Webgen::SourceHandler::Metainfo'],
|
|
58
58
|
5 => ['Webgen::SourceHandler::Copy', 'Webgen::SourceHandler::Template',
|
|
59
59
|
'Webgen::SourceHandler::Page', 'Webgen::SourceHandler::Feed',
|
|
60
60
|
'Webgen::SourceHandler::Sitemap'],
|
|
@@ -80,7 +80,7 @@ config.sourcehandler.default_meta_info({
|
|
|
80
80
|
'Webgen::SourceHandler::Page' => {
|
|
81
81
|
'kind' => 'page',
|
|
82
82
|
'fragments_in_menu' => true,
|
|
83
|
-
'blocks' => {'default' => {'pipeline' => 'erb,tags,maruku,blocks'}}
|
|
83
|
+
'blocks' => {'default' => {'pipeline' => 'erb,tags,maruku,blocks,fragments'}}
|
|
84
84
|
},
|
|
85
85
|
'Webgen::SourceHandler::Fragment' => {
|
|
86
86
|
'kind' => 'fragment'
|
|
@@ -131,6 +131,7 @@ config.contentprocessor.map({
|
|
|
131
131
|
'builder' => 'Webgen::ContentProcessor::Builder',
|
|
132
132
|
'erubis' => 'Webgen::ContentProcessor::Erubis',
|
|
133
133
|
'rdiscount' => 'Webgen::ContentProcessor::RDiscount',
|
|
134
|
+
'fragments' => 'Webgen::ContentProcessor::Fragments',
|
|
134
135
|
}, :doc => 'Content processor name to class map')
|
|
135
136
|
|
|
136
137
|
Webgen::WebsiteAccess.website.blackboard.add_service(:content_processor_names, Webgen::ContentProcessor.method(:list))
|
|
@@ -148,6 +149,8 @@ config.contentprocessor.tags.map({
|
|
|
148
149
|
'coderay' => 'Webgen::Tag::Coderay',
|
|
149
150
|
'date' => 'Webgen::Tag::Date',
|
|
150
151
|
'sitemap' => 'Webgen::Tag::Sitemap',
|
|
152
|
+
'tikz' => 'Webgen::Tag::TikZ',
|
|
153
|
+
'link' => 'Webgen::Tag::Link',
|
|
151
154
|
:default => 'Webgen::Tag::Metainfo'
|
|
152
155
|
}, :doc => 'Tag processor name to class map')
|
|
153
156
|
|
|
@@ -171,6 +174,7 @@ config.tag.breadcrumbtrail.end_level(-1, :doc => 'The level at which the breadcr
|
|
|
171
174
|
config.tag.langbar.separator(' | ', :doc => 'Separates the languages from each other.')
|
|
172
175
|
config.tag.langbar.show_single_lang(true, :doc => 'Should the link be shown although the page is only available in one language?')
|
|
173
176
|
config.tag.langbar.show_own_lang(true, :doc => 'Should the link to the currently displayed language page be shown?')
|
|
177
|
+
config.tag.langbar.lang_names({}, :doc => 'A map from language code to language names')
|
|
174
178
|
|
|
175
179
|
config.tag.includefile.filename(nil, :doc => 'The name of the file which should be included (relative to the website).', :mandatory => 'default')
|
|
176
180
|
config.tag.includefile.process_output(true, :doc => 'The file content will be scanned for tags if true.')
|
|
@@ -190,6 +194,15 @@ config.tag.coderay.tab_width(8, :doc => 'Number of spaces used for a tabulator')
|
|
|
190
194
|
|
|
191
195
|
config.tag.date.format('%Y-%m-%d %H:%M:%S', :doc => 'The format of the date (same options as Ruby\'s Time#strftime)')
|
|
192
196
|
|
|
197
|
+
config.tag.tikz.path(nil, :doc => 'The source path of the created image', :mandatory => 'default')
|
|
198
|
+
config.tag.tikz.libraries(nil, :doc => 'An array of additional TikZ library names')
|
|
199
|
+
config.tag.tikz.opts(nil, :doc => 'A string with global options for the tikzpicture environment')
|
|
200
|
+
config.tag.tikz.resolution('72 72', :doc => 'A string specifying the render and output resolutions')
|
|
201
|
+
config.tag.tikz.transparent(false, :doc => 'Specifies whether the generated image should be transparent (only png)')
|
|
202
|
+
config.tag.tikz.img_attr({}, :doc => 'A hash of additional HTML attributes for the created img tag')
|
|
203
|
+
|
|
204
|
+
config.tag.link.path(nil, :doc => 'The (A)LCN path to which a link should be generated', :mandatory => 'default')
|
|
205
|
+
config.tag.link.attr({}, :doc => 'A hash of additional HTML attributes that should be set on the link')
|
|
193
206
|
|
|
194
207
|
# All things regarding common functionality
|
|
195
208
|
website.autoload_service(:create_sitemap, 'Webgen::Common::Sitemap')
|