gettalong-webgen 0.5.4.20080929

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. data/AUTHORS +5 -0
  2. data/COPYING +10 -0
  3. data/GPL +340 -0
  4. data/Rakefile +324 -0
  5. data/THANKS +17 -0
  6. data/bin/webgen +10 -0
  7. data/data/webgen/resources.yaml +3 -0
  8. data/data/webgen/webgui/controller/main.rb +129 -0
  9. data/data/webgen/webgui/overrides/win32console.rb +0 -0
  10. data/data/webgen/webgui/public/css/jquery.autocomplete.css +50 -0
  11. data/data/webgen/webgui/public/css/ramaze_error.css +90 -0
  12. data/data/webgen/webgui/public/css/style.css +55 -0
  13. data/data/webgen/webgui/public/img/headerbg.jpg +0 -0
  14. data/data/webgen/webgui/public/img/webgen_logo.png +0 -0
  15. data/data/webgen/webgui/public/js/jquery.autocomplete.js +15 -0
  16. data/data/webgen/webgui/public/js/jquery.js +32 -0
  17. data/data/webgen/webgui/view/create_website.xhtml +22 -0
  18. data/data/webgen/webgui/view/error.xhtml +64 -0
  19. data/data/webgen/webgui/view/index.xhtml +22 -0
  20. data/data/webgen/webgui/view/manage_website.xhtml +18 -0
  21. data/data/webgen/webgui/view/page.xhtml +40 -0
  22. data/data/webgen/website_skeleton/README +10 -0
  23. data/data/webgen/website_skeleton/Rakefile +40 -0
  24. data/data/webgen/website_skeleton/config.yaml +17 -0
  25. data/data/webgen/website_skeleton/ext/init.rb +6 -0
  26. data/data/webgen/website_styles/1024px/README +13 -0
  27. data/data/webgen/website_styles/1024px/src/default.css +188 -0
  28. data/data/webgen/website_styles/1024px/src/default.template +60 -0
  29. data/data/webgen/website_styles/1024px/src/images/background.gif +0 -0
  30. data/data/webgen/website_styles/andreas00/README +13 -0
  31. data/data/webgen/website_styles/andreas00/src/default.css +290 -0
  32. data/data/webgen/website_styles/andreas00/src/default.template +60 -0
  33. data/data/webgen/website_styles/andreas00/src/images/bg.gif +0 -0
  34. data/data/webgen/website_styles/andreas00/src/images/front.jpg +0 -0
  35. data/data/webgen/website_styles/andreas00/src/images/menubg.gif +0 -0
  36. data/data/webgen/website_styles/andreas00/src/images/menubg2.gif +0 -0
  37. data/data/webgen/website_styles/andreas01/README +14 -0
  38. data/data/webgen/website_styles/andreas01/src/default.css +310 -0
  39. data/data/webgen/website_styles/andreas01/src/default.template +61 -0
  40. data/data/webgen/website_styles/andreas01/src/images/bg.gif +0 -0
  41. data/data/webgen/website_styles/andreas01/src/images/front.jpg +0 -0
  42. data/data/webgen/website_styles/andreas01/src/print.css +35 -0
  43. data/data/webgen/website_styles/andreas03/README +14 -0
  44. data/data/webgen/website_styles/andreas03/src/default.css +223 -0
  45. data/data/webgen/website_styles/andreas03/src/default.template +58 -0
  46. data/data/webgen/website_styles/andreas03/src/images/bodybg.png +0 -0
  47. data/data/webgen/website_styles/andreas03/src/images/contbg.png +0 -0
  48. data/data/webgen/website_styles/andreas03/src/images/footerbg.png +0 -0
  49. data/data/webgen/website_styles/andreas03/src/images/gradient1.png +0 -0
  50. data/data/webgen/website_styles/andreas03/src/images/gradient2.png +0 -0
  51. data/data/webgen/website_styles/andreas04/README +15 -0
  52. data/data/webgen/website_styles/andreas04/src/default.css +290 -0
  53. data/data/webgen/website_styles/andreas04/src/default.template +81 -0
  54. data/data/webgen/website_styles/andreas04/src/images/blinkarrow.gif +0 -0
  55. data/data/webgen/website_styles/andreas04/src/images/bodybg.png +0 -0
  56. data/data/webgen/website_styles/andreas04/src/images/contentbg.png +0 -0
  57. data/data/webgen/website_styles/andreas04/src/images/entrybg.png +0 -0
  58. data/data/webgen/website_styles/andreas04/src/images/flash.gif +0 -0
  59. data/data/webgen/website_styles/andreas04/src/images/flash2.gif +0 -0
  60. data/data/webgen/website_styles/andreas04/src/images/globe.gif +0 -0
  61. data/data/webgen/website_styles/andreas04/src/images/globebottom.gif +0 -0
  62. data/data/webgen/website_styles/andreas04/src/images/linkarrow.gif +0 -0
  63. data/data/webgen/website_styles/andreas04/src/images/menuhover.png +0 -0
  64. data/data/webgen/website_styles/andreas05/README +14 -0
  65. data/data/webgen/website_styles/andreas05/src/default.css +33 -0
  66. data/data/webgen/website_styles/andreas05/src/default.template +40 -0
  67. data/data/webgen/website_styles/andreas05/src/images/bodybg.gif +0 -0
  68. data/data/webgen/website_styles/andreas05/src/images/front.png +0 -0
  69. data/data/webgen/website_styles/andreas06/README +14 -0
  70. data/data/webgen/website_styles/andreas06/src/default.css +354 -0
  71. data/data/webgen/website_styles/andreas06/src/default.template +70 -0
  72. data/data/webgen/website_styles/andreas06/src/images/bodybg.gif +0 -0
  73. data/data/webgen/website_styles/andreas06/src/images/boxbg.gif +0 -0
  74. data/data/webgen/website_styles/andreas06/src/images/greypx.gif +0 -0
  75. data/data/webgen/website_styles/andreas06/src/images/header.jpg +0 -0
  76. data/data/webgen/website_styles/andreas06/src/images/innerbg.gif +0 -0
  77. data/data/webgen/website_styles/andreas06/src/images/leaves.jpg +0 -0
  78. data/data/webgen/website_styles/andreas06/src/images/tabs.gif +0 -0
  79. data/data/webgen/website_styles/andreas07/README +15 -0
  80. data/data/webgen/website_styles/andreas07/src/browserfix.css +7 -0
  81. data/data/webgen/website_styles/andreas07/src/default.css +92 -0
  82. data/data/webgen/website_styles/andreas07/src/default.template +42 -0
  83. data/data/webgen/website_styles/andreas07/src/images/bodybg.gif +0 -0
  84. data/data/webgen/website_styles/andreas07/src/images/sidebarbg.gif +0 -0
  85. data/data/webgen/website_styles/andreas08/README +14 -0
  86. data/data/webgen/website_styles/andreas08/src/default.css +224 -0
  87. data/data/webgen/website_styles/andreas08/src/default.template +51 -0
  88. data/data/webgen/website_styles/andreas09/README +14 -0
  89. data/data/webgen/website_styles/andreas09/src/default.css +308 -0
  90. data/data/webgen/website_styles/andreas09/src/default.template +68 -0
  91. data/data/webgen/website_styles/andreas09/src/images/bodybg-black.jpg +0 -0
  92. data/data/webgen/website_styles/andreas09/src/images/bodybg-green.jpg +0 -0
  93. data/data/webgen/website_styles/andreas09/src/images/bodybg-orange.jpg +0 -0
  94. data/data/webgen/website_styles/andreas09/src/images/bodybg-purple.jpg +0 -0
  95. data/data/webgen/website_styles/andreas09/src/images/bodybg-red.jpg +0 -0
  96. data/data/webgen/website_styles/andreas09/src/images/bodybg.jpg +0 -0
  97. data/data/webgen/website_styles/andreas09/src/images/footerbg.jpg +0 -0
  98. data/data/webgen/website_styles/andreas09/src/images/menuhover-black.jpg +0 -0
  99. data/data/webgen/website_styles/andreas09/src/images/menuhover-green.jpg +0 -0
  100. data/data/webgen/website_styles/andreas09/src/images/menuhover-orange.jpg +0 -0
  101. data/data/webgen/website_styles/andreas09/src/images/menuhover-purple.jpg +0 -0
  102. data/data/webgen/website_styles/andreas09/src/images/menuhover-red.jpg +0 -0
  103. data/data/webgen/website_styles/andreas09/src/images/menuhover.jpg +0 -0
  104. data/data/webgen/website_styles/simple/README +6 -0
  105. data/data/webgen/website_styles/simple/src/default.css +84 -0
  106. data/data/webgen/website_styles/simple/src/default.template +36 -0
  107. data/data/webgen/website_templates/default/README +6 -0
  108. data/data/webgen/website_templates/default/src/index.page +8 -0
  109. data/data/webgen/website_templates/project/README +5 -0
  110. data/data/webgen/website_templates/project/src/about.page +12 -0
  111. data/data/webgen/website_templates/project/src/download.page +15 -0
  112. data/data/webgen/website_templates/project/src/features.page +8 -0
  113. data/data/webgen/website_templates/project/src/index.page +9 -0
  114. data/data/webgen/website_templates/project/src/screenshots.page +18 -0
  115. data/doc/contentprocessor.template +11 -0
  116. data/doc/contentprocessor/blocks.page +66 -0
  117. data/doc/contentprocessor/builder.page +80 -0
  118. data/doc/contentprocessor/erb.page +56 -0
  119. data/doc/contentprocessor/erubis.page +46 -0
  120. data/doc/contentprocessor/haml.page +47 -0
  121. data/doc/contentprocessor/maruku.page +41 -0
  122. data/doc/contentprocessor/rdiscount.page +37 -0
  123. data/doc/contentprocessor/rdoc.page +36 -0
  124. data/doc/contentprocessor/redcloth.page +39 -0
  125. data/doc/contentprocessor/sass.page +31 -0
  126. data/doc/contentprocessor/tags.page +73 -0
  127. data/doc/extensions.metainfo +29 -0
  128. data/doc/extensions.page +16 -0
  129. data/doc/extensions.template +17 -0
  130. data/doc/faq.page +214 -0
  131. data/doc/getting_started.page +134 -0
  132. data/doc/index.page +65 -0
  133. data/doc/manual.page +532 -0
  134. data/doc/reference_configuration.page +646 -0
  135. data/doc/reference_metainfo.page +213 -0
  136. data/doc/sourcehandler.template +21 -0
  137. data/doc/sourcehandler/copy.page +19 -0
  138. data/doc/sourcehandler/directory.page +27 -0
  139. data/doc/sourcehandler/feed.page +82 -0
  140. data/doc/sourcehandler/metainfo.page +41 -0
  141. data/doc/sourcehandler/page.page +30 -0
  142. data/doc/sourcehandler/sitemap.page +46 -0
  143. data/doc/sourcehandler/template.page +45 -0
  144. data/doc/sourcehandler/virtual.page +49 -0
  145. data/doc/tag.template +25 -0
  146. data/doc/tag/breadcrumbtrail.page +40 -0
  147. data/doc/tag/coderay.page +49 -0
  148. data/doc/tag/date.page +31 -0
  149. data/doc/tag/executecommand.page +26 -0
  150. data/doc/tag/includefile.page +32 -0
  151. data/doc/tag/langbar.page +22 -0
  152. data/doc/tag/menu.page +92 -0
  153. data/doc/tag/metainfo.page +29 -0
  154. data/doc/tag/relocatable.page +38 -0
  155. data/doc/tag/sitemap.page +31 -0
  156. data/doc/upgrading.page +139 -0
  157. data/doc/webgen_page_format.page +128 -0
  158. data/lib/webgen/blackboard.rb +73 -0
  159. data/lib/webgen/cache.rb +85 -0
  160. data/lib/webgen/cli.rb +118 -0
  161. data/lib/webgen/cli/create_command.rb +64 -0
  162. data/lib/webgen/cli/run_command.rb +20 -0
  163. data/lib/webgen/cli/utils.rb +86 -0
  164. data/lib/webgen/cli/webgui_command.rb +49 -0
  165. data/lib/webgen/common.rb +10 -0
  166. data/lib/webgen/common/sitemap.rb +76 -0
  167. data/lib/webgen/configuration.rb +147 -0
  168. data/lib/webgen/contentprocessor.rb +96 -0
  169. data/lib/webgen/contentprocessor/blocks.rb +46 -0
  170. data/lib/webgen/contentprocessor/builder.rb +26 -0
  171. data/lib/webgen/contentprocessor/context.rb +90 -0
  172. data/lib/webgen/contentprocessor/erb.rb +24 -0
  173. data/lib/webgen/contentprocessor/erubis.rb +40 -0
  174. data/lib/webgen/contentprocessor/haml.rb +25 -0
  175. data/lib/webgen/contentprocessor/maruku.rb +18 -0
  176. data/lib/webgen/contentprocessor/rdiscount.rb +15 -0
  177. data/lib/webgen/contentprocessor/rdoc.rb +17 -0
  178. data/lib/webgen/contentprocessor/redcloth.rb +15 -0
  179. data/lib/webgen/contentprocessor/sass.rb +18 -0
  180. data/lib/webgen/contentprocessor/tags.rb +134 -0
  181. data/lib/webgen/coreext.rb +10 -0
  182. data/lib/webgen/default_config.rb +198 -0
  183. data/lib/webgen/languages.rb +578 -0
  184. data/lib/webgen/loggable.rb +23 -0
  185. data/lib/webgen/logger.rb +78 -0
  186. data/lib/webgen/node.rb +347 -0
  187. data/lib/webgen/output.rb +37 -0
  188. data/lib/webgen/output/filesystem.rb +67 -0
  189. data/lib/webgen/page.rb +133 -0
  190. data/lib/webgen/path.rb +182 -0
  191. data/lib/webgen/source.rb +24 -0
  192. data/lib/webgen/source/filesystem.rb +58 -0
  193. data/lib/webgen/source/resource.rb +42 -0
  194. data/lib/webgen/source/stacked.rb +53 -0
  195. data/lib/webgen/sourcehandler.rb +202 -0
  196. data/lib/webgen/sourcehandler/base.rb +211 -0
  197. data/lib/webgen/sourcehandler/copy.rb +41 -0
  198. data/lib/webgen/sourcehandler/directory.rb +31 -0
  199. data/lib/webgen/sourcehandler/feed.rb +121 -0
  200. data/lib/webgen/sourcehandler/fragment.rb +71 -0
  201. data/lib/webgen/sourcehandler/metainfo.rb +117 -0
  202. data/lib/webgen/sourcehandler/page.rb +77 -0
  203. data/lib/webgen/sourcehandler/sitemap.rb +60 -0
  204. data/lib/webgen/sourcehandler/template.rb +68 -0
  205. data/lib/webgen/sourcehandler/virtual.rb +75 -0
  206. data/lib/webgen/tag.rb +23 -0
  207. data/lib/webgen/tag/base.rb +162 -0
  208. data/lib/webgen/tag/breadcrumbtrail.rb +71 -0
  209. data/lib/webgen/tag/coderay.rb +32 -0
  210. data/lib/webgen/tag/date.rb +18 -0
  211. data/lib/webgen/tag/executecommand.rb +29 -0
  212. data/lib/webgen/tag/includefile.rb +42 -0
  213. data/lib/webgen/tag/langbar.rb +52 -0
  214. data/lib/webgen/tag/menu.rb +186 -0
  215. data/lib/webgen/tag/metainfo.rb +25 -0
  216. data/lib/webgen/tag/relocatable.rb +53 -0
  217. data/lib/webgen/tag/sitemap.rb +42 -0
  218. data/lib/webgen/tree.rb +80 -0
  219. data/lib/webgen/version.rb +6 -0
  220. data/lib/webgen/webgentask.rb +148 -0
  221. data/lib/webgen/website.rb +214 -0
  222. data/lib/webgen/websiteaccess.rb +29 -0
  223. data/lib/webgen/websitemanager.rb +125 -0
  224. data/man/man1/webgen.1 +67 -0
  225. data/misc/default.css +360 -0
  226. data/misc/default.template +75 -0
  227. data/misc/htmldoc.metainfo +25 -0
  228. data/misc/htmldoc.virtual +5 -0
  229. data/misc/images/arrow.gif +0 -0
  230. data/misc/images/error.gif +0 -0
  231. data/misc/images/exclamation.gif +0 -0
  232. data/misc/images/headerbg.jpg +0 -0
  233. data/misc/images/information.gif +0 -0
  234. data/misc/images/quote.gif +0 -0
  235. data/setup.rb +1585 -0
  236. data/test/helper.rb +41 -0
  237. data/test/test_blackboard.rb +58 -0
  238. data/test/test_cache.rb +57 -0
  239. data/test/test_common_sitemap.rb +56 -0
  240. data/test/test_configuration.rb +66 -0
  241. data/test/test_contentprocessor.rb +31 -0
  242. data/test/test_contentprocessor_blocks.rb +34 -0
  243. data/test/test_contentprocessor_builder.rb +19 -0
  244. data/test/test_contentprocessor_context.rb +38 -0
  245. data/test/test_contentprocessor_erb.rb +20 -0
  246. data/test/test_contentprocessor_erubis.rb +47 -0
  247. data/test/test_contentprocessor_haml.rb +20 -0
  248. data/test/test_contentprocessor_maruku.rb +27 -0
  249. data/test/test_contentprocessor_rdiscount.rb +15 -0
  250. data/test/test_contentprocessor_rdoc.rb +16 -0
  251. data/test/test_contentprocessor_redcloth.rb +12 -0
  252. data/test/test_contentprocessor_sass.rb +20 -0
  253. data/test/test_contentprocessor_tags.rb +97 -0
  254. data/test/test_languages.rb +53 -0
  255. data/test/test_loggable.rb +30 -0
  256. data/test/test_logger.rb +73 -0
  257. data/test/test_node.rb +339 -0
  258. data/test/test_output_filesystem.rb +58 -0
  259. data/test/test_page.rb +203 -0
  260. data/test/test_path.rb +131 -0
  261. data/test/test_source_filesystem.rb +59 -0
  262. data/test/test_source_resource.rb +26 -0
  263. data/test/test_source_stacked.rb +34 -0
  264. data/test/test_sourcehandler_base.rb +92 -0
  265. data/test/test_sourcehandler_copy.rb +45 -0
  266. data/test/test_sourcehandler_directory.rb +25 -0
  267. data/test/test_sourcehandler_feed.rb +74 -0
  268. data/test/test_sourcehandler_fragment.rb +67 -0
  269. data/test/test_sourcehandler_metainfo.rb +93 -0
  270. data/test/test_sourcehandler_page.rb +70 -0
  271. data/test/test_sourcehandler_sitemap.rb +47 -0
  272. data/test/test_sourcehandler_template.rb +63 -0
  273. data/test/test_sourcehandler_virtual.rb +56 -0
  274. data/test/test_tag_base.rb +82 -0
  275. data/test/test_tag_breadcrumbtrail.rb +89 -0
  276. data/test/test_tag_coderay.rb +30 -0
  277. data/test/test_tag_date.rb +16 -0
  278. data/test/test_tag_executecommand.rb +39 -0
  279. data/test/test_tag_includefile.rb +48 -0
  280. data/test/test_tag_langbar.rb +60 -0
  281. data/test/test_tag_menu.rb +195 -0
  282. data/test/test_tag_metainfo.rb +17 -0
  283. data/test/test_tag_relocatable.rb +57 -0
  284. data/test/test_tag_sitemap.rb +44 -0
  285. data/test/test_tree.rb +69 -0
  286. data/test/test_webgentask.rb +21 -0
  287. data/test/test_website.rb +96 -0
  288. data/test/test_websiteaccess.rb +23 -0
  289. data/test/test_websitemanager.rb +68 -0
  290. metadata +575 -0
@@ -0,0 +1,29 @@
1
+ module Webgen
2
+
3
+ # Mixed into modules/classes that need access to the current website object.
4
+ module WebsiteAccess
5
+
6
+ # The methods of this module are available on classes that include WebsiteAccess.
7
+ module ClassMethods
8
+
9
+ # See WebsiteAccess.website
10
+ def website
11
+ WebsiteAccess.website
12
+ end
13
+
14
+ end
15
+
16
+ def self.included(klass) #:nodoc:
17
+ super
18
+ klass.extend(ClassMethods)
19
+ end
20
+
21
+ # Return the current website object or +nil+.
22
+ def website
23
+ Thread.current[:webgen_website]
24
+ end
25
+ module_function :website
26
+
27
+ end
28
+
29
+ end
@@ -0,0 +1,125 @@
1
+ require 'ostruct'
2
+ require 'fileutils'
3
+ require 'webgen/website'
4
+
5
+ module Webgen
6
+
7
+ # This class is used for managing webgen websites. It provides access to website templates and
8
+ # styles defined as resources and makes it easy to apply them to a webgen website.
9
+ #
10
+ # = General information
11
+ #
12
+ # Currently, the following actions are supported:
13
+ #
14
+ # * creating a website based on a website template (#create_website)
15
+ # * applying a template to an existing website (#apply_template)
16
+ # * applying a style to an existing website (#apply_style)
17
+ #
18
+ # A website template defines some initial pages which should be filled with real data. For
19
+ # example, the @project@ template defines several pages which are useful for software projects
20
+ # including a features and about page.
21
+ #
22
+ # A style defines, for example, the basic page layout (in the case of website styles) or how image
23
+ # galleries should look like (in the case of gallery styles). So styles are basically used to
24
+ # change the appearance of parts (or the whole) website. This makes them a powerful tool as this
25
+ # plugin makes it easy to change a style later!
26
+ #
27
+ # = website template and style resource naming convention
28
+ #
29
+ # Styles and website templates are defined using resources. Each such resource has to be a
30
+ # directory containing an optional README file in YAML format in which key-value pairs provide
31
+ # additional information about the style or website template. All other files/directories in the
32
+ # directory are copied to the root of the destination webgen website when the style or website
33
+ # template is used.
34
+ #
35
+ # This class uses a special naming convention to recognize website templates and styles:
36
+ #
37
+ # * A resource named <tt>webgen-website-template-TEMPLATE_NAME</tt> is considered to be a website
38
+ # template called TEMPLATE_NAME and can be later accessed using this name.
39
+ #
40
+ # * A resource named <tt>webgen-website-style-CATEGORY-STYLE_NAME</tt> is considered to be a style
41
+ # in the category CATEGORY called STYLE_NAME. There are no fixed categories, one can use
42
+ # anything here! Again, the style can later be accessed by providing the category and style
43
+ # name.
44
+ #
45
+ # Website template names have to be unique and style names have to be unique in respect to their
46
+ # categories!
47
+ #
48
+ # Note: All styles without a category or which are in the category 'website' are website styles.
49
+ class WebsiteManager
50
+
51
+ # A hash with the available website templates (mapping name to infos).
52
+ attr_reader :templates
53
+
54
+ # A hash with the available website styles (mapping name to infos).
55
+ attr_reader :styles
56
+
57
+ # The used Website object.
58
+ attr_reader :website
59
+
60
+ # Create a new WebsiteManager for the website +dir+.
61
+ def initialize(dir)
62
+ @website = Webgen::Website.new(dir)
63
+ @website.init
64
+ @styles = {}
65
+ @templates = {}
66
+
67
+ @website.execute_in_env do
68
+ [['webgen-website-style-', @styles], ['webgen-website-template-', @templates]].each do |prefix, var|
69
+ @website.config['resources'].select {|name, data| name =~ /^#{prefix}/}.each do |name, data|
70
+ paths = Webgen::Source::Resource.new(name).paths
71
+ readme = paths.select {|path| path == '/README' }.first
72
+ paths.delete(readme) if readme
73
+ infos = OpenStruct.new(readme.nil? ? {} : YAML::load(readme.io.data))
74
+ infos.paths = paths
75
+ var[name.sub(prefix, '')] = infos
76
+ end
77
+ end
78
+ end
79
+ end
80
+
81
+ # Create the basic website skeleton (without any template or style applied).
82
+ def create_website
83
+ raise "Directory <#{@website.directory}> does already exist!" if File.exists?(@website.directory)
84
+ @website.execute_in_env { write_paths(Webgen::Source::Resource.new('webgen-website-skeleton').paths) }
85
+ end
86
+
87
+ # Apply the given +template+ to the website by copying the template files.
88
+ def apply_template(name)
89
+ write_paths_to_website(@templates[name], 'template')
90
+ end
91
+
92
+ # Apply the given website style +name+ to the website by copying the styles files.
93
+ def apply_style(name)
94
+ write_paths_to_website(@styles[name], 'style')
95
+ end
96
+
97
+ #######
98
+ private
99
+ #######
100
+
101
+ # Do some sanity checks and write the +paths+ from +infos+ to the website directory.
102
+ def write_paths_to_website(infos, infos_type)
103
+ raise ArgumentError.new("Invalid #{infos_type} name") if infos.nil?
104
+ raise "Directory <#{@website.directory}> does not exist!" unless File.exists?(@website.directory)
105
+ write_paths(infos.paths)
106
+ end
107
+
108
+ # Write the paths to the website directory.
109
+ def write_paths(paths)
110
+ paths.each do |path|
111
+ output_path = File.join(@website.directory, path.path)
112
+ if path.path =~ /\/$/
113
+ FileUtils.mkdir_p(output_path)
114
+ else
115
+ FileUtils.mkdir_p(File.dirname(output_path))
116
+ path.io.stream do |source|
117
+ File.open(output_path, 'wb') {|f| FileUtils.copy_stream(source, f) }
118
+ end
119
+ end
120
+ end
121
+ end
122
+
123
+ end
124
+
125
+ end
data/man/man1/webgen.1 ADDED
@@ -0,0 +1,67 @@
1
+ .TH "WEBGEN" 1 "July 2008"
2
+ .SH NAME
3
+ webgen \- a fast, powerful and extensible static website generator
4
+ .SH SYNOPSIS
5
+ .B webgen
6
+ [\fIglobal options\fR]
7
+ \fIcommand\fR
8
+ [\fIcommand arguments\fR] [command [command arguments] ...] [args]
9
+ .SH DESCRIPTION
10
+ webgen is used to generate static websites from content files written in a markup language and
11
+ template files. You create one template file in which you define the layout of your pages and where
12
+ the content should go. After that you create content files called page files in which you only
13
+ define the content. webgen merges the page's content into the template and generates the final HTML
14
+ output. During the last step so called webgen tags are substituted so that, for example, menus can
15
+ automatically be generated.
16
+ .SH GLOBAL OPTIONS
17
+ .TP
18
+ .B \-d, \-\-directory DIR
19
+ Set the website directectory. if none specified, the current directory is used.
20
+ .TP
21
+ .B \-v, \-\-verbose
22
+ Show more output by default.
23
+ .TP
24
+ .B \-q, \-\-quiet
25
+ Show less output by default. If this option is specified, then no output is shown during rendering
26
+ of a website.
27
+ .TP
28
+ .B \-l, \-\-log-level LEVEL
29
+ Set the logging level to LEVEL which can be a number between 0 (debug output) and 3 (only error
30
+ output).
31
+ .TP
32
+ .B \-h, \-\-help
33
+ Show generic help.
34
+ .TP
35
+ .B \-\-version
36
+ Show the version of the program and exit.
37
+ .SH COMMANDS
38
+ .TP
39
+ \fBcreate\fR
40
+ Creates the basic directories and files for webgen. This includes the source and
41
+ output directories as well as an empty extensions directory. Also, a basic template plus a CSS and
42
+ an index file are created. Takes the \fIdirectory\fR to create the webgen structure in as an
43
+ argument.
44
+ .TP
45
+ \fBhelp\fR
46
+ Provides help for the individual commands.
47
+ .TP
48
+ \fBrender\fR
49
+ Runs webgen which will result in the generation of the HTML data in the output
50
+ directory from the files in the source directory. This command is used as the default command when
51
+ no command was issued.
52
+ .TP
53
+ \fBversion\fR
54
+ Shows the version of the program and exit.
55
+ .TP
56
+ \fBwebgui\fR
57
+ Starts the webgen webgui, a browser based graphical user interface for manging webgen websites.
58
+ .SH SEE ALSO
59
+ The webgen website, http://webgen.rubyforge.org/ for more information.
60
+ .SH AUTHOR
61
+ webgen was written by Thomas Leitner <t_leitner@gmx.at>
62
+ .PP
63
+ This manual page was written by Paul van Tilburg <paulvt@debian.org> for the Debian project (but may
64
+ be used by others). This manual page was update to reflect webgen 0.4 change by Arnaud Cornet
65
+ <arnaud.cornet@gmail.com>. This manual page was updated to reflect webgen 0.5.x changes by Thomas
66
+ Leitner <t_leitner@gmx.at>.
67
+
data/misc/default.css ADDED
@@ -0,0 +1,360 @@
1
+ /********************************************
2
+ AUTHOR: Erwin Aligam
3
+ WEBSITE: http://www.styleshout.com/
4
+ TEMPLATE NAME: ablaze
5
+ TEMPLATE CODE: S-0009
6
+ VERSION: 2.1
7
+ *******************************************/
8
+
9
+ /********************************************
10
+ HTML ELEMENTS
11
+
12
+ ********************************************/
13
+
14
+ /* top elements */
15
+ * {
16
+ padding: 0;
17
+ margin: 0;
18
+ }
19
+
20
+ body {
21
+ margin: 0;
22
+ padding: 0;
23
+ font: normal .80em/1.5em Tahoma, 'Trebuchet MS', sans-serif;
24
+ color: #000;
25
+ text-align: center;
26
+ background-color: #FCFFF5;
27
+ }
28
+
29
+ /* links */
30
+ a {
31
+ color: #3E606F;
32
+ background-color: inherit;
33
+ text-decoration: underline;
34
+ }
35
+
36
+ a:hover {
37
+ color: #193441;
38
+ background-color: #D1DBBD;
39
+ }
40
+
41
+ /* headers */
42
+ h1, h2, h3, h4, h5, h6 {
43
+ font: bold 1.3em 'Trebuchet MS', Arial, Sans-serif;
44
+ color: #CE900A;
45
+ }
46
+ h1 { font-size: 1.6em; }
47
+ h2 { font-size: 1.4em; color: #A0080D }
48
+ h3 { font-size: 1.3em; }
49
+
50
+ #main h1 {
51
+ color: #193441;
52
+ padding-top: 15px;
53
+ }
54
+
55
+ #sidebar h1 {
56
+ font: bold 1.4em 'Trebuchet MS', Arial, Sans-serif;
57
+ background: url(images/arrow.gif) no-repeat 0px .6em;
58
+ padding: 7px 0 7px 25px;
59
+ color: #193441;
60
+ }
61
+
62
+ p, h1, h2, h3 {
63
+ margin: 0;
64
+ padding: 5px 0px;
65
+ }
66
+
67
+ ul, ol {
68
+ margin: 10px 0px;
69
+ padding: 0 15px;
70
+ color: #000; /* #3E606F; */
71
+ }
72
+
73
+ /* images */
74
+ img {
75
+ border: none;
76
+ }
77
+
78
+ pre {
79
+ margin: 5px 0px;
80
+ padding: 5px;
81
+ text-align: left;
82
+ overflow: auto;
83
+ font: 'Lucida Console', 'courier new', monospace;
84
+ color: #193441;
85
+ background: #D1DBBD;
86
+ border-bottom: 1px solid #91AA9D;
87
+ border-top: 1px solid #91AA9D;
88
+ }
89
+
90
+ code {
91
+ font: 'Lucida Console', 'courier new', monospace;
92
+ color: #193441;
93
+ font-size: 115%;
94
+ }
95
+
96
+ acronym {
97
+ cursor: help;
98
+ border-bottom: 1px solid #777;
99
+ }
100
+
101
+ blockquote.exclamation, blockquote.error, blockquote.information {
102
+ margin: 10px 0px;
103
+ padding: 0 0 0 40px;
104
+ min-height: 40px;
105
+ border: 1px solid #91AA9D;
106
+ font: 'Trebuchet MS', Sans-serif;
107
+ background-color: #D1DBBD;
108
+ background-image: url(images/quote.gif);
109
+ background-repeat: no-repeat;
110
+ background-position: 5px 5px;
111
+ }
112
+
113
+ blockquote.exclamation {
114
+ background-image: url(images/exclamation.gif);
115
+ }
116
+
117
+ blockquote.error {
118
+ background-image: url(images/error.gif);
119
+ }
120
+
121
+ blockquote.information {
122
+ background-image: url(images/information.gif);
123
+ }
124
+
125
+ blockquote pre {
126
+ border: none;
127
+ }
128
+
129
+ /***********************
130
+ LAYOUT
131
+ ************************/
132
+
133
+ #header-content, #content {
134
+ width: 100%;
135
+ }
136
+
137
+ /* header */
138
+ #header {
139
+ background: #444 url(images/headerbg.jpg) repeat-x 0 0;
140
+ height: 120px;
141
+ text-align: left;
142
+ }
143
+
144
+ #header-content {
145
+ position: relative;
146
+ margin: 0 auto;
147
+ padding: 0;
148
+ }
149
+
150
+ #header-content #logo {
151
+ position: absolute;
152
+ font: bold 50px Verdana, 'Trebuchet Ms', Sans-serif;
153
+ letter-spacing: -2px;
154
+ color: #FCFFF5;
155
+ margin: 0; padding: 0;
156
+
157
+ top: 5px; left: 20px;
158
+ }
159
+
160
+ #header-content #slogan {
161
+ position: absolute;
162
+ font: bold 16px 'Trebuchet Ms', Sans-serif;
163
+ text-transform: none;
164
+ color: #CCC;
165
+ margin: 0; padding: 0;
166
+
167
+ top: 65px; left: 35px;
168
+ }
169
+
170
+ /* header menu */
171
+ #header-content ul {
172
+ position: absolute;
173
+ right: 20px; top: 75px;
174
+ font: bolder 1.3em 'Trebuchet MS', sans-serif;
175
+ color: #FCFFF5;
176
+ list-style: none;
177
+ margin: 0; padding: 0;
178
+ }
179
+ #header-content li {
180
+ float: left;
181
+ display: block;
182
+ color: #FCFFF5;
183
+ text-decoration: none;
184
+ }
185
+ #header-content li a, #header-content li span {
186
+ display: block;
187
+ color: #3E606F;
188
+ text-decoration: none;
189
+ padding: 3px 12px;
190
+ }
191
+ #header-content li a:hover {
192
+ background: #FCFFF5;
193
+ color: #A0080D;
194
+ }
195
+ #header-content li.webgen-menu-item-selected, #header-content li.webgen-menu-submenu-inhierarchy {
196
+ background: #FCFFF5;
197
+ color: #A0080D;
198
+ }
199
+
200
+ /* content */
201
+ #content-wrap {
202
+ clear: both;
203
+ float: left;
204
+ width: 100%;
205
+ }
206
+
207
+ #content {
208
+ text-align: left;
209
+ padding: 0; margin: 0 auto;
210
+ background: #91AA9D;
211
+ }
212
+
213
+ /* sidebar */
214
+ #sidebar {
215
+ float: right;
216
+ width: 340px;
217
+ margin: 0; padding: 10px;
218
+ background-color: #91AA9D;
219
+ }
220
+ #sidebar p {
221
+ margin: 0px;
222
+ padding-left: 10px;
223
+ }
224
+ #sidebar ul {
225
+ list-style: inside square;
226
+ margin: 0px;
227
+ padding: 0px;
228
+ }
229
+ #sidebar ul li {
230
+ padding: 0px;
231
+ margin: 0px;
232
+ padding-left: 1em;
233
+ padding-top: 0.3em;
234
+ }
235
+ #sidebar ul a {
236
+ color: #FCFFF5;
237
+ text-decoration: none;
238
+ padding: .3em 0 .3em 3px;
239
+ line-height: 1.5ex;
240
+ }
241
+ #sidebar ul a:hover {
242
+ border-left: 5px solid #193441;
243
+ color: #193441;
244
+ }
245
+
246
+ /* main */
247
+ #main {
248
+ margin: 0 360px 0 0;
249
+ padding: 20px;
250
+ background-color: #FCFFF5;
251
+ }
252
+
253
+ /* footer */
254
+ #footer {
255
+ clear: both;
256
+ color: #FCFFF5;
257
+ margin: 0;
258
+ padding: 0;
259
+ border-top: 1px solid #3E60F6;
260
+ font-size: 95%;
261
+ text-align: left;
262
+ }
263
+ #footer h2, #footer p {
264
+ padding-left: 0;
265
+ }
266
+ #footer-content {
267
+ width: 100%;
268
+ margin: 0 auto;
269
+ position: absolute;
270
+ background-color: #193441;
271
+ }
272
+ #footer-content a {
273
+ text-decoration: none;
274
+ color: #CCC;
275
+ }
276
+ #footer-content a:hover {
277
+ text-decoration: underline;
278
+ background-color: inherit;
279
+ }
280
+ #footer-content ul {
281
+ list-style: none;
282
+ margin: 0;
283
+ padding: 0;
284
+ }
285
+ #footer-content .col {
286
+ width: 32%;
287
+ padding: 0 5px 30px 15px;
288
+ }
289
+ #footer-content .col2 {
290
+ width: 30%;
291
+ padding: 0 0 30px 0;
292
+ }
293
+
294
+ /* alignment classes */
295
+ .float-left { float: left; }
296
+ .float-right { float: right; }
297
+ .align-left { text-align: left; }
298
+ .align-right { text-align: right; }
299
+
300
+ /* additional classes */
301
+ .clear { clear: both; }
302
+ .comments {
303
+ text-align: right;
304
+ border: 1px dashed #151515;
305
+ padding: 5px 10px;
306
+ margin: 20px 15px 10px 15px;
307
+ }
308
+ .small {
309
+ font-size: 90%;
310
+ color: #666;
311
+ padding: 2px;
312
+ }
313
+
314
+ /* extensions classes */
315
+ .backlink {
316
+ float: right;
317
+ }
318
+
319
+ table.examples {
320
+ border: 1px solid black;
321
+ border-collapse: collapse;
322
+ margin-left: auto;
323
+ margin-right: auto;
324
+ width: 80%;
325
+ }
326
+
327
+ table.examples td, table.examples th {
328
+ border: 1px solid black;
329
+ padding: 3px;
330
+ }
331
+
332
+
333
+
334
+ /* plugin documentation classes */
335
+ .plugin-info .param-name {
336
+ color: #193441;
337
+ }
338
+
339
+ .plugin-info .param-default-value {
340
+ color: #A0080D;
341
+ }
342
+
343
+ .plugin-info p.param {
344
+ padding: 0px 0px 5px;
345
+ }
346
+
347
+
348
+ /* blog related classes */
349
+ div.blog-entry {
350
+ margin-bottom: 15px;
351
+ }
352
+
353
+ blockquote.blog-entry-details {
354
+ font-size: 80%;
355
+ margin-bottom: 5px;
356
+ }
357
+
358
+ .blog-entry-date, .blog-entry-author {
359
+ font-weight: bold;
360
+ }