webgen 0.3.6 → 0.3.7

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 (261) hide show
  1. data/ChangeLog +1523 -97
  2. data/Rakefile +11 -24
  3. data/TODO +22 -9
  4. data/VERSION +1 -1
  5. data/bin/webgen +2 -2
  6. data/bin/webgen-gallery-editor +654 -0
  7. data/bin/webgen-gui +10 -0
  8. data/data/webgen/data/ISO-639-2_values_8bits.txt +492 -0
  9. data/data/webgen/gallery-creator/default.png +0 -0
  10. data/data/webgen/icon_mapping.yaml +27 -0
  11. data/data/webgen/resources/emoticons/bigeyes/angry.png +0 -0
  12. data/data/webgen/resources/emoticons/bigeyes/cool.png +0 -0
  13. data/data/webgen/resources/emoticons/bigeyes/cry.png +0 -0
  14. data/data/webgen/resources/emoticons/bigeyes/drunk.png +0 -0
  15. data/data/webgen/resources/emoticons/bigeyes/lol.png +0 -0
  16. data/data/webgen/resources/emoticons/bigeyes/oops.png +0 -0
  17. data/data/webgen/resources/emoticons/bigeyes/sad.png +0 -0
  18. data/data/webgen/resources/emoticons/bigeyes/sleep.png +0 -0
  19. data/data/webgen/resources/emoticons/bigeyes/smile.png +0 -0
  20. data/data/webgen/resources/emoticons/bigeyes/tongue.png +0 -0
  21. data/data/webgen/resources/emoticons/bigeyes/wink.png +0 -0
  22. data/data/webgen/resources/emoticons/crystal/angry.png +0 -0
  23. data/data/webgen/resources/emoticons/crystal/cool.png +0 -0
  24. data/data/webgen/resources/emoticons/crystal/cry.png +0 -0
  25. data/data/webgen/resources/emoticons/crystal/drunk.png +0 -0
  26. data/data/webgen/resources/emoticons/crystal/lol.png +0 -0
  27. data/data/webgen/resources/emoticons/crystal/oops.png +0 -0
  28. data/data/webgen/resources/emoticons/crystal/sad.png +0 -0
  29. data/data/webgen/resources/emoticons/crystal/sleep.png +0 -0
  30. data/data/webgen/resources/emoticons/crystal/smile.png +0 -0
  31. data/data/webgen/resources/emoticons/crystal/tongue.png +0 -0
  32. data/data/webgen/resources/emoticons/crystal/wink.png +0 -0
  33. data/data/webgen/resources/emoticons/cyclops/angry.png +0 -0
  34. data/data/webgen/resources/emoticons/cyclops/cool.png +0 -0
  35. data/data/webgen/resources/emoticons/cyclops/cry.png +0 -0
  36. data/data/webgen/resources/emoticons/cyclops/drunk.png +0 -0
  37. data/data/webgen/resources/emoticons/cyclops/lol.png +0 -0
  38. data/data/webgen/resources/emoticons/cyclops/oops.png +0 -0
  39. data/data/webgen/resources/emoticons/cyclops/sad.png +0 -0
  40. data/data/webgen/resources/emoticons/cyclops/sleep.png +0 -0
  41. data/data/webgen/resources/emoticons/cyclops/smile.png +0 -0
  42. data/data/webgen/resources/emoticons/cyclops/tongue.png +0 -0
  43. data/data/webgen/resources/emoticons/cyclops/wink.png +0 -0
  44. data/data/webgen/resources/emoticons/glass/angry.png +0 -0
  45. data/data/webgen/resources/emoticons/glass/cool.png +0 -0
  46. data/data/webgen/resources/emoticons/glass/cry.png +0 -0
  47. data/data/webgen/resources/emoticons/glass/drunk.png +0 -0
  48. data/data/webgen/resources/emoticons/glass/lol.png +0 -0
  49. data/data/webgen/resources/emoticons/glass/oops.png +0 -0
  50. data/data/webgen/resources/emoticons/glass/sad.png +0 -0
  51. data/data/webgen/resources/emoticons/glass/sleep.png +0 -0
  52. data/data/webgen/resources/emoticons/glass/smile.png +0 -0
  53. data/data/webgen/resources/emoticons/glass/tongue.png +0 -0
  54. data/data/webgen/resources/emoticons/glass/wink.png +0 -0
  55. data/data/webgen/resources/emoticons/icqstyle/angry.png +0 -0
  56. data/data/webgen/resources/emoticons/icqstyle/cool.png +0 -0
  57. data/data/webgen/resources/emoticons/icqstyle/cry.png +0 -0
  58. data/data/webgen/resources/emoticons/icqstyle/drunk.png +0 -0
  59. data/data/webgen/resources/emoticons/icqstyle/lol.png +0 -0
  60. data/data/webgen/resources/emoticons/icqstyle/oops.png +0 -0
  61. data/data/webgen/resources/emoticons/icqstyle/sad.png +0 -0
  62. data/data/webgen/resources/emoticons/icqstyle/sleep.png +0 -0
  63. data/data/webgen/resources/emoticons/icqstyle/smile.png +0 -0
  64. data/data/webgen/resources/emoticons/icqstyle/tongue.png +0 -0
  65. data/data/webgen/resources/emoticons/icqstyle/wink.png +0 -0
  66. data/data/webgen/resources/emoticons/matrix/angry.gif +0 -0
  67. data/data/webgen/resources/emoticons/matrix/cool.gif +0 -0
  68. data/data/webgen/resources/emoticons/matrix/cry.gif +0 -0
  69. data/data/webgen/resources/emoticons/matrix/drunk.gif +0 -0
  70. data/data/webgen/resources/emoticons/matrix/lol.gif +0 -0
  71. data/data/webgen/resources/emoticons/matrix/oops.gif +0 -0
  72. data/data/webgen/resources/emoticons/matrix/sad.gif +0 -0
  73. data/data/webgen/resources/emoticons/matrix/sleep.gif +0 -0
  74. data/data/webgen/resources/emoticons/matrix/smile.gif +0 -0
  75. data/data/webgen/resources/emoticons/matrix/tongue.gif +0 -0
  76. data/data/webgen/resources/emoticons/matrix/wink.gif +0 -0
  77. data/data/webgen/resources/emoticons/smellies/angry.gif +0 -0
  78. data/data/webgen/resources/emoticons/smellies/cool.gif +0 -0
  79. data/data/webgen/resources/emoticons/smellies/cry.gif +0 -0
  80. data/data/webgen/resources/emoticons/smellies/drunk.gif +0 -0
  81. data/data/webgen/resources/emoticons/smellies/lol.gif +0 -0
  82. data/data/webgen/resources/emoticons/smellies/oops.gif +0 -0
  83. data/data/webgen/resources/emoticons/smellies/sad.gif +0 -0
  84. data/data/webgen/resources/emoticons/smellies/sleep.gif +0 -0
  85. data/data/webgen/resources/emoticons/smellies/smile.gif +0 -0
  86. data/data/webgen/resources/emoticons/smellies/tongue.gif +0 -0
  87. data/data/webgen/resources/emoticons/smellies/wink.gif +0 -0
  88. data/data/webgen/resources/icons/compressed.png +0 -0
  89. data/data/webgen/resources/icons/document.png +0 -0
  90. data/data/webgen/resources/icons/download.png +0 -0
  91. data/data/webgen/resources/icons/image.png +0 -0
  92. data/data/webgen/resources/icons/linux.png +0 -0
  93. data/data/webgen/resources/icons/mac.png +0 -0
  94. data/data/webgen/resources/icons/pdf.png +0 -0
  95. data/data/webgen/resources/icons/penguin.png +0 -0
  96. data/data/webgen/resources/icons/quicktime.png +0 -0
  97. data/data/webgen/resources/icons/real.png +0 -0
  98. data/data/webgen/resources/icons/rpm.png +0 -0
  99. data/data/webgen/resources/icons/sound.png +0 -0
  100. data/data/webgen/resources/icons/source.png +0 -0
  101. data/data/webgen/resources/icons/spreadsheet.png +0 -0
  102. data/data/webgen/resources/icons/text.png +0 -0
  103. data/data/webgen/resources/icons/vcard.png +0 -0
  104. data/data/webgen/resources/icons/video.png +0 -0
  105. data/data/webgen/resources/icons/win.png +0 -0
  106. data/data/webgen/{images → resources/images}/generated_by_webgen.png +0 -0
  107. data/data/webgen/{images → resources/images}/valid-css.gif +0 -0
  108. data/data/webgen/{images → resources/images}/valid-xhtml11.png +0 -0
  109. data/data/webgen/{images → resources/images}/webgen_logo.png +0 -0
  110. data/data/webgen/{example/src → website_styles/default}/default.css +0 -0
  111. data/data/webgen/{example/src → website_styles/default}/default.template +2 -2
  112. data/data/webgen/website_templates/default/README +6 -0
  113. data/data/webgen/{example → website_templates/default}/config.yaml +0 -0
  114. data/data/webgen/{example → website_templates/default}/src/index.page +0 -0
  115. data/data/webgen/website_templates/personal_hp/README +6 -0
  116. data/data/webgen/website_templates/personal_hp/src/about.page +12 -0
  117. data/data/webgen/website_templates/personal_hp/src/index.page +9 -0
  118. data/data/webgen/website_templates/personal_hp/src/links.page +22 -0
  119. data/data/webgen/website_templates/personal_hp/src/projects.page +20 -0
  120. data/data/webgen/website_templates/project/README +7 -0
  121. data/data/webgen/website_templates/project/src/about.page +12 -0
  122. data/data/webgen/website_templates/project/src/download.page +15 -0
  123. data/data/webgen/website_templates/project/src/features.page +8 -0
  124. data/data/webgen/website_templates/project/src/index.page +9 -0
  125. data/data/webgen/website_templates/project/src/screenshots.page +18 -0
  126. data/doc/config.yaml +3 -0
  127. data/doc/plugin/clidesc.rb +18 -7
  128. data/doc/plugin/emoticon.rb +29 -0
  129. data/doc/plugin/extension.rb +15 -16
  130. data/doc/plugin/listpluginparameters.rb +39 -0
  131. data/doc/plugin/resources.rb +4 -4
  132. data/doc/plugin/source.rb +21 -0
  133. data/doc/src/default.css +7 -4
  134. data/doc/src/default.template +4 -2
  135. data/doc/src/documentation/cli.page +1 -1
  136. data/doc/src/documentation/extending_webgen.page +102 -0
  137. data/doc/src/documentation/gettingstarted.page +3 -6
  138. data/doc/src/documentation/index.page +1 -1
  139. data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/html.page +0 -0
  140. data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/index.page +0 -0
  141. data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/markdown.page +0 -0
  142. data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/rdoc.page +0 -0
  143. data/doc/src/documentation/plugins/{contenthandler → contenthandlers}/textile.page +0 -0
  144. data/doc/src/documentation/plugins/{system → coreplugins}/configuration.page +0 -0
  145. data/doc/src/documentation/plugins/coreplugins/index.page +7 -0
  146. data/doc/src/documentation/plugins/{system → coreplugins}/logging.page +0 -0
  147. data/doc/src/documentation/plugins/{resourcemanager.page → coreplugins/resourcemanager.page} +5 -1
  148. data/doc/src/documentation/plugins/{filehandler → filehandlers}/backing.page +1 -1
  149. data/doc/src/documentation/plugins/{filehandler → filehandlers}/copy.page +1 -1
  150. data/doc/src/documentation/plugins/{filehandler/directory.page → filehandlers/directoryhandler.page} +11 -2
  151. data/doc/src/documentation/plugins/{filehandler/galleryhandler.page → filehandlers/gallery.page} +20 -13
  152. data/doc/src/documentation/plugins/{filehandler → filehandlers}/index.page +0 -0
  153. data/doc/src/documentation/plugins/{filehandler/pagehandler.page → filehandlers/page.page} +6 -4
  154. data/doc/src/documentation/plugins/{filehandler → filehandlers}/template.page +0 -0
  155. data/doc/src/documentation/plugins/{gallerylayouter → gallerylayouters}/index.page +7 -3
  156. data/doc/src/documentation/plugins/{htmlvalidator → htmlvalidators}/index.page +0 -0
  157. data/doc/src/documentation/plugins/{htmlvalidator → htmlvalidators}/xmllint.page +0 -0
  158. data/doc/src/documentation/plugins/index.page +4 -0
  159. data/doc/src/documentation/plugins/menustyles/{horizontal-dropdown.page → horizontaldropdown.page} +0 -0
  160. data/doc/src/documentation/plugins/menustyles/{vertical-dropdown.page → verticaldropdown.page} +1 -1
  161. data/doc/src/documentation/plugins/miscplugins/index.page +7 -0
  162. data/doc/src/documentation/plugins/miscplugins/smileyreplacer.page +38 -0
  163. data/doc/src/documentation/plugins/tags/breadcrumbtrail.page +20 -0
  164. data/doc/src/documentation/plugins/tags/download.page +23 -0
  165. data/doc/src/documentation/plugins/tags/resource.page +1 -1
  166. data/doc/src/documentation/plugins/tags/sitemap.page +1 -2
  167. data/doc/src/documentation/references/index.page +8 -0
  168. data/doc/src/documentation/{meta_info_reference.page → references/meta_info_reference.page} +1 -0
  169. data/doc/src/documentation/references/parameter_reference.page +12 -0
  170. data/doc/src/documentation/webgen_gallery_editor.page +82 -0
  171. data/doc/src/download.page +2 -2
  172. data/doc/src/features.page +3 -2
  173. data/doc/src/images/screenshots/wge-image.png +0 -0
  174. data/doc/src/images/screenshots/wge-layout-preview.png +0 -0
  175. data/doc/src/images/screenshots/wge-main-disabled.png +0 -0
  176. data/doc/src/images/screenshots/wge-main.png +0 -0
  177. data/doc/src/index.page +30 -11
  178. data/doc/src/meta.info +7 -7
  179. data/doc/src/screenshots.gallery +33 -0
  180. data/install.rb +1 -1
  181. data/lib/webgen.rb +275 -0
  182. data/lib/webgen/composite.rb +1 -1
  183. data/lib/webgen/gui/common.rb +38 -0
  184. data/lib/webgen/gui/main.rb +219 -0
  185. data/lib/webgen/gui/new_website_dlg.rb +125 -0
  186. data/lib/webgen/listener.rb +1 -1
  187. data/lib/webgen/node.rb +4 -2
  188. data/lib/webgen/plugin.rb +167 -100
  189. data/lib/webgen/plugins/{contenthandler/defaultcontenthandler.rb → contenthandlers/default.rb} +1 -1
  190. data/lib/webgen/plugins/{contenthandler → contenthandlers}/html.rb +2 -2
  191. data/lib/webgen/plugins/{contenthandler → contenthandlers}/markdown.rb +2 -2
  192. data/lib/webgen/plugins/{contenthandler → contenthandlers}/rdoc.rb +2 -2
  193. data/lib/webgen/plugins/{contenthandler → contenthandlers}/textile.rb +2 -2
  194. data/lib/webgen/{configuration.rb → plugins/coreplugins/configuration.rb} +34 -14
  195. data/lib/webgen/{logging.rb → plugins/coreplugins/logging.rb} +4 -4
  196. data/lib/webgen/plugins/{resourcemanager.rb → coreplugins/resourcemanager.rb} +44 -22
  197. data/lib/webgen/plugins/{filehandler → filehandlers}/backing.rb +11 -11
  198. data/lib/webgen/plugins/{filehandler/filecopy.rb → filehandlers/copy.rb} +3 -3
  199. data/lib/webgen/plugins/{filehandler → filehandlers}/directory.rb +15 -10
  200. data/lib/webgen/plugins/{filehandler → filehandlers}/filehandler.rb +9 -7
  201. data/lib/webgen/plugins/{filehandler/picturegallery.rb → filehandlers/gallery.rb} +35 -28
  202. data/lib/webgen/plugins/{filehandler → filehandlers}/page.rb +30 -15
  203. data/lib/webgen/plugins/{filehandler → filehandlers}/template.rb +3 -3
  204. data/lib/webgen/plugins/{gallerylayouter/defaultgallerylayouter.rb → gallerylayouters/default.rb} +11 -11
  205. data/lib/webgen/plugins/{htmlvalidator/defaulthtmlvalidator.rb → htmlvalidators/default.rb} +1 -1
  206. data/lib/webgen/plugins/{htmlvalidator → htmlvalidators}/xmllint.rb +2 -2
  207. data/lib/webgen/plugins/menustyles/{defaultmenustyle.rb → default.rb} +2 -2
  208. data/lib/webgen/plugins/menustyles/horizontal.rb +2 -2
  209. data/lib/webgen/plugins/menustyles/horizontal_dropdown.rb +2 -2
  210. data/lib/webgen/plugins/menustyles/partial.rb +2 -2
  211. data/lib/webgen/plugins/menustyles/vertical.rb +2 -2
  212. data/lib/webgen/plugins/menustyles/vertical_dropdown.rb +2 -2
  213. data/lib/webgen/plugins/miscplugins/smileyreplacer.rb +84 -0
  214. data/lib/webgen/plugins/{treewalker.rb → miscplugins/treewalker.rb} +1 -1
  215. data/lib/webgen/plugins/tags/{navbar.rb → breadcrumbtrail.rb} +5 -9
  216. data/lib/webgen/plugins/tags/date.rb +2 -6
  217. data/lib/webgen/plugins/tags/download.rb +155 -0
  218. data/lib/webgen/plugins/tags/executecommand.rb +2 -6
  219. data/lib/webgen/plugins/tags/includefile.rb +4 -8
  220. data/lib/webgen/plugins/tags/langbar.rb +2 -6
  221. data/lib/webgen/plugins/tags/menu.rb +2 -7
  222. data/lib/webgen/plugins/tags/meta.rb +2 -6
  223. data/lib/webgen/plugins/tags/relocatable.rb +2 -6
  224. data/lib/webgen/plugins/tags/sitemap.rb +14 -10
  225. data/lib/webgen/plugins/tags/tags.rb +25 -18
  226. data/lib/webgen/plugins/tags/wikilink.rb +2 -6
  227. metadata +311 -195
  228. data/doc/src/design.gallery +0 -18
  229. data/doc/src/designs/curdesign.png +0 -0
  230. data/doc/src/designs/nostyle.png +0 -0
  231. data/doc/src/designs/old.png +0 -0
  232. data/doc/src/documentation/plugins/gallerylayouter/defaultlayouter.page +0 -12
  233. data/doc/src/documentation/plugins/system/index.page +0 -7
  234. data/doc/src/documentation/plugins/tags/navbar.page +0 -20
  235. data/lib/webgen/webgen.rb +0 -271
  236. data/testsite/config.yaml +0 -7
  237. data/testsite/src/bghack.png +0 -0
  238. data/testsite/src/bluecloth.page +0 -102
  239. data/testsite/src/default.css +0 -146
  240. data/testsite/src/default.template +0 -33
  241. data/testsite/src/home.en.page +0 -22
  242. data/testsite/src/home.page +0 -22
  243. data/testsite/src/images/bghack.png +0 -0
  244. data/testsite/src/index.page +0 -21
  245. data/testsite/src/meta.info +0 -12
  246. data/testsite/src/news.page +0 -20
  247. data/testsite/src/news_are_so-cool.de.page +0 -19
  248. data/testsite/src/noindex/noindex.page +0 -20
  249. data/testsite/src/pictures/index.page +0 -20
  250. data/testsite/src/projects.de.page +0 -11
  251. data/testsite/src/projects.es.page +0 -11
  252. data/testsite/src/projects.page +0 -17
  253. data/testsite/src/projects/00.index.de.page +0 -10
  254. data/testsite/src/projects/01.project2.page +0 -20
  255. data/testsite/src/projects/02.project1.page +0 -20
  256. data/testsite/src/projects/05.project3.page +0 -22
  257. data/testsite/src/projects/index.page +0 -20
  258. data/testsite/src/projects/subproj/index.page +0 -22
  259. data/testsite/src/projects/subproj/project3.page +0 -21
  260. data/testsite/src/rdoc.page +0 -12
  261. data/testsite/src/redcloth.page +0 -106
@@ -1,18 +0,0 @@
1
- title: Design Gallery
2
- files: designs/*.png
3
-
4
- mainPage:
5
- menuOrder: 8
6
-
7
- designs/curdesign.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
@@ -1,12 +0,0 @@
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.
@@ -1,7 +0,0 @@
1
- ---
2
- title: System Plugins
3
- directoryName: System Plugins
4
- ---
5
- h2. About
6
-
7
- The system plugins provide core functionality for webgen.
@@ -1,20 +0,0 @@
1
- ---
2
- title: Navigation Bar
3
- inMenu: true
4
- ---
5
- h2. Information
6
-
7
- <notextile>{describe: NavbarTag}</notextile>
8
-
9
- h2. Description
10
-
11
- The navigation bar tag is used to display the hierarchy for the current page. You can see it in
12
- action in the lower left corner of the header.
13
-
14
- h2. Examples
15
-
16
- table{border:1px solid black}.
17
- |_.Command|_.Output|
18
- |\{navbar:}|{navbar:}|
19
- |<notextile>\{navbar: {separator: " HALLO "}}</notextile>|<notextile>{navbar: {separator: " HALLO "}}</notextile>|
20
-
@@ -1,271 +0,0 @@
1
- #
2
- #--
3
- #
4
- # $Id: webgen.rb 334 2005-08-23 19:11:53Z thomas $
5
- #
6
- # webgen: template based static website generator
7
- # Copyright (C) 2004 Thomas Leitner
8
- #
9
- # This program is free software; you can redistribute it and/or modify it under the terms of the GNU
10
- # General Public License as published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
12
- #
13
- # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
14
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- # General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU General Public License along with this program; if not,
18
- # write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- #
20
- #++
21
- #
22
-
23
- require 'optparse'
24
- require 'rbconfig'
25
- require 'fileutils'
26
- require 'cmdparse'
27
- require 'webgen/plugin'
28
-
29
- module Webgen
30
-
31
- class Color
32
-
33
- @@colors = {:bold => [0, 1], :green => [0, 32], :lblue => [1, 34], :lred => [1, 31], :reset => [0, 0]}
34
-
35
- def Color.colorify
36
- @@colors.each do |color, values|
37
- module_eval <<-EOF
38
- def Color.#{color.to_s}
39
- "\e[#{values[0]};#{values[1]}m"
40
- end
41
- EOF
42
- end
43
- end
44
-
45
- def Color.method_missing( id )
46
- ''
47
- end
48
-
49
- end
50
-
51
-
52
- class RunWebgenCommand < CommandParser::Command
53
-
54
- def initialize; super( 'run' ); end
55
-
56
- def description; "Runs webgen. This command is used as default command when no command was issued."; end
57
-
58
- def usage; "Usage: #{@options.program_name} [global options] run"; end
59
-
60
- def execute( commandParser, args )
61
- logger.info "Starting Webgen..."
62
-
63
- # load all the files in src dir and build tree
64
- tree = Plugin['FileHandler'].build_tree
65
-
66
- # execute tree transformer plugins
67
- Plugin['TreeWalker'].execute( tree ) unless tree.nil?
68
-
69
- # generate output files
70
- Plugin['FileHandler'].write_tree( tree ) unless tree.nil?
71
-
72
- logger.info "Webgen finished"
73
- end
74
- end
75
-
76
-
77
- class ShowCommand < CommandParser::Command
78
-
79
- def initialize; super( 'show' ); end
80
-
81
- def description; "Shows all available plugins or their configuration items."; end
82
-
83
- def usage; "Usage: #{@options.program_name} [global options] show plugins|config"; end
84
-
85
- def execute( commandParser, args )
86
- case args[0]
87
- when 'plugins' then showPlugins
88
- when 'config' then showConfiguration
89
- else puts "You have to specify either 'plugins' or 'config'"
90
- end
91
- exit
92
- end
93
-
94
- private
95
-
96
- def showPlugins
97
- print "List of loaded plugins:\n"
98
-
99
- headers = Hash.new {|h,k| h[k] = (k.nil? ? "Other Plugins" : k.gsub(/([A-Z][a-z])/, ' \1').strip) }
100
-
101
- ljustlength = 30 + Color.green.length + Color.reset.length
102
- header = ''
103
- Plugin.config.sort { |a, b| a[0].name <=> b[0].name }.each do |klass, data|
104
- newHeader = headers[klass.name[/^.*?(?=::)/]]
105
- unless newHeader == header
106
- print "\n #{Color.bold}#{newHeader}#{Color.reset}:\n";
107
- header = newHeader
108
- end
109
- print " - #{Color.green}#{data.plugin}#{Color.reset}:".ljust(ljustlength) +"#{data.summary}\n"
110
- end
111
- end
112
-
113
- def showConfiguration
114
- print "List of configuration parameters:\n\n"
115
- ljustlength = 20 + Color.green.length + Color.reset.length
116
- Plugin.config.sort { |a, b| a[0].name <=> b[0].name }.each do |klass, data|
117
- next if data.params.nil?
118
- print " #{Color.bold}#{data.plugin}#{Color.reset}:\n"
119
- data.params.sort.each do |key, item|
120
- print " #{Color.green}Parameter:#{Color.reset}".ljust(ljustlength)
121
- puts Color.lred + item.name + Color.reset + " = " + Color.lblue + item.value.inspect + Color.reset + " (" + item.default.inspect + ")"
122
- puts " #{Color.green}Description:#{Color.reset}".ljust(ljustlength) + item.description
123
- print "\n"
124
- end
125
- print "\n"
126
- end
127
- end
128
-
129
- end
130
-
131
-
132
- class CreateCommand < CommandParser::Command
133
-
134
- def initialize; super( 'create' ); end
135
-
136
- def description;
137
- "Creates the basic directories and files for webgen. This includes the source and output directories, " \
138
- "the log and the plugin directory. Also, a basic template plus a CSS and an index file are created."
139
- end
140
-
141
- def usage; "Usage: #{@options.program_name} [global options] create DIR"; end
142
-
143
- def execute( commandParser, args )
144
- if args.length == 0
145
- raise OptionParser::MissingArgument.new( 'DIR' )
146
- else
147
- FileUtils.cp_r( File.join( Webgen::Configuration.data_dir, 'example' ), args[0] )
148
- end
149
- end
150
-
151
- end
152
-
153
-
154
- class CleanCommand < CommandParser::Command
155
-
156
- module ::FileUtils
157
-
158
- def fu_output_message( msg )
159
- logger.info { msg }
160
- end
161
-
162
- def ask_before_delete( ask, func, list, options = {} )
163
- newlist = [*list].collect {|e| "'" + e + "'"}.join(', ')
164
- if ask
165
- print "Really delete #{newlist}? "
166
- return unless /y|Y/ =~ gets.strip
167
- end
168
- self.send( func, list, options.merge( :verbose => true ) )
169
- end
170
-
171
- end
172
-
173
- class CleanWalker < Webgen::Plugin
174
-
175
- summary "Deletes the output file for each node."
176
- depends_on 'TreeWalker'
177
-
178
- attr_writer :ask
179
-
180
- def handle_node( node, level )
181
- file = node.recursive_value( 'dest' )
182
- return if !File.exists?( file ) || node['int:virtualNode']
183
- if File.directory?( file )
184
- begin
185
- FileUtils.ask_before_delete( @ask, :rmdir, file )
186
- rescue Errno::ENOTEMPTY => e
187
- logger.info "Cannot delete directory #{file}, as it is not empty!"
188
- end
189
- else
190
- FileUtils.ask_before_delete( @ask, :rm, file, :force => true )
191
- end
192
- end
193
-
194
- end
195
-
196
- def initialize;
197
- super( 'clean' )
198
- @all = false
199
- @ask = false
200
- options.separator( "Options" )
201
- options.on( '--all', '-a', "Removes ALL files from the output directory" ) { @all = true }
202
- options.on( '--interactive', '-i', "Ask for each file" ) { @ask = true }
203
- end
204
-
205
- def description; "Removes the generated or all files from the output directory"; end
206
-
207
- def usage; "Usage: #{@options.program_name} [global options] clean [options]"; end
208
-
209
- def execute( commandParser, args )
210
- if @all
211
- logger.info( "Deleting all files from output directory..." )
212
- outDir = Plugin['Configuration']['outDirectory']
213
- FileUtils.ask_before_delete( @ask, :rm_rf, outDir ) if File.exists?( outDir )
214
- else
215
- tree = Plugin['FileHandler'].build_tree
216
- logger.info( "Deleting generated files from output directory..." )
217
- Plugin['CleanWalker'].ask = @ask
218
- Plugin['TreeWalker'].execute( tree, Plugin['CleanWalker'], :backward )
219
- end
220
- logger.info( "Webgen finished 'clean' command" )
221
- end
222
-
223
- private
224
-
225
- end
226
-
227
- class WebgenCommandParser < CommandParser
228
-
229
- def initialize
230
- super( true )
231
- self.options do |opts|
232
- opts.program_name = "webgen"
233
- opts.version = Webgen::VERSION
234
- opts.summary_width = 25
235
- opts.summary_indent = ' '
236
-
237
- opts.banner = "Usage: webgen [global options] COMMAND [command options]\n#{Webgen::SUMMARY}"
238
-
239
- opts.separator ""
240
- opts.separator "Global options:"
241
-
242
- opts.on( "--verbosity LEVEL", "-V", Integer, "The verbosity level" ) { |verbosity| Plugin.set_param( 'Logging', 'verbosityLevel', verbosity ) }
243
- opts.on( "--[no-]logfile", "-L", "Log to file" ) { |logfile| Plugin.set_param( 'Logging', 'logToFile', logfile ) }
244
-
245
- opts.separator ""
246
- end
247
-
248
- self.add_command( RunWebgenCommand.new, true )
249
- self.add_command( ShowCommand.new )
250
- self.add_command( CreateCommand.new )
251
- self.add_command( CleanCommand.new )
252
- self.add_command( CommandParser::HelpCommand.new )
253
- self.add_command( CommandParser::VersionCommand.new )
254
- end
255
-
256
- end
257
-
258
-
259
- class WebgenMain
260
-
261
- def main( cmdOptions )
262
- Color.colorify if $stdout.isatty && !Config::CONFIG['arch'].include?( 'mswin32' )
263
- wcp = WebgenCommandParser.new
264
- wcp.parse!( ARGV, false )
265
- Plugin['Configuration'].init_all
266
- wcp.execute
267
- end
268
-
269
- end
270
-
271
- end
@@ -1,7 +0,0 @@
1
- Configuration:
2
- srcDirectory: src
3
- outDirectory: output
4
- verbosityLevel: 2
5
-
6
- FileCopyHandler:
7
- types: [css, jpg, png]
Binary file
@@ -1,102 +0,0 @@
1
- ---
2
- blocks:
3
- - {name: content, format: markdown}
4
- ---
5
- BlueCloth
6
- =========
7
-
8
- Version 0.0.4b - 2004/06/01
9
-
10
- Original version by John Gruber <http://daringfireball.net/>.
11
- Ruby port by Michael Granger <http://www.deveiate.org/>.
12
-
13
- BlueCloth is a Ruby implementation of [Markdown][1], a text-to-HTML conversion
14
- tool for web writers. To quote from the project page: Markdown allows you to
15
- write using an easy-to-read, easy-to-write plain text format, then convert it to
16
- structurally valid XHTML (or HTML).
17
-
18
- It borrows a naming convention and several helpings of interface from
19
- [Redcloth][2], [Why the Lucky Stiff][3]'s processor for a similar text-to-HTML
20
- conversion syntax called [Textile][4].
21
-
22
-
23
- Installation
24
- ------------
25
-
26
- You can install this module either by running the included `install.rb` script,
27
- or by simply copying `lib/bluecloth.rb` to a directory in your load path.
28
-
29
-
30
- Dependencies
31
- ------------
32
-
33
- BlueCloth uses the `StringScanner` class from the `strscan` library, which comes
34
- with Ruby 1.8.x and later or may be downloaded from the RAA for earlier
35
- versions, and the `logger` library, which is also included in 1.8.x and later.
36
-
37
-
38
- Example Usage
39
- -------------
40
-
41
- The BlueCloth class is a subclass of Ruby's String, and can be used thusly:
42
-
43
- bc = BlueCloth::new( str )
44
- puts bc.to_html
45
-
46
- This `README` file is an example of Markdown syntax. The sample program
47
- `bluecloth` in the `bin/` directory can be used to convert this (or any other)
48
- file with Markdown syntax into HTML:
49
-
50
- $ bin/bluecloth README > README.html
51
-
52
-
53
- Acknowledgements
54
- ----------------
55
-
56
- This library is a port of the canonical Perl one, and so owes most of its
57
- functionality to its author, John Gruber. The bugs in this code are most
58
- certainly an artifact of my porting it and not an artifact of the excellent code
59
- from which it is derived.
60
-
61
- It also, as mentioned before, borrows its API liberally from RedCloth, both for
62
- compatibility's sake, and because I think Why's code is beautiful. His excellent
63
- code and peerless prose have been an inspiration to me, and this module is
64
- intended as the sincerest flattery.
65
-
66
- Also contributing to any success this module may enjoy are those among my peers
67
- who have taken the time to help out, either by submitting patches, testing, or
68
- offering suggestions and review:
69
-
70
- * Martin Chase <stillflame@FaerieMUD.org>
71
- * Florian Gross <flgr@ccan.de>
72
-
73
-
74
- Author/Legal
75
- ------------
76
-
77
- Original version:
78
- Copyright (c) 2003-2004 John Gruber
79
- <http://daringfireball.net/>
80
- All rights reserved.
81
-
82
- Ruby version:
83
- Copyright (c) 2004 The FaerieMUD Consortium
84
-
85
- BlueCloth is free software; you can redistribute it and/or modify it under the
86
- terms of the GNU General Public License as published by the Free Software
87
- Foundation; either version 2 of the License, or (at your option) any later
88
- version.
89
-
90
- BlueCloth is distributed in the hope that it will be useful, but WITHOUT ANY
91
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
92
- PARTICULAR PURPOSE. See the GNU General Public License for more details.
93
-
94
-
95
- [1]: http://daringfireball.net/projects/markdown/
96
- [2]: http://www.whytheluckystiff.net/ruby/redcloth/
97
- [3]: http://www.whytheluckystiff.net/
98
- [4]: http://www.textism.com/tools/textile/
99
-
100
-
101
- $Id: README 51 2004-06-21 15:20:59Z deveiant $
102
- $URL: svn+ssh://cvs.faeriemud.org/var/svn/BlueCloth/trunk/README $