webgen 0.3.0 → 0.3.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.
Files changed (67) hide show
  1. data/ChangeLog +280 -0
  2. data/Rakefile +3 -1
  3. data/TODO +29 -12
  4. data/VERSION +1 -1
  5. data/doc/extension.config +11 -6
  6. data/doc/src/about.page +21 -0
  7. data/doc/src/default.css +17 -0
  8. data/doc/src/default.template +3 -5
  9. data/doc/src/design.gallery +1 -1
  10. data/doc/src/designs/curdesign.png +0 -0
  11. data/doc/src/designs/nostyle.png +0 -0
  12. data/doc/src/designs/old.png +0 -0
  13. data/doc/src/documentation/contenthandler/html.page +11 -0
  14. data/doc/src/documentation/contenthandler/index.page +7 -0
  15. data/doc/src/documentation/contenthandler/markdown.page +11 -0
  16. data/doc/src/documentation/contenthandler/rdoc.page +11 -0
  17. data/doc/src/documentation/contenthandler/textile.page +11 -0
  18. data/doc/src/documentation/extloader.page +1 -1
  19. data/doc/src/documentation/filehandler/backing.page +1 -1
  20. data/doc/src/documentation/filehandler/galleryhandler.page +79 -0
  21. data/doc/src/documentation/filehandler/{page.page → pagehandler.page} +2 -7
  22. data/doc/src/documentation/gallerylayouter/defaultlayouter.page +12 -0
  23. data/doc/src/documentation/gallerylayouter/index.page +14 -0
  24. data/doc/src/documentation/htmlvalidator/index.page +6 -0
  25. data/doc/src/documentation/htmlvalidator/xmllint.page +14 -0
  26. data/doc/src/documentation/index.page +33 -6
  27. data/doc/src/documentation/tags/index.page +2 -2
  28. data/doc/src/documentation/tags/{lang.de.page → langbar.de.page} +0 -0
  29. data/doc/src/documentation/tags/{lang.page → langbar.page} +6 -6
  30. data/doc/src/documentation/tags/menu.page +1 -1
  31. data/doc/src/documentation/tags/sitemap.page +18 -0
  32. data/doc/src/download.page +2 -0
  33. data/doc/src/features.page +4 -4
  34. data/doc/src/index.page +18 -20
  35. data/doc/src/meta.info +5 -5
  36. data/install.rb +1 -1
  37. data/lib/webgen/configuration.rb +35 -12
  38. data/lib/webgen/node.rb +9 -3
  39. data/lib/webgen/plugins/contenthandler/defaultcontenthandler.rb +39 -0
  40. data/lib/webgen/plugins/{filehandler/pagehandler → contenthandler}/html.rb +4 -7
  41. data/lib/webgen/plugins/{filehandler/pagehandler → contenthandler}/markdown.rb +4 -7
  42. data/lib/webgen/plugins/{filehandler/pagehandler → contenthandler}/rdoc.rb +5 -5
  43. data/lib/webgen/plugins/{filehandler/pagehandler → contenthandler}/textile.rb +4 -7
  44. data/lib/webgen/plugins/filehandler/backing.rb +4 -4
  45. data/lib/webgen/plugins/filehandler/directory.rb +25 -3
  46. data/lib/webgen/plugins/filehandler/filecopy.rb +4 -2
  47. data/lib/webgen/plugins/filehandler/filehandler.rb +5 -8
  48. data/lib/webgen/plugins/filehandler/{pagehandler/page.rb → page.rb} +48 -32
  49. data/lib/webgen/plugins/filehandler/picturegallery.rb +70 -51
  50. data/lib/webgen/plugins/gallerylayouter/defaultgallerylayouter.rb +152 -0
  51. data/lib/webgen/plugins/htmlvalidator/defaulthtmlvalidator.rb +37 -0
  52. data/lib/webgen/plugins/htmlvalidator/xmllint.rb +70 -0
  53. data/lib/webgen/plugins/tags/{lang.rb → langbar.rb} +3 -3
  54. data/lib/webgen/plugins/tags/menu.rb +9 -13
  55. data/lib/webgen/plugins/tags/relocatable.rb +2 -2
  56. data/lib/webgen/plugins/tags/sitemap.rb +73 -0
  57. data/lib/webgen/plugins/tags/tags.rb +9 -9
  58. data/lib/webgen/plugins/treewalker.rb +2 -2
  59. data/testsite/src/{images/bghack.png → bghack.png} +0 -0
  60. metadata +33 -20
  61. data/doc/src/designs/default.png +0 -0
  62. data/doc/src/documentation/filehandler/picturegallery.page +0 -25
  63. data/testsite/src/images/o.png +0 -0
  64. data/testsite/src/images/smagacor.png +0 -0
  65. data/testsite/src/images/tictactoe.png +0 -0
  66. data/testsite/src/images/x.png +0 -0
  67. data/testsite/src/test.gallery +0 -5
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
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">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang:}">
4
4
  <head>
5
5
  <title>{title: }</title>
6
6
  <link href="{relocatable: default.css}" rel="stylesheet" />
@@ -21,17 +21,15 @@
21
21
 
22
22
  <div id="headerbar" class="bar">
23
23
  <span class="left">Navbar: {navbar: }</span>
24
- <span class="right">Language: {lang: }</span>
24
+ <span class="right">Language: {langbar: }</span>
25
25
  <span class="right">Feedback: {wikilink: {rootURL: http://webgen.rubyforge.org/wiki/wiki.pl?, title: Click here}}</span>
26
26
  <div style="clear:both"></div>
27
27
  </div>
28
28
 
29
29
  <div id="menu">
30
- {menu: }
30
+ {menu: {subtreeLevel: 4}}
31
31
  </div>
32
32
 
33
- <div id="feedback"></div>
34
-
35
33
  <div id="body">
36
34
  {content: }
37
35
  </div>
@@ -4,7 +4,7 @@ files: designs/*.png
4
4
  mainPage:
5
5
  menuOrder: 8
6
6
 
7
- designs/default.png:
7
+ designs/curdesign.png:
8
8
  title: Default Design
9
9
  description: This is the default and the current design for the webgen homepage.
10
10
 
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: HTML
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: HTMLContentHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ Handles content written in plain HTML.
@@ -0,0 +1,7 @@
1
+ ---
2
+ directoryName: Content Handlers
3
+ ---
4
+ h2. About
5
+
6
+ Content handlers are used to handle different content formats. This allows one to write the page
7
+ descriptions using the format he likes.
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Markdown
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: MarkdownContentHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ Handles content written using Markdown markup ("Reference":http://daringfireball.net/projects/markdown/)
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: RDOC
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: RDocContentHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ Handles content written in RDOC (default documentation system for Ruby source files).
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Textile
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: TextileContentHandler}</notextile>
8
+
9
+ h2. Description
10
+
11
+ Handles content written using Textile markup ("Reference":http://hobix.com/textile/).
@@ -16,5 +16,5 @@ then they are only available for the current website.
16
16
  h2. The Configuration File
17
17
 
18
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
19
+ at the <a href="{relocatable: /api.page}">API</a> documentation to see which special methods you can
20
20
  use in the configuration file.
@@ -12,5 +12,5 @@ The backing file handler is used to set meta information for other files. It can
12
12
  additional meta information for page description files. However, its main purpose is to add virtual
13
13
  pages and directories.
14
14
 
15
- For more information have a look at the <a href="{relocatable: /api.html}">API
15
+ For more information have a look at the <a href="{relocatable: /api.page}">API
16
16
  documentation</a>.
@@ -0,0 +1,79 @@
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
+ h2. Gallery Description Files
15
+
16
+ The gallery description files are written in YAML and specify
17
+
18
+ * which images should be used
19
+ * the titles/descriptions of the images
20
+ * the templates which should be used
21
+ * meta information for the pages
22
+ * the layout
23
+
24
+ The two most important things on this list are which images should be used and the layout. The
25
+ images have to be in the website source directory! You can/should not specify images outside the
26
+ source directory as these images are not automatically copied to the destination directory and
27
+ automatice thumbnail creation may not work correctly. And the layout defines how the main, gallery
28
+ and picture pages look like.
29
+
30
+ Here is an example gallery description file:
31
+ <pre>
32
+ title: Example Gallery
33
+ picsPerPage: 32
34
+ files: example/**/*.jpg
35
+
36
+ mainPage:
37
+ inMenu: false
38
+ template: hello.template
39
+ metainfo: is defined here
40
+
41
+ galleryPages:
42
+ metainfo: is defined here
43
+
44
+ example/dir1/img1.jpg:
45
+ title: Test title
46
+ description: Long description of image
47
+
48
+ example/img2.jpg
49
+ title: Title2 of pic
50
+ </pre>
51
+
52
+ So, we define the title of the gallery first and change the @picsPerPage@ setting. Every plugin
53
+ parameter can be changed by using its name as key and assigning a new value to it. The key
54
+ @mainPage@ can be used to set meta information for the main page. Likewise, the key @galleryPages@
55
+ can be used to set meta information for the gallery pages and if the key is the name of a picture,
56
+ its meta information is set to the specified values.
57
+
58
+ h2. Types of Generated Pages
59
+
60
+ There are three different page types:
61
+
62
+ * *main page*: It should have a list of all galleries. It is not generated if there is only
63
+ one gallery; this gallery becomes the main page.
64
+
65
+ * *gallery pages*: Each gallery page should have a list of all the images on it. The number of
66
+ images per gallery page can be defined via a parameter.
67
+
68
+ * *picture pages*: Each picture page should display its picture and, maybe, additional information.
69
+
70
+ h2. Layouter plugins
71
+
72
+ Each layouter plugin defines a different "style" of picture gallery. Have a look at the available
73
+ layouter plugins and choose one for your picture gallery. If you think they do not look good enough,
74
+ you can define your own layouter in the extension file. You only need to derive a new class from
75
+ DefaultGalleryLayouter and define the layout methods.
76
+
77
+ h2. Examples
78
+
79
+ You can view an example gallery <a href="{relocatable: /Design_Gallery_1.page}">here</a>!
@@ -73,13 +73,8 @@ named @sidebar@ and formatted using @markdown@.
73
73
 
74
74
  h2. Content format
75
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
76
+ The content of page description can be written in different formats. Have a look at the sub menu
77
+ entries to get an overview of the existing formats.
83
78
 
84
79
  h2. Default settings
85
80
 
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: Default Gallery Layouter
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: DefaultGalleryLayouter}</notextile>
8
+
9
+ h2. Description
10
+
11
+ This plugin serves as base class for all picture gallery layouters and provides a default
12
+ implementation.
@@ -0,0 +1,14 @@
1
+ ---
2
+ directoryName: Gallery Layouters
3
+ ---
4
+ h2. About
5
+
6
+ Gallery layouters are used to define layouts for galleries. Each plugin defines how the main page,
7
+ the gallery pages and the picture pages look like. To do this, each plugin has to define three methods:
8
+
9
+ * <tt>main( data )</tt>
10
+ * <tt>gallery( data, gIndex )</tt>
11
+ * <tt>picture( data, gIndex, iIndex )</tt>
12
+
13
+ The @data@ parameter is a @Hash@ with all the information available about the gallery. The @gIndex@
14
+ and the @iIndex@ parameters are indices for the current gallery and the current image.
@@ -0,0 +1,6 @@
1
+ ---
2
+ directoryName: HTML Validators
3
+ ---
4
+ h2. About
5
+
6
+ HTML Validators are used to validate HTML files.
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: xmllint HTML Validator
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: XmllintHTMLValidator}</notextile>
8
+
9
+ h2. Description
10
+
11
+ This plugin uses the @xmllint@ program from the "libxml2":http://www.xmlsoft.org package. @xmllint@
12
+ can be used to validate an XML file against a DTD, a RelaxNG schema or a WXS schema. For more
13
+ information about where to put the DTD or schema files, have a look at the @libxml2@ documentation
14
+ that comes bundled.
@@ -5,6 +5,37 @@ h2. Information
5
5
 
6
6
  p={font-size: 150%; color: red}. *!!! This documentation is for Webgen {version: } !!!*
7
7
 
8
+ The source files for this website are in the @doc/src@ directory of the webgen package. Have a look
9
+ at them to see a real world example on how to use webgen!
10
+
11
+ h2. Philosophy
12
+
13
+ There are some things about webgen which I think are important to mention. It's about how webgen
14
+ works and what you can expect when you start webgen.
15
+
16
+ * <b>Webgen runs till the end and does not stop on errors!</b>
17
+
18
+ I did not like it when webgen stopped because there was an error in the configuration file or an
19
+ error in a page description file. So if something exceptional happens it is logged so that the
20
+ user can see what happened and a useful default alternative is used instead. For example, if no
21
+ default template was found in the source directory, a dummy template is used instead.
22
+
23
+ Therefore it is also not necessary to install the dependencies (although you would be wise to do
24
+ it, so that you can use all the features of webgen). If a dependency is not found (e.g. RedCloth
25
+ for Textile support), the specific feature is turned off and a warning gets issued.
26
+
27
+ * <b>Useful default values for everything!</b>
28
+
29
+ You _do not need_ to configure webgen if you are happy with the default values. Webgen provides
30
+ default values for every configuration option.
31
+
32
+ * <b>Every important thing gets logged!</b>
33
+
34
+ The logging mechanism is not only used to log error and warning messages, but also to log
35
+ informational and debug messages. For the normal user, the error and warning messages are
36
+ important. Developers who extend webgen by writing a new plugin can use the informational and
37
+ debug messages to see what is going on and to help them develop the plugin.
38
+
8
39
  h2. Usage
9
40
 
10
41
  Webgen uses two directories: one to read the source files from and an other to write the output
@@ -17,11 +48,6 @@ type @webgen@. If everything is okay, no output will appear and you can point yo
17
48
  output directory and view your website. If not, webgen tries to give detailed information about what
18
49
  happened and why something could not be done correctly.
19
50
 
20
- Webgen tries to compensate for errors and warnings and _should_ not abort with an error. Instead, it
21
- uses default values in error or warning cases and only issues messages to the log device (normally
22
- the screen). This also means that if a library is not found (e.g. RedCloth for Textile support),
23
- the plugin which uses the library is disabled.
24
-
25
51
  h2. Configuration
26
52
 
27
53
  Webgen provides a default configuration out of the box. If you can live with that, you do not need
@@ -44,4 +70,5 @@ looks like this:
44
70
  h2. Plugins
45
71
 
46
72
  Webgen is written with extensibility in mind; therefore most of its features are implemented with
47
- plugins, only the core functions are not plugins.
73
+ plugins, only the core functions are not plugins. Use the menu to view the documentation for
74
+ individual plugins.
@@ -19,9 +19,9 @@ Tags are defined by a special markup code. A tag has the following structure:
19
19
 
20
20
  Every time a tag is found in a source file, the registered plugin for the tag is called. The plugin
21
21
  returns a string which is put into the output file instead of the tag. The output a tag plugin can
22
- produce ranges from something simple to something complex. For example, the <a href="{relocatable: meta.html}">
22
+ produce ranges from something simple to something complex. For example, the <a href="{relocatable: meta.page}">
23
23
  Meta Tag</a> plugin copies any additional info specified in the source file verbatim
24
- into the correct place in the output file. And in contrast, the <a href="{relocatable: menu.html}">
24
+ into the correct place in the output file. And in contrast, the <a href="{relocatable: menu.page}">
25
25
  Menu Tag</a> plugin generates a whole menu tree.
26
26
 
27
27
  h2. Tag Parameters
@@ -1,10 +1,10 @@
1
1
  ---
2
- title: Language
2
+ title: Language Bar
3
3
  inMenu: true
4
4
  ---
5
5
  h2. Information
6
6
 
7
- <notextile>{describe: LanguageTag}</notextile>
7
+ <notextile>{describe: LanguageBarTag}</notextile>
8
8
 
9
9
  h2. Description
10
10
 
@@ -15,13 +15,13 @@ item.
15
15
 
16
16
  h2. Examples
17
17
 
18
- Here is a <a href="{relocatable: multilang.html}">link</a> to a page which is translated to several
18
+ Here is a <a href="{relocatable: multilang.page}">link</a> to a page which is translated to several
19
19
  languages (more or less ;-). Have a look at it and don't forget to view the page in the other
20
20
  languages!
21
21
 
22
22
  table{border:1px solid black}.
23
23
  |_.Command|_.Output|
24
- |<notextile>\{lang: }</notextile>|<notextile>{lang: }</notextile>|
25
- |\{lang: {separator: Hallo}}|{lang: {separator: Hallo}}|
26
- |\{lang: {showSingleLang: false}}|{lang: {showSingleLang: false}}|
24
+ |<notextile>\{langbar: }</notextile>|<notextile>{langbar: }</notextile>|
25
+ |\{langbar: {separator: Hallo}}|{langbar: {separator: Hallo}}|
26
+ |\{langbar: {showSingleLang: false}}|{langbar: {showSingleLang: false}}|
27
27
 
@@ -12,7 +12,7 @@ The menu tag is used to generate a menu for the website. You can see such a menu
12
12
  page. To get a list of all supported parameters for the menu tag, have a look at its API
13
13
  documentation.
14
14
 
15
- This page is available in <a href="{relocatable: menu.html/menu.de.html}">German</a>. Try and go to
15
+ This page is available in <a href="{relocatable: menu.page/menu.de.html}">German</a>. Try and go to
16
16
  the german version of this page. You will see that the menu items for which translations exist
17
17
  change their names.
18
18
 
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: Sitemap
3
+ inMenu: true
4
+ ---
5
+ h2. Information
6
+
7
+ <notextile>{describe: SitemapTag}</notextile>
8
+
9
+ h2. Description
10
+
11
+ The SitemapTag is used to display the site map of the current web site. It contains all the pages of
12
+ the web site and their hierarchy.
13
+
14
+ h2. Examples
15
+
16
+ table{border:1px solid black}.
17
+ |_.Command|_.Output|
18
+ |\{sitemap:}|{sitemap:}|
@@ -14,6 +14,8 @@ h2. Dependencies
14
14
 
15
15
  * "RedCloth":http://redcloth.rubyforge.org version 2.0.10 or higher if you want Textile support
16
16
  * "BlueCloth":http://www.deveiate.org version 1.0.0 or higher if you want Markdown support
17
+ * "RMagick":http://rmagick.rubyforge.org/ version 1.7.1 or higher if you want automatic thumbnail
18
+ creation for picture galleries
17
19
 
18
20
  h2. Installation
19
21
 
@@ -6,9 +6,9 @@ h2. Feature list
6
6
 
7
7
  * Easily extendable through plugins
8
8
  * Uses templates for separating layout from content
9
- * Supports several different page description languages (YAML, XML, plain HTML), new ones are easy to add
10
- * Uses 'tags' to add generated content to the web pages
9
+ * Supports several different content formats (Textile, Markdown, RDOC, plain HTML), new ones are easy to add
10
+ * Uses 'tags' to add generated, ie. dynamic, content to the web pages
11
11
  * Standard distribution provides often used tags
12
12
  * Supports 'virtual files' via meta information backing files
13
- * Easy to configure if one needs to
14
- * Relatively fast: process ~1000 files in ~25 seconds on an {execute: uname -p}
13
+ * Easy to configure if one needs to (no need if you are happy with the default values)
14
+ * Relatively fast: processes ~1000 files in ~25 seconds on an {execute: uname -p}
@@ -12,37 +12,35 @@ Choose from the menu what you want to see from or know about webgen!
12
12
 
13
13
  h2. News
14
14
 
15
- *Webgen 0.3.0 was released!!!*
15
+ *Webgen 0.3.1 released!!!*
16
+
17
+ Major changes:
18
+
19
+ * Better DefaultLayouter for picture galleries (<a href="{relocatable: Design_Gallery_1.page}">online demo</a>)
20
+ * Output names for page files now customizable (see <a href="{relocatable: documentation/filehandler/pagehandler.page}">PageHandler</a>)
21
+ * On-the-fly creation of thumbnails for pictures with RMagick
22
+ * New tags: <a href="{relocatable: documentation/tags/sitemap.page}">sitemap</a>
23
+ * Tag @lang@ renamed, new name @langbar@!
24
+ * New parameters for @menu@ tag
25
+ * Automatic checking of HTML files on their validness
26
+ * Fixed bugs
27
+
28
+ h2. News
29
+
30
+ *Webgen 0.3.0 released!!!*
16
31
 
17
32
  Major changes:
18
33
 
19
34
  * Textile, Markdown, RDOC and HTML as content format supported!!!
20
- * New tags: <a href="{relocatable: documentation/tags/wikilink.html}">wikilink</a>
35
+ * New tags: <a href="{relocatable: documentation/tags/wikilink.page}">wikilink</a>
21
36
  * Improved plugin system
22
37
  * On-the-fly creation of new tags
23
38
  * Fixed bugs
24
39
  * Improved online documentation: pages on file handlers and tags now show parameters and other
25
40
  additional info
26
- * Added comprehensive test suite --> TODO
41
+ * Added comprehensive test suite
27
42
  * and more...
28
43
 
29
- h2. Description
30
-
31
- Webgen can be used to generate web pages from page description and template files. You create one
32
- template file in which you define the layout of your page and where the content should go. After
33
- that you can create page description files in which you only define the content.
34
-
35
- When webgen is run it combines the template with each of the page description files and generates
36
- the HTML output files. During this process special tags are substituted so that, for example, a menu
37
- is generated.
38
-
39
- h2. Author
40
-
41
- * *Thomas Leitner*
42
- * Web: "http://webgen.rubyforge.org":http://webgen.rubyforge.org
43
- * e-Mail: "t_leitner@gmx.at":mailto:t_leitner@gmx.at
44
- * GPG Key-Id: 0xD942E7F6
45
-
46
44
  h2. And so ...
47
45
 
48
46
  ... have fun!