webgen 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/COPYING +340 -0
  2. data/ChangeLog +2172 -0
  3. data/README +16 -0
  4. data/Rakefile +283 -0
  5. data/TODO +133 -0
  6. data/VERSION +1 -0
  7. data/bin/webgen +5 -0
  8. data/doc/extension.config +55 -0
  9. data/doc/src/default.css +129 -0
  10. data/doc/src/default.template +45 -0
  11. data/doc/src/design.gallery +18 -0
  12. data/doc/src/designs/default.png +0 -0
  13. data/doc/src/designs/nostyle.png +0 -0
  14. data/doc/src/designs/old.png +0 -0
  15. data/doc/src/documentation/extloader.page +20 -0
  16. data/doc/src/documentation/filehandler/backing.page +16 -0
  17. data/doc/src/documentation/filehandler/copy.page +12 -0
  18. data/doc/src/documentation/filehandler/directory.page +15 -0
  19. data/doc/src/documentation/filehandler/index.page +13 -0
  20. data/doc/src/documentation/filehandler/page.page +122 -0
  21. data/doc/src/documentation/filehandler/picturegallery.page +25 -0
  22. data/doc/src/documentation/filehandler/template.page +21 -0
  23. data/doc/src/documentation/index.page +47 -0
  24. data/doc/src/documentation/tags/date.page +19 -0
  25. data/doc/src/documentation/tags/executecommand.page +19 -0
  26. data/doc/src/documentation/tags/includefile.page +15 -0
  27. data/doc/src/documentation/tags/index.page +39 -0
  28. data/doc/src/documentation/tags/lang.de.page +6 -0
  29. data/doc/src/documentation/tags/lang.page +27 -0
  30. data/doc/src/documentation/tags/menu.de.page +11 -0
  31. data/doc/src/documentation/tags/menu.page +30 -0
  32. data/doc/src/documentation/tags/meta.page +20 -0
  33. data/doc/src/documentation/tags/multilang.de.page +4 -0
  34. data/doc/src/documentation/tags/multilang.fr.page +4 -0
  35. data/doc/src/documentation/tags/multilang.page +4 -0
  36. data/doc/src/documentation/tags/navbar.page +19 -0
  37. data/doc/src/documentation/tags/relocatable.page +16 -0
  38. data/doc/src/documentation/tags/wikilink.page +18 -0
  39. data/doc/src/download.page +42 -0
  40. data/doc/src/features.page +14 -0
  41. data/doc/src/index.page +48 -0
  42. data/doc/src/logo.png +0 -0
  43. data/doc/src/meta.info +22 -0
  44. data/install.rb +19 -0
  45. data/lib/util/composite.rb +101 -0
  46. data/lib/util/listener.rb +105 -0
  47. data/lib/webgen/configuration.rb +216 -0
  48. data/lib/webgen/logging.rb +73 -0
  49. data/lib/webgen/node.rb +147 -0
  50. data/lib/webgen/plugins/extloader.rb +88 -0
  51. data/lib/webgen/plugins/filehandler/backing.rb +200 -0
  52. data/lib/webgen/plugins/filehandler/directory.rb +96 -0
  53. data/lib/webgen/plugins/filehandler/filecopy.rb +59 -0
  54. data/lib/webgen/plugins/filehandler/filehandler.rb +209 -0
  55. data/lib/webgen/plugins/filehandler/pagehandler/html.rb +43 -0
  56. data/lib/webgen/plugins/filehandler/pagehandler/markdown.rb +53 -0
  57. data/lib/webgen/plugins/filehandler/pagehandler/page.rb +205 -0
  58. data/lib/webgen/plugins/filehandler/pagehandler/rdoc.rb +50 -0
  59. data/lib/webgen/plugins/filehandler/pagehandler/textile.rb +52 -0
  60. data/lib/webgen/plugins/filehandler/picturegallery.rb +194 -0
  61. data/lib/webgen/plugins/filehandler/template.rb +98 -0
  62. data/lib/webgen/plugins/tags/date.rb +46 -0
  63. data/lib/webgen/plugins/tags/executecommand.rb +53 -0
  64. data/lib/webgen/plugins/tags/includefile.rb +60 -0
  65. data/lib/webgen/plugins/tags/lang.rb +50 -0
  66. data/lib/webgen/plugins/tags/menu.rb +198 -0
  67. data/lib/webgen/plugins/tags/meta.rb +54 -0
  68. data/lib/webgen/plugins/tags/navbar.rb +62 -0
  69. data/lib/webgen/plugins/tags/relocatable.rb +58 -0
  70. data/lib/webgen/plugins/tags/tags.rb +247 -0
  71. data/lib/webgen/plugins/tags/wikilink.rb +58 -0
  72. data/lib/webgen/plugins/treewalker.rb +81 -0
  73. data/lib/webgen/webgen.rb +155 -0
  74. data/setup.rb +1331 -0
  75. data/testsite/config.yaml +7 -0
  76. data/testsite/src/bluecloth.page +102 -0
  77. data/testsite/src/default.css +146 -0
  78. data/testsite/src/default.template +33 -0
  79. data/testsite/src/home.en.page +22 -0
  80. data/testsite/src/home.page +22 -0
  81. data/testsite/src/images/bghack.png +0 -0
  82. data/testsite/src/images/o.png +0 -0
  83. data/testsite/src/images/smagacor.png +0 -0
  84. data/testsite/src/images/tictactoe.png +0 -0
  85. data/testsite/src/images/x.png +0 -0
  86. data/testsite/src/index.page +21 -0
  87. data/testsite/src/meta.info +15 -0
  88. data/testsite/src/news.page +20 -0
  89. data/testsite/src/news_are_so-cool.de.page +19 -0
  90. data/testsite/src/noindex/noindex.page +20 -0
  91. data/testsite/src/pictures/index.page +20 -0
  92. data/testsite/src/projects.de.page +11 -0
  93. data/testsite/src/projects.es.page +11 -0
  94. data/testsite/src/projects.page +17 -0
  95. data/testsite/src/projects/00.index.de.page +10 -0
  96. data/testsite/src/projects/01.project2.page +20 -0
  97. data/testsite/src/projects/02.project1.page +20 -0
  98. data/testsite/src/projects/05.project3.page +22 -0
  99. data/testsite/src/projects/index.page +20 -0
  100. data/testsite/src/projects/subproj/index.page +22 -0
  101. data/testsite/src/projects/subproj/project3.page +21 -0
  102. data/testsite/src/rdoc.page +12 -0
  103. data/testsite/src/redcloth.page +106 -0
  104. data/testsite/src/test.gallery +5 -0
  105. metadata +155 -0
@@ -0,0 +1,129 @@
1
+ /*
2
+ #5C73B8 -> background
3
+ #405080 -> headings
4
+ #CFD4E6 -> code
5
+ #3054BF -> other
6
+ */
7
+
8
+ body {
9
+ margin: 0px 2em;
10
+ font-size: 12px;
11
+ font-family: Verdana, Arial, Helvetica;
12
+ border: 1px solid black;
13
+ color: black;
14
+ }
15
+
16
+ h1, h2, h3, h4, h5 { color: #405080}
17
+
18
+ a:visited { color: #405080; }
19
+ a { color: #5C73B8; }
20
+ .bar a { color: white }
21
+ .bar a:visited { color: white }
22
+
23
+ #all { background-color: #CFD4E6; }
24
+
25
+ #header {
26
+ border-bottom: 1px solid black;
27
+ padding: 1ex;
28
+ background-color: #5C73B8;
29
+ }
30
+ #header img {
31
+ padding-right: 5em;
32
+ }
33
+ #header h1 {
34
+ margin: 0ex;
35
+ font-size: 300%;
36
+ font-style: italic;
37
+ font-weight: normal;
38
+ color: white;
39
+ }
40
+
41
+ , #headerbar { border-bottom: 1px solid black; }
42
+ #footer { border-top: 1px solid black; }
43
+
44
+ #body {
45
+ margin-left: 250px;
46
+ margin-right: 20px;
47
+ padding: 10px;
48
+ }
49
+
50
+ #menu {
51
+ float: left;
52
+ width: 230px;
53
+ padding: 20px 0px 0px 2px;
54
+ }
55
+
56
+ .bar {
57
+ clear: both;
58
+ padding: 3px;
59
+ text-align: center;
60
+ font-size: 90%;
61
+ background-color: #3054BF;
62
+ }
63
+
64
+ .left, .right {
65
+ padding: 0px 1em;
66
+ }
67
+
68
+ .left {
69
+ float: left;
70
+ text-align: left;
71
+ }
72
+
73
+ .right {
74
+ float: right;
75
+ text-align: right;
76
+ }
77
+
78
+ /* styling the menu */
79
+
80
+ #menu a {
81
+ text-decoration: none;
82
+ font-weight: bold;
83
+ font-size: 130%;
84
+ }
85
+
86
+ #menu a:hover {
87
+ text-decoration: underline;
88
+ }
89
+
90
+ #menu .webgen-menuitem-selected {
91
+ border-left: 3px solid #405080;
92
+ }
93
+
94
+ #menu ul {
95
+ list-style-type: none;
96
+ padding: 0px;
97
+ margin-left: 10px;
98
+ }
99
+
100
+ #menu li > ul {
101
+ font-size: 95%;
102
+ }
103
+
104
+ #menu li {
105
+ margin: 0.0em 0px;
106
+ padding: 2px 0px;
107
+ padding-left: 5px;
108
+ border-left: 3px solid #CCCCCC;
109
+ }
110
+
111
+ /* styling the content */
112
+
113
+ h2 {
114
+ padding: 0px;
115
+ letter-spacing: 0.2em;
116
+ font-size: 150%;
117
+ font-weight: bold;
118
+ border-bottom: 1px solid #405080;
119
+ }
120
+
121
+ .webgen-file {
122
+ padding-left: 10px;
123
+ margin: 0px 10px;
124
+ border-left: 3px solid #5C73B8;
125
+ }
126
+
127
+ .webgen-picture {
128
+ text-align: center;
129
+ }
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
+ <head>
5
+ <title>{title: }</title>
6
+ <link href="{relocatable: default.css}" rel="stylesheet" />
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ </head>
9
+ <body>
10
+ <div id="all">
11
+
12
+ <div id="header">
13
+ <table>
14
+ <tr>
15
+ <td><img src="{relocatable: logo.png}" alt="Logo" title="Logo" /></td>
16
+ <td><h1>Webgen<span style="font-size: 60%"> - template based static website generator</span></h1>
17
+ <p>The solution for your static website generation needs!</p></td>
18
+ </tr>
19
+ </table>
20
+ </div>
21
+
22
+ <div id="headerbar" class="bar">
23
+ <span class="left">Navbar: {navbar: }</span>
24
+ <span class="right">Language: {lang: }</span>
25
+ <span class="right">Feedback: {wikilink: {rootURL: http://webgen.rubyforge.org/wiki/wiki.pl?, title: Click here}}</span>
26
+ <div style="clear:both"></div>
27
+ </div>
28
+
29
+ <div id="menu">
30
+ {menu: }
31
+ </div>
32
+
33
+ <div id="feedback"></div>
34
+
35
+ <div id="body">
36
+ {content: }
37
+ </div>
38
+
39
+ <div id="footer" class="bar">
40
+ generated with <a href="http://webgen.rubyforge.org"><em><b>webgen</b></em></a> on <b>{date: }</b>
41
+ </div>
42
+ </div>
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,18 @@
1
+ title: Design Gallery
2
+ files: designs/*.png
3
+
4
+ mainPage:
5
+ menuOrder: 8
6
+
7
+ designs/default.png:
8
+ title: Default Design
9
+ description: This is the default and the current design for the webgen homepage.
10
+
11
+ designs/nostyle.png:
12
+ title: Without Stylesheet
13
+ description: The default homepage with the stylesheet disabled. Not very nice, but
14
+ still useable.
15
+
16
+ designs/old.png:
17
+ title: Old Design
18
+ description: The old design of the homepage.
Binary file
Binary file
Binary file
@@ -0,0 +1,20 @@
1
+ ---
2
+ title: Extension Loader
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: ExtensionLoader}</notextile>
8
+
9
+ h2. Description
10
+
11
+ The extension loader is used to load website specific extension plugins. Sometimes it is not useful
12
+ to extend webgen itself to support a new file format or another tag because the created plugins are
13
+ only useful for one specific site. So one can define these extensions in a configuration file and
14
+ then they are only available for the current website.
15
+
16
+ h2. The Configuration File
17
+
18
+ The configuration file for the extension loader has to be a file with valid Ruby code. Have a look
19
+ at the <a href="{relocatable: /api.html}">API</a> documentation to see which special methods you can
20
+ use in the configuration file.
@@ -0,0 +1,16 @@
1
+ ---
2
+ title: Backing File Handler
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: BackingFileHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ The backing file handler is used to set meta information for other files. It can be used to set
12
+ additional meta information for page description files. However, its main purpose is to add virtual
13
+ pages and directories.
14
+
15
+ For more information have a look at the <a href="{relocatable: /api.html}">API
16
+ documentation</a>.
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: File Copy Handler
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: FileCopyHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ The file copy handler copies files without modification from the source to the target directory.
12
+ This is useful, for example, for CSS stylesheets and images.
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: Directory Handler
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: DirHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ The directory handler is used for processing directories. It creates the target directories and
12
+ additionally an index file for each directory can be specified. If specified, this file is used
13
+ instead of the plain directory index for displaying purposes. For example, the menu item for the
14
+ file handlers page is generated by the index file for the directory @documentation/filehandler@ on
15
+ this website.
@@ -0,0 +1,13 @@
1
+ ---
2
+ directoryName: File Handlers
3
+ ---
4
+ h2. About
5
+
6
+ File handlers are used to handle different types of input files. You can see the currently exisiting
7
+ file handlers in the menu. Choose one to get a description for it!
8
+
9
+ Each file handler can handle one or more different file extensions. During the processing of the
10
+ website, files with a registered extension are processed by the corresponding file handler.
11
+
12
+ A special "file" handler is used to handle directories; this file handler registers the extension
13
+ @:dir@.
@@ -0,0 +1,122 @@
1
+ ---
2
+ title: Page Handler
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: PageHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ Page description files are used to specify the actual content for the website. The contain the
12
+ content for the webpage and, optionally, meta information.
13
+
14
+ h2(#structure). File format
15
+
16
+ The format of these files is a very simple one and can be divided into two cases:
17
+
18
+ # Only content
19
+ # Meta information and content
20
+
21
+ A simple file may look like this:
22
+ <pre>
23
+ This is the content!!!
24
+ </pre>
25
+
26
+ Only content is specified in this file. Meta information can be specified at the beginning of the
27
+ file:
28
+ <pre>
29
+ \---
30
+ title: The title set by Meta info
31
+ \---
32
+ This is the content of the file
33
+ </pre>
34
+
35
+ In this example, meta information is specified ("more info":#meta). Note the three dashes at the
36
+ beginning of the file. This indicates that the following 'block' is used for meta information. If
37
+ the three dashes at the beginning are omitted, then the parser won't know that the following block
38
+ contains meta information and thinks it is content.
39
+
40
+ If you want to include a line in your file which only has three dashes, you have to write this:
41
+ <pre>
42
+ \\---
43
+ </pre>
44
+
45
+ The meta information is separated from the content by another three dashes and so the content itself
46
+ builds a second 'block'. The following examples contains three blocks, the meta information block
47
+ and two content blocks.
48
+ <pre>
49
+ \---
50
+ title: The title set by Meta info
51
+ \---
52
+ This is the 1. content of the file
53
+ \---
54
+ This is the 2. content of the file
55
+ </pre>
56
+
57
+ However, without naming blocks they cannot be accessed. You can specify the name and the content
58
+ formatting using meta information. Look at the following example:
59
+ <pre>
60
+ \---
61
+ title: The title set by Meta info
62
+ blocks:
63
+ - \{name: content, format: textile}
64
+ - \{name: sidebar, format: markdown}
65
+ \---
66
+ This is the 1. content of the file
67
+ \---
68
+ This is the 2. content of the file
69
+ </pre>
70
+
71
+ The first block in this file is named @content@ and formatted using @textile@. The second block is
72
+ named @sidebar@ and formatted using @markdown@.
73
+
74
+ h2. Content format
75
+
76
+ The content of page description can be written in different formats. The following formats are
77
+ currently available:
78
+
79
+ * textile: Content written using Textile markup ("Reference":http://hobix.com/textile/)
80
+ * markdown: Content written using Markdown markup ("Reference":http://www.deveiate.org)
81
+ * rdoc: Content written using RDOC markup (default documentation system for Ruby source files)
82
+ * html: Content in plain HTML
83
+
84
+ h2. Default settings
85
+
86
+ As page description files need not have meta information, defaults are used for needed parameters.
87
+ If meta information is specified in a page description file, the default values are overridden.
88
+
89
+ The following defaults are used:
90
+
91
+ * Content format
92
+
93
+ If there is only content in a page description file, its formatting defaults to the parameter
94
+ value @defaultContentFormat@.
95
+
96
+ * Title, ordering and language
97
+
98
+ These values are taken from the filename, so the filename of a page description file has to be
99
+ formatted like this: @[ordering.]title[.language].page@ (the values in square brackets are
100
+ optional). In detail:
101
+ * ordering: The ordering is a number which is used for menu generation and the like, where it is
102
+ necessary to order the items. If not specified, defaults to @0@.
103
+ * title: This is the title of the page. Hyphens and underscores are replaced with spaces and the
104
+ title must not contain any dots.
105
+ * language: This is the language code for this file. It is the international two letter acronym
106
+ and if it is not specified, it defaults to @en@.
107
+
108
+ Consider the following examples:
109
+ * @name.page@ -> title: Name, language: en, ordering: 0
110
+ * @name.de.page@ -> title: Name, language: de, ordering: 0
111
+ * @01.name_of-file.de.page@ -> Title: Name of file, language: de, ordering: 01
112
+
113
+
114
+ h2(#meta). Meta Information
115
+
116
+ Meta information can be specified at the beginning of the file as described "here":#structure. Meta
117
+ information is formatted using YAML, a simple markup language. For more information about YAML, have
118
+ a look at the "www.yaml.org":http://www.yaml.org!
119
+
120
+ Any information can be specified. The most important use for meta information is to override values
121
+ like the title of the page (e.g. if you want dots in it), the ordering and so on. It is also used to
122
+ specify the names and the formatting of content blocks in the file.
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: Picture Gallery File Handler
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: PictureGalleryFileHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ This file handler uses picture gallery description files to automatically build picture galleries.
12
+ These picture galleries are highly configurable and themeable through the use of page templates.
13
+
14
+ The gallery description files are written in YAML and specify
15
+
16
+ * which images should be used
17
+ * the titles/descriptions of the images
18
+ * the templates which should be used
19
+ * meta information for the pages
20
+
21
+ This is the first version of the picture gallery handler, so do not expect too much!
22
+
23
+ h2. Examples
24
+
25
+ You can view an example gallery <a href="{relocatable: /Design_Gallery_1.html}">here</a>!
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: Template File Handler
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: TemplateFileHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ The template file handler processes the templates for the page description files. Templates normally
12
+ specify the layout of the website. For this website only one template was used for all page
13
+ description files. However, you could assign each page description file its own template, if you
14
+ want to! (but why would one do that? :-)
15
+
16
+ You must have at least one template file in the root of the source directory which is the fallback
17
+ template if no other template can be found for a page description file. The template files are
18
+ organized hierarchically. So if during processing webgen does not find the default template file in
19
+ the directory in which the page file is, it searches the parent directory for the template. If it
20
+ isn't there either, it searches the parent's parent directory and so on. If webgen gets to the root
21
+ of the source directory and could not find a template, it will complain and stop.