webgen 0.4.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +5 -0
- data/COPYING +8 -338
- data/GPL +340 -0
- data/Rakefile +188 -445
- data/THANKS +7 -22
- data/VERSION +1 -1
- data/bin/webgen +6 -1
- data/data/webgen/resources.yaml +3 -0
- data/data/webgen/website_skeleton/README +10 -0
- data/data/webgen/website_skeleton/Rakefile +40 -0
- data/data/webgen/website_skeleton/config.yaml +17 -0
- data/data/webgen/website_styles/1024px/{default.css → src/default.css} +0 -0
- data/data/webgen/website_styles/1024px/{default.template → src/default.template} +3 -5
- data/data/webgen/website_styles/1024px/{images → src/images}/background.gif +0 -0
- data/data/webgen/website_styles/andreas00/{default.css → src/default.css} +0 -0
- data/{doc/examples → data/webgen}/website_styles/andreas00/src/default.template +3 -5
- data/data/webgen/website_styles/andreas00/{images → src/images}/bg.gif +0 -0
- data/data/webgen/website_styles/andreas00/{images → src/images}/front.jpg +0 -0
- data/data/webgen/website_styles/andreas00/{images → src/images}/menubg.gif +0 -0
- data/data/webgen/website_styles/andreas00/{images → src/images}/menubg2.gif +0 -0
- data/data/webgen/website_styles/andreas01/{default.css → src/default.css} +0 -0
- data/{doc/examples → data/webgen}/website_styles/andreas01/src/default.template +3 -5
- data/data/webgen/website_styles/andreas01/{images → src/images}/bg.gif +0 -0
- data/data/webgen/website_styles/andreas01/{images → src/images}/front.jpg +0 -0
- data/data/webgen/website_styles/andreas01/{print.css → src/print.css} +0 -0
- data/data/webgen/website_styles/andreas03/{default.css → src/default.css} +0 -0
- data/data/webgen/website_styles/andreas03/{default.template → src/default.template} +2 -4
- data/data/webgen/website_styles/andreas03/{images → src/images}/bodybg.png +0 -0
- data/data/webgen/website_styles/andreas03/{images → src/images}/contbg.png +0 -0
- data/data/webgen/website_styles/andreas03/{images → src/images}/footerbg.png +0 -0
- data/data/webgen/website_styles/andreas03/{images → src/images}/gradient1.png +0 -0
- data/data/webgen/website_styles/andreas03/{images → src/images}/gradient2.png +0 -0
- data/data/webgen/website_styles/andreas04/{default.css → src/default.css} +0 -0
- data/data/webgen/website_styles/andreas04/{default.template → src/default.template} +2 -4
- data/data/webgen/website_styles/andreas04/{images → src/images}/blinkarrow.gif +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/bodybg.png +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/contentbg.png +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/entrybg.png +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/flash.gif +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/flash2.gif +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/globe.gif +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/globebottom.gif +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/linkarrow.gif +0 -0
- data/data/webgen/website_styles/andreas04/{images → src/images}/menuhover.png +0 -0
- data/data/webgen/website_styles/andreas05/{default.css → src/default.css} +0 -0
- data/data/webgen/website_styles/andreas05/{default.template → src/default.template} +2 -4
- data/data/webgen/website_styles/andreas05/{images → src/images}/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas05/{images → src/images}/front.png +0 -0
- data/data/webgen/website_styles/andreas06/{default.css → src/default.css} +0 -0
- data/{doc/examples → data/webgen}/website_styles/andreas06/src/default.template +4 -6
- data/data/webgen/website_styles/andreas06/{images → src/images}/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas06/{images → src/images}/boxbg.gif +0 -0
- data/data/webgen/website_styles/andreas06/{images → src/images}/greypx.gif +0 -0
- data/data/webgen/website_styles/andreas06/{images → src/images}/header.jpg +0 -0
- data/data/webgen/website_styles/andreas06/{images → src/images}/innerbg.gif +0 -0
- data/data/webgen/website_styles/andreas06/{images → src/images}/leaves.jpg +0 -0
- data/data/webgen/website_styles/andreas06/{images → src/images}/tabs.gif +0 -0
- data/data/webgen/website_styles/andreas07/{browserfix.css → src/browserfix.css} +0 -0
- data/data/webgen/website_styles/andreas07/{default.css → src/default.css} +0 -0
- data/{doc/examples → data/webgen}/website_styles/andreas07/src/default.template +2 -4
- data/data/webgen/website_styles/andreas07/{images → src/images}/bodybg.gif +0 -0
- data/data/webgen/website_styles/andreas07/{images → src/images}/sidebarbg.gif +0 -0
- data/data/webgen/website_styles/andreas08/{default.css → src/default.css} +0 -0
- data/{doc/examples → data/webgen}/website_styles/andreas08/src/default.template +3 -5
- data/data/webgen/website_styles/andreas09/{default.css → src/default.css} +0 -0
- data/data/webgen/website_styles/andreas09/{default.template → src/default.template} +4 -6
- data/data/webgen/website_styles/andreas09/{images → src/images}/bodybg-black.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/bodybg-green.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/bodybg-orange.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/bodybg-purple.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/bodybg-red.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/bodybg.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/footerbg.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/menuhover-black.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/menuhover-green.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/menuhover-orange.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/menuhover-purple.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/menuhover-red.jpg +0 -0
- data/data/webgen/website_styles/andreas09/{images → src/images}/menuhover.jpg +0 -0
- data/data/webgen/website_styles/{default → simple}/README +0 -0
- data/data/webgen/website_styles/{default → simple/src}/default.css +0 -0
- data/{doc/examples/website_styles/default → data/webgen/website_styles/simple}/src/default.template +3 -5
- data/data/webgen/website_templates/default/README +0 -2
- data/data/webgen/website_templates/default/src/index.page +3 -3
- data/data/webgen/website_templates/project/README +0 -4
- data/data/webgen/website_templates/project/src/about.page +5 -5
- data/data/webgen/website_templates/project/src/download.page +3 -3
- data/data/webgen/website_templates/project/src/features.page +3 -3
- data/data/webgen/website_templates/project/src/index.page +4 -4
- data/data/webgen/website_templates/project/src/screenshots.page +5 -5
- data/doc/contentprocessor/erb.page +38 -0
- data/doc/contentprocessor/tags.page +61 -0
- data/doc/extensions.page +11 -0
- data/doc/faq.page +177 -0
- data/doc/getting_started.page +130 -0
- data/doc/index.page +50 -0
- data/doc/manual.page +356 -0
- data/doc/reference_configuration.page +328 -0
- data/doc/reference_metainfo.page +128 -0
- data/doc/sourcehandler/metainfo.page +117 -0
- data/doc/sourcehandler/page.page +32 -0
- data/doc/webgen_page_format.page +126 -0
- data/lib/webgen/blackboard.rb +73 -0
- data/lib/webgen/cache.rb +77 -0
- data/lib/webgen/cli.rb +99 -440
- data/lib/webgen/cli/create_command.rb +64 -0
- data/lib/webgen/cli/run_command.rb +20 -0
- data/lib/webgen/cli/utils.rb +82 -0
- data/lib/webgen/configuration.rb +71 -0
- data/lib/webgen/contentprocessor.rb +89 -0
- data/lib/webgen/contentprocessor/blocks.rb +46 -0
- data/lib/webgen/contentprocessor/context.rb +86 -0
- data/lib/webgen/contentprocessor/maruku.rb +18 -0
- data/lib/webgen/contentprocessor/redcloth.rb +15 -0
- data/lib/webgen/contentprocessor/tags.rb +134 -0
- data/lib/webgen/default_config.rb +128 -0
- data/lib/webgen/languages.rb +508 -40
- data/lib/webgen/loggable.rb +23 -0
- data/lib/webgen/logger.rb +78 -0
- data/lib/webgen/node.rb +275 -237
- data/lib/webgen/output.rb +31 -0
- data/lib/webgen/output/filesystem.rb +61 -0
- data/lib/webgen/page.rb +129 -0
- data/lib/webgen/path.rb +172 -0
- data/lib/webgen/source.rb +24 -0
- data/lib/webgen/source/filesystem.rb +56 -0
- data/lib/webgen/source/resource.rb +33 -0
- data/lib/webgen/source/stacked.rb +53 -0
- data/lib/webgen/sourcehandler.rb +175 -0
- data/lib/webgen/sourcehandler/base.rb +188 -0
- data/lib/webgen/sourcehandler/copy.rb +41 -0
- data/lib/webgen/sourcehandler/directory.rb +31 -0
- data/lib/webgen/sourcehandler/fragment.rb +66 -0
- data/lib/webgen/sourcehandler/metainfo.rb +107 -0
- data/lib/webgen/sourcehandler/page.rb +47 -0
- data/lib/webgen/sourcehandler/template.rb +64 -0
- data/lib/webgen/sourcehandler/virtual.rb +72 -0
- data/lib/webgen/tag.rb +16 -0
- data/lib/webgen/tag/base.rb +162 -0
- data/lib/webgen/tag/menu.rb +187 -0
- data/lib/webgen/tag/metainfo.rb +25 -0
- data/lib/webgen/tag/relocatable.rb +53 -0
- data/lib/webgen/tree.rb +80 -0
- data/lib/webgen/version.rb +6 -0
- data/lib/webgen/webgentask.rb +153 -0
- data/lib/webgen/website.rb +166 -288
- data/lib/webgen/websiteaccess.rb +29 -0
- data/lib/webgen/websitemanager.rb +124 -0
- data/man/man1/webgen.1 +31 -42
- data/misc/default.css +337 -0
- data/misc/default.template +73 -0
- data/misc/htmldoc.metainfo +22 -0
- data/misc/htmldoc.virtual +5 -0
- data/misc/images/arrow.gif +0 -0
- data/misc/images/error.gif +0 -0
- data/misc/images/exclamation.gif +0 -0
- data/misc/images/headerbg.jpg +0 -0
- data/misc/images/information.gif +0 -0
- data/misc/images/quote.gif +0 -0
- data/test/helper.rb +28 -0
- data/test/test_blackboard.rb +58 -0
- data/test/test_cache.rb +57 -0
- data/test/test_configuration.rb +35 -0
- data/test/test_contentprocessor.rb +31 -0
- data/test/test_contentprocessor_blocks.rb +34 -0
- data/test/test_contentprocessor_context.rb +38 -0
- data/test/test_contentprocessor_maruku.rb +24 -0
- data/test/test_contentprocessor_redcloth.rb +12 -0
- data/test/test_contentprocessor_tags.rb +97 -0
- data/test/test_languages.rb +53 -0
- data/test/test_loggable.rb +30 -0
- data/test/test_logger.rb +73 -0
- data/test/test_node.rb +305 -0
- data/test/test_output_filesystem.rb +57 -0
- data/test/test_page.rb +180 -0
- data/test/test_path.rb +112 -0
- data/test/test_source_filesystem.rb +59 -0
- data/test/test_source_resource.rb +21 -0
- data/test/test_source_stacked.rb +34 -0
- data/test/test_sourcehandler_base.rb +78 -0
- data/test/test_sourcehandler_copy.rb +45 -0
- data/test/test_sourcehandler_directory.rb +25 -0
- data/test/test_sourcehandler_fragment.rb +62 -0
- data/test/test_sourcehandler_metainfo.rb +79 -0
- data/test/test_sourcehandler_page.rb +62 -0
- data/test/test_sourcehandler_template.rb +61 -0
- data/test/test_sourcehandler_virtual.rb +46 -0
- data/test/test_tag_base.rb +82 -0
- data/test/test_tag_menu.rb +196 -0
- data/test/test_tag_metainfo.rb +17 -0
- data/test/test_tag_relocatable.rb +57 -0
- data/test/test_tree.rb +69 -0
- data/test/test_website.rb +96 -0
- data/test/test_websiteaccess.rb +23 -0
- data/test/test_websitemanager.rb +68 -0
- metadata +276 -800
- data/ChangeLog +0 -46
- data/README +0 -14
- data/TODO +0 -376
- data/data/webgen/data/ISO-639-2_values_8bits.txt +0 -492
- data/data/webgen/gallery-creator/default.png +0 -0
- data/data/webgen/gallery_styles/default/README +0 -6
- data/data/webgen/gallery_styles/default/gallery_gallery.template +0 -38
- data/data/webgen/gallery_styles/default/gallery_image.template +0 -30
- data/data/webgen/gallery_styles/default/gallery_main.template +0 -18
- data/data/webgen/gallery_styles/slides/README +0 -18
- data/data/webgen/gallery_styles/slides/collage.rb +0 -337
- data/data/webgen/gallery_styles/slides/gallery_gallery.template +0 -62
- data/data/webgen/gallery_styles/slides/gallery_image.template +0 -53
- data/data/webgen/gallery_styles/slides/gallery_main.template +0 -32
- data/data/webgen/icon_mapping.yaml +0 -27
- data/data/webgen/resources/emoticons/bigeyes/angry.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/cool.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/cry.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/drunk.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/lol.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/oops.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/sad.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/sleep.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/smile.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/tongue.png +0 -0
- data/data/webgen/resources/emoticons/bigeyes/wink.png +0 -0
- data/data/webgen/resources/emoticons/crystal/angry.png +0 -0
- data/data/webgen/resources/emoticons/crystal/cool.png +0 -0
- data/data/webgen/resources/emoticons/crystal/cry.png +0 -0
- data/data/webgen/resources/emoticons/crystal/drunk.png +0 -0
- data/data/webgen/resources/emoticons/crystal/lol.png +0 -0
- data/data/webgen/resources/emoticons/crystal/oops.png +0 -0
- data/data/webgen/resources/emoticons/crystal/sad.png +0 -0
- data/data/webgen/resources/emoticons/crystal/sleep.png +0 -0
- data/data/webgen/resources/emoticons/crystal/smile.png +0 -0
- data/data/webgen/resources/emoticons/crystal/tongue.png +0 -0
- data/data/webgen/resources/emoticons/crystal/wink.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/angry.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/cool.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/cry.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/drunk.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/lol.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/oops.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/sad.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/sleep.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/smile.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/tongue.png +0 -0
- data/data/webgen/resources/emoticons/cyclops/wink.png +0 -0
- data/data/webgen/resources/emoticons/glass/angry.png +0 -0
- data/data/webgen/resources/emoticons/glass/cool.png +0 -0
- data/data/webgen/resources/emoticons/glass/cry.png +0 -0
- data/data/webgen/resources/emoticons/glass/drunk.png +0 -0
- data/data/webgen/resources/emoticons/glass/lol.png +0 -0
- data/data/webgen/resources/emoticons/glass/oops.png +0 -0
- data/data/webgen/resources/emoticons/glass/sad.png +0 -0
- data/data/webgen/resources/emoticons/glass/sleep.png +0 -0
- data/data/webgen/resources/emoticons/glass/smile.png +0 -0
- data/data/webgen/resources/emoticons/glass/tongue.png +0 -0
- data/data/webgen/resources/emoticons/glass/wink.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/angry.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/cool.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/cry.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/drunk.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/lol.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/oops.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/sad.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/sleep.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/smile.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/tongue.png +0 -0
- data/data/webgen/resources/emoticons/icqstyle/wink.png +0 -0
- data/data/webgen/resources/emoticons/matrix/angry.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/cool.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/cry.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/drunk.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/lol.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/oops.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/sad.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/sleep.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/smile.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/tongue.gif +0 -0
- data/data/webgen/resources/emoticons/matrix/wink.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/angry.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/cool.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/cry.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/drunk.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/lol.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/oops.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/sad.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/sleep.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/smile.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/tongue.gif +0 -0
- data/data/webgen/resources/emoticons/smellies/wink.gif +0 -0
- data/data/webgen/resources/icons/compressed.png +0 -0
- data/data/webgen/resources/icons/document.png +0 -0
- data/data/webgen/resources/icons/download.png +0 -0
- data/data/webgen/resources/icons/image.png +0 -0
- data/data/webgen/resources/icons/linux.png +0 -0
- data/data/webgen/resources/icons/mac.png +0 -0
- data/data/webgen/resources/icons/pdf.png +0 -0
- data/data/webgen/resources/icons/penguin.png +0 -0
- data/data/webgen/resources/icons/quicktime.png +0 -0
- data/data/webgen/resources/icons/real.png +0 -0
- data/data/webgen/resources/icons/rpm.png +0 -0
- data/data/webgen/resources/icons/sound.png +0 -0
- data/data/webgen/resources/icons/source.png +0 -0
- data/data/webgen/resources/icons/spreadsheet.png +0 -0
- data/data/webgen/resources/icons/text.png +0 -0
- data/data/webgen/resources/icons/vcard.png +0 -0
- data/data/webgen/resources/icons/video.png +0 -0
- data/data/webgen/resources/icons/win.png +0 -0
- data/data/webgen/resources/images/generated_by_webgen.png +0 -0
- data/data/webgen/resources/images/valid-css.gif +0 -0
- data/data/webgen/resources/images/valid-xhtml11.png +0 -0
- data/data/webgen/resources/images/webgen_logo.png +0 -0
- data/data/webgen/sipttra_styles/default/README +0 -7
- data/data/webgen/sipttra_styles/default/css/sipttra.rcss +0 -71
- data/data/webgen/sipttra_styles/default/js/sipttra.js +0 -7
- data/data/webgen/sipttra_styles/default/sipttra.template +0 -105
- data/data/webgen/website_styles/andreas00/default.template +0 -62
- data/data/webgen/website_styles/andreas01/default.template +0 -63
- data/data/webgen/website_styles/andreas06/default.template +0 -72
- data/data/webgen/website_styles/andreas07/default.template +0 -44
- data/data/webgen/website_styles/andreas08/default.template +0 -53
- data/data/webgen/website_styles/default/default.template +0 -38
- data/data/webgen/website_templates/personal_hp/README +0 -8
- data/data/webgen/website_templates/personal_hp/src/about.page +0 -12
- data/data/webgen/website_templates/personal_hp/src/index.page +0 -9
- data/data/webgen/website_templates/personal_hp/src/links.page +0 -22
- data/data/webgen/website_templates/personal_hp/src/projects.page +0 -20
- data/doc/config.yaml +0 -8
- data/doc/examples/website_styles/1024px/README +0 -9
- data/doc/examples/website_styles/1024px/config.yaml +0 -2
- data/doc/examples/website_styles/1024px/src/about.page +0 -12
- data/doc/examples/website_styles/1024px/src/default.css +0 -188
- data/doc/examples/website_styles/1024px/src/default.template +0 -62
- data/doc/examples/website_styles/1024px/src/download.page +0 -15
- data/doc/examples/website_styles/1024px/src/features.page +0 -8
- data/doc/examples/website_styles/1024px/src/images/background.gif +0 -0
- data/doc/examples/website_styles/1024px/src/index.page +0 -9
- data/doc/examples/website_styles/1024px/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas00/README +0 -9
- data/doc/examples/website_styles/andreas00/config.yaml +0 -2
- data/doc/examples/website_styles/andreas00/src/about.page +0 -12
- data/doc/examples/website_styles/andreas00/src/default.css +0 -290
- data/doc/examples/website_styles/andreas00/src/download.page +0 -15
- data/doc/examples/website_styles/andreas00/src/features.page +0 -8
- data/doc/examples/website_styles/andreas00/src/images/bg.gif +0 -0
- data/doc/examples/website_styles/andreas00/src/images/front.jpg +0 -0
- data/doc/examples/website_styles/andreas00/src/images/menubg.gif +0 -0
- data/doc/examples/website_styles/andreas00/src/images/menubg2.gif +0 -0
- data/doc/examples/website_styles/andreas00/src/index.page +0 -9
- data/doc/examples/website_styles/andreas00/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas01/README +0 -9
- data/doc/examples/website_styles/andreas01/config.yaml +0 -2
- data/doc/examples/website_styles/andreas01/src/about.page +0 -12
- data/doc/examples/website_styles/andreas01/src/default.css +0 -310
- data/doc/examples/website_styles/andreas01/src/download.page +0 -15
- data/doc/examples/website_styles/andreas01/src/features.page +0 -8
- data/doc/examples/website_styles/andreas01/src/images/bg.gif +0 -0
- data/doc/examples/website_styles/andreas01/src/images/front.jpg +0 -0
- data/doc/examples/website_styles/andreas01/src/index.page +0 -9
- data/doc/examples/website_styles/andreas01/src/print.css +0 -35
- data/doc/examples/website_styles/andreas01/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas03/README +0 -9
- data/doc/examples/website_styles/andreas03/config.yaml +0 -2
- data/doc/examples/website_styles/andreas03/src/about.page +0 -12
- data/doc/examples/website_styles/andreas03/src/default.css +0 -223
- data/doc/examples/website_styles/andreas03/src/default.template +0 -60
- data/doc/examples/website_styles/andreas03/src/download.page +0 -15
- data/doc/examples/website_styles/andreas03/src/features.page +0 -8
- data/doc/examples/website_styles/andreas03/src/images/bodybg.png +0 -0
- data/doc/examples/website_styles/andreas03/src/images/contbg.png +0 -0
- data/doc/examples/website_styles/andreas03/src/images/footerbg.png +0 -0
- data/doc/examples/website_styles/andreas03/src/images/gradient1.png +0 -0
- data/doc/examples/website_styles/andreas03/src/images/gradient2.png +0 -0
- data/doc/examples/website_styles/andreas03/src/index.page +0 -9
- data/doc/examples/website_styles/andreas03/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas04/README +0 -9
- data/doc/examples/website_styles/andreas04/config.yaml +0 -2
- data/doc/examples/website_styles/andreas04/src/about.page +0 -12
- data/doc/examples/website_styles/andreas04/src/default.css +0 -290
- data/doc/examples/website_styles/andreas04/src/default.template +0 -83
- data/doc/examples/website_styles/andreas04/src/download.page +0 -15
- data/doc/examples/website_styles/andreas04/src/features.page +0 -8
- data/doc/examples/website_styles/andreas04/src/images/blinkarrow.gif +0 -0
- data/doc/examples/website_styles/andreas04/src/images/bodybg.png +0 -0
- data/doc/examples/website_styles/andreas04/src/images/contentbg.png +0 -0
- data/doc/examples/website_styles/andreas04/src/images/entrybg.png +0 -0
- data/doc/examples/website_styles/andreas04/src/images/flash.gif +0 -0
- data/doc/examples/website_styles/andreas04/src/images/flash2.gif +0 -0
- data/doc/examples/website_styles/andreas04/src/images/globe.gif +0 -0
- data/doc/examples/website_styles/andreas04/src/images/globebottom.gif +0 -0
- data/doc/examples/website_styles/andreas04/src/images/linkarrow.gif +0 -0
- data/doc/examples/website_styles/andreas04/src/images/menuhover.png +0 -0
- data/doc/examples/website_styles/andreas04/src/index.page +0 -9
- data/doc/examples/website_styles/andreas04/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas05/README +0 -9
- data/doc/examples/website_styles/andreas05/config.yaml +0 -2
- data/doc/examples/website_styles/andreas05/src/about.page +0 -12
- data/doc/examples/website_styles/andreas05/src/default.css +0 -33
- data/doc/examples/website_styles/andreas05/src/default.template +0 -42
- data/doc/examples/website_styles/andreas05/src/download.page +0 -15
- data/doc/examples/website_styles/andreas05/src/features.page +0 -8
- data/doc/examples/website_styles/andreas05/src/images/bodybg.gif +0 -0
- data/doc/examples/website_styles/andreas05/src/images/front.png +0 -0
- data/doc/examples/website_styles/andreas05/src/index.page +0 -9
- data/doc/examples/website_styles/andreas05/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas06/README +0 -9
- data/doc/examples/website_styles/andreas06/config.yaml +0 -2
- data/doc/examples/website_styles/andreas06/src/about.page +0 -12
- data/doc/examples/website_styles/andreas06/src/default.css +0 -354
- data/doc/examples/website_styles/andreas06/src/download.page +0 -15
- data/doc/examples/website_styles/andreas06/src/features.page +0 -8
- data/doc/examples/website_styles/andreas06/src/images/bodybg.gif +0 -0
- data/doc/examples/website_styles/andreas06/src/images/boxbg.gif +0 -0
- data/doc/examples/website_styles/andreas06/src/images/greypx.gif +0 -0
- data/doc/examples/website_styles/andreas06/src/images/header.jpg +0 -0
- data/doc/examples/website_styles/andreas06/src/images/innerbg.gif +0 -0
- data/doc/examples/website_styles/andreas06/src/images/leaves.jpg +0 -0
- data/doc/examples/website_styles/andreas06/src/images/tabs.gif +0 -0
- data/doc/examples/website_styles/andreas06/src/index.page +0 -9
- data/doc/examples/website_styles/andreas06/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas07/README +0 -9
- data/doc/examples/website_styles/andreas07/config.yaml +0 -2
- data/doc/examples/website_styles/andreas07/src/about.page +0 -12
- data/doc/examples/website_styles/andreas07/src/browserfix.css +0 -7
- data/doc/examples/website_styles/andreas07/src/default.css +0 -92
- data/doc/examples/website_styles/andreas07/src/download.page +0 -15
- data/doc/examples/website_styles/andreas07/src/features.page +0 -8
- data/doc/examples/website_styles/andreas07/src/images/bodybg.gif +0 -0
- data/doc/examples/website_styles/andreas07/src/images/sidebarbg.gif +0 -0
- data/doc/examples/website_styles/andreas07/src/index.page +0 -9
- data/doc/examples/website_styles/andreas07/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas08/README +0 -9
- data/doc/examples/website_styles/andreas08/config.yaml +0 -2
- data/doc/examples/website_styles/andreas08/src/about.page +0 -12
- data/doc/examples/website_styles/andreas08/src/default.css +0 -224
- data/doc/examples/website_styles/andreas08/src/download.page +0 -15
- data/doc/examples/website_styles/andreas08/src/features.page +0 -8
- data/doc/examples/website_styles/andreas08/src/index.page +0 -9
- data/doc/examples/website_styles/andreas08/src/screenshots.page +0 -18
- data/doc/examples/website_styles/andreas09/README +0 -9
- data/doc/examples/website_styles/andreas09/config.yaml +0 -2
- data/doc/examples/website_styles/andreas09/src/about.page +0 -12
- data/doc/examples/website_styles/andreas09/src/default.css +0 -308
- data/doc/examples/website_styles/andreas09/src/default.template +0 -70
- data/doc/examples/website_styles/andreas09/src/download.page +0 -15
- data/doc/examples/website_styles/andreas09/src/features.page +0 -8
- data/doc/examples/website_styles/andreas09/src/images/bodybg-black.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/bodybg-green.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/bodybg-orange.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/bodybg-purple.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/bodybg-red.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/bodybg.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/footerbg.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/menuhover-black.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/menuhover-green.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/menuhover-orange.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/menuhover-purple.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/menuhover-red.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/images/menuhover.jpg +0 -0
- data/doc/examples/website_styles/andreas09/src/index.page +0 -9
- data/doc/examples/website_styles/andreas09/src/screenshots.page +0 -18
- data/doc/examples/website_styles/default/README +0 -9
- data/doc/examples/website_styles/default/config.yaml +0 -2
- data/doc/examples/website_styles/default/src/about.page +0 -12
- data/doc/examples/website_styles/default/src/default.css +0 -84
- data/doc/examples/website_styles/default/src/download.page +0 -15
- data/doc/examples/website_styles/default/src/features.page +0 -8
- data/doc/examples/website_styles/default/src/index.page +0 -9
- data/doc/examples/website_styles/default/src/screenshots.page +0 -18
- data/doc/examples/website_templates/default/README +0 -8
- data/doc/examples/website_templates/default/config.yaml +0 -2
- data/doc/examples/website_templates/default/src/default.css +0 -84
- data/doc/examples/website_templates/default/src/default.template +0 -38
- data/doc/examples/website_templates/default/src/index.page +0 -8
- data/doc/examples/website_templates/personal_hp/README +0 -8
- data/doc/examples/website_templates/personal_hp/config.yaml +0 -2
- data/doc/examples/website_templates/personal_hp/src/about.page +0 -12
- data/doc/examples/website_templates/personal_hp/src/default.css +0 -84
- data/doc/examples/website_templates/personal_hp/src/default.template +0 -38
- data/doc/examples/website_templates/personal_hp/src/index.page +0 -9
- data/doc/examples/website_templates/personal_hp/src/links.page +0 -22
- data/doc/examples/website_templates/personal_hp/src/projects.page +0 -20
- data/doc/examples/website_templates/project/README +0 -9
- data/doc/examples/website_templates/project/config.yaml +0 -2
- data/doc/examples/website_templates/project/src/about.page +0 -12
- data/doc/examples/website_templates/project/src/default.css +0 -84
- data/doc/examples/website_templates/project/src/default.template +0 -38
- data/doc/examples/website_templates/project/src/download.page +0 -15
- data/doc/examples/website_templates/project/src/features.page +0 -8
- data/doc/examples/website_templates/project/src/index.page +0 -9
- data/doc/examples/website_templates/project/src/screenshots.page +0 -18
- data/doc/metainfo.yaml +0 -105
- data/doc/plugin/emoticon.rb +0 -27
- data/doc/plugin/extension.rb +0 -163
- data/doc/plugin/gallery/slides/collage.rb +0 -337
- data/doc/plugin/listpluginparameters.rb +0 -37
- data/doc/plugin/resources.rb +0 -28
- data/doc/src/css/sipttra.rcss +0 -71
- data/doc/src/default.css +0 -434
- data/doc/src/default.template +0 -125
- data/doc/src/documentation/basics.page +0 -148
- data/doc/src/documentation/extending_webgen.page +0 -104
- data/doc/src/documentation/howto.page +0 -221
- data/doc/src/documentation/index.page +0 -50
- data/doc/src/documentation/plugins/contentconverter/default.page +0 -16
- data/doc/src/documentation/plugins/contentconverter/haml.page +0 -21
- data/doc/src/documentation/plugins/contentconverter/html.page +0 -10
- data/doc/src/documentation/plugins/contentconverter/markdown.page +0 -21
- data/doc/src/documentation/plugins/contentconverter/maruku.page +0 -23
- data/doc/src/documentation/plugins/contentconverter/rdoc.page +0 -11
- data/doc/src/documentation/plugins/contentconverter/sass.page +0 -36
- data/doc/src/documentation/plugins/contentconverter/textile.page +0 -21
- data/doc/src/documentation/plugins/contentconverter/xmlbuilder.page +0 -61
- data/doc/src/documentation/plugins/core/configuration.page +0 -17
- data/doc/src/documentation/plugins/core/filehandler.page +0 -220
- data/doc/src/documentation/plugins/core/index.page +0 -11
- data/doc/src/documentation/plugins/core/resourcemanager.page +0 -40
- data/doc/src/documentation/plugins/core/tagprocessor.page +0 -17
- data/doc/src/documentation/plugins/file/copyhandler.page +0 -26
- data/doc/src/documentation/plugins/file/defaulthandler.page +0 -16
- data/doc/src/documentation/plugins/file/directoryhandler.page +0 -37
- data/doc/src/documentation/plugins/file/galleryhandler.page +0 -190
- data/doc/src/documentation/plugins/file/pagehandler.page +0 -154
- data/doc/src/documentation/plugins/file/sipttrahandler.page +0 -18
- data/doc/src/documentation/plugins/file/templatehandler.page +0 -51
- data/doc/src/documentation/plugins/file/thumbnailwriter.page +0 -42
- data/doc/src/documentation/plugins/htmlvalidator/default.page +0 -13
- data/doc/src/documentation/plugins/htmlvalidator/xmllint.page +0 -12
- data/doc/src/documentation/plugins/index.page +0 -53
- data/doc/src/documentation/plugins/menustyle/default.page +0 -20
- data/doc/src/documentation/plugins/menustyle/horizontal.page +0 -36
- data/doc/src/documentation/plugins/menustyle/horizontaldropdown.page +0 -48
- data/doc/src/documentation/plugins/menustyle/section.page +0 -34
- data/doc/src/documentation/plugins/menustyle/vertical.page +0 -48
- data/doc/src/documentation/plugins/menustyle/verticaldropdown.page +0 -29
- data/doc/src/documentation/plugins/misc/index.page +0 -9
- data/doc/src/documentation/plugins/misc/smileyreplacer.page +0 -39
- data/doc/src/documentation/plugins/misc/syntaxhighlighter.page +0 -26
- data/doc/src/documentation/plugins/tag/block.page +0 -29
- data/doc/src/documentation/plugins/tag/breadcrumbtrail.page +0 -41
- data/doc/src/documentation/plugins/tag/customvar.page +0 -11
- data/doc/src/documentation/plugins/tag/date.page +0 -34
- data/doc/src/documentation/plugins/tag/default.page +0 -28
- data/doc/src/documentation/plugins/tag/download.page +0 -60
- data/doc/src/documentation/plugins/tag/executecommand.page +0 -29
- data/doc/src/documentation/plugins/tag/htmlmetainfo.page +0 -32
- data/doc/src/documentation/plugins/tag/includefile.page +0 -30
- data/doc/src/documentation/plugins/tag/langbar.de.page +0 -6
- data/doc/src/documentation/plugins/tag/langbar.fr.page +0 -6
- data/doc/src/documentation/plugins/tag/langbar.page +0 -41
- data/doc/src/documentation/plugins/tag/menu.page +0 -78
- data/doc/src/documentation/plugins/tag/meta.page +0 -21
- data/doc/src/documentation/plugins/tag/news.page +0 -48
- data/doc/src/documentation/plugins/tag/relocatable.page +0 -46
- data/doc/src/documentation/plugins/tag/resource.page +0 -35
- data/doc/src/documentation/plugins/tag/sitemap.page +0 -35
- data/doc/src/documentation/plugins/tag/wikilink.page +0 -33
- data/doc/src/documentation/references/index.page +0 -34
- data/doc/src/documentation/references/meta_info_reference.page +0 -136
- data/doc/src/documentation/references/parameter_reference.page +0 -11
- data/doc/src/documentation/references/resource_reference.page +0 -18
- data/doc/src/documentation/references/sipttra_format.page +0 -241
- data/doc/src/documentation/references/webpage_format.page +0 -253
- data/doc/src/documentation/tutorial.page +0 -167
- data/doc/src/download.page +0 -74
- data/doc/src/examples/example_sites/index.page +0 -45
- data/doc/src/examples/example_sites/personal.zip +0 -0
- data/doc/src/examples/example_sites/photo_gallery.zip +0 -0
- data/doc/src/examples/gallery_styles/default/default.gallery +0 -78
- data/doc/src/examples/gallery_styles/default/gallery_gallery.template +0 -38
- data/doc/src/examples/gallery_styles/default/gallery_image.template +0 -30
- data/doc/src/examples/gallery_styles/default/gallery_main.template +0 -18
- data/doc/src/examples/gallery_styles/index.page +0 -22
- data/doc/src/examples/gallery_styles/slides/gallery_gallery.template +0 -62
- data/doc/src/examples/gallery_styles/slides/gallery_image.template +0 -53
- data/doc/src/examples/gallery_styles/slides/gallery_main.template +0 -32
- data/doc/src/examples/gallery_styles/slides/slides.gallery +0 -79
- data/doc/src/examples/images/image01.jpg +0 -0
- data/doc/src/examples/images/image02.jpg +0 -0
- data/doc/src/examples/images/image03.jpg +0 -0
- data/doc/src/examples/images/image04.jpg +0 -0
- data/doc/src/examples/images/image05.jpg +0 -0
- data/doc/src/examples/images/image06.jpg +0 -0
- data/doc/src/examples/images/image07.jpg +0 -0
- data/doc/src/examples/images/image08.jpg +0 -0
- data/doc/src/examples/images/image09.jpg +0 -0
- data/doc/src/examples/images/image10.jpg +0 -0
- data/doc/src/examples/images/image11.jpg +0 -0
- data/doc/src/examples/images/image12.jpg +0 -0
- data/doc/src/examples/images/image13.jpg +0 -0
- data/doc/src/examples/images/image14.jpg +0 -0
- data/doc/src/examples/images/image15.jpg +0 -0
- data/doc/src/examples/images/image16.jpg +0 -0
- data/doc/src/examples/images/image17.jpg +0 -0
- data/doc/src/examples/images/image18.jpg +0 -0
- data/doc/src/examples/index.page +0 -19
- data/doc/src/examples/sipttra_styles/default.page +0 -5
- data/doc/src/examples/sipttra_styles/default/css/sipttra.rcss +0 -71
- data/doc/src/examples/sipttra_styles/default/default.template +0 -16
- data/doc/src/examples/sipttra_styles/default/index.todo +0 -60
- data/doc/src/examples/sipttra_styles/default/js/sipttra.js +0 -7
- data/doc/src/examples/sipttra_styles/default/sipttra.template +0 -105
- data/doc/src/examples/sipttra_styles/index.page +0 -17
- data/doc/src/examples/website_styles/1024px.page +0 -5
- data/doc/src/examples/website_styles/andreas00.page +0 -5
- data/doc/src/examples/website_styles/andreas01.page +0 -5
- data/doc/src/examples/website_styles/andreas03.page +0 -5
- data/doc/src/examples/website_styles/andreas04.page +0 -5
- data/doc/src/examples/website_styles/andreas05.page +0 -5
- data/doc/src/examples/website_styles/andreas06.page +0 -5
- data/doc/src/examples/website_styles/andreas07.page +0 -5
- data/doc/src/examples/website_styles/andreas08.page +0 -5
- data/doc/src/examples/website_styles/andreas09.page +0 -5
- data/doc/src/examples/website_styles/default.page +0 -5
- data/doc/src/examples/website_styles/index.page +0 -76
- data/doc/src/examples/website_templates/default.page +0 -5
- data/doc/src/examples/website_templates/index.page +0 -24
- data/doc/src/examples/website_templates/personal_hp.page +0 -5
- data/doc/src/examples/website_templates/project.page +0 -5
- data/doc/src/features.page +0 -41
- data/doc/src/images/bodybg.jpg +0 -0
- data/doc/src/images/footerbg.jpg +0 -0
- data/doc/src/images/menuhover.jpg +0 -0
- data/doc/src/images/node_diagram.svg +0 -7132
- data/doc/src/images/thumb_example.jpg +0 -0
- data/doc/src/images/thumb_example_cropped.jpg +0 -0
- data/doc/src/images/thumb_example_normal.jpg +0 -0
- data/doc/src/index.page +0 -32
- data/doc/src/js/sipttra.js +0 -7
- data/doc/src/news.page +0 -256
- data/doc/src/plugin.template +0 -10
- data/doc/src/project.todo +0 -144
- data/doc/src/sipttra.template +0 -105
- data/lib/webgen/composite.rb +0 -101
- data/lib/webgen/config.rb +0 -52
- data/lib/webgen/content.rb +0 -172
- data/lib/webgen/extcommand.rb +0 -23
- data/lib/webgen/gui/common.rb +0 -38
- data/lib/webgen/gui/main.rb +0 -219
- data/lib/webgen/gui/new_website_dlg.rb +0 -125
- data/lib/webgen/listener.rb +0 -105
- data/lib/webgen/plugin.rb +0 -578
- data/lib/webgen/plugins/contentconverters/default.rb +0 -40
- data/lib/webgen/plugins/contentconverters/haml.rb +0 -71
- data/lib/webgen/plugins/contentconverters/html.rb +0 -43
- data/lib/webgen/plugins/contentconverters/markdown.rb +0 -54
- data/lib/webgen/plugins/contentconverters/maruku.rb +0 -33
- data/lib/webgen/plugins/contentconverters/rdoc.rb +0 -54
- data/lib/webgen/plugins/contentconverters/textile.rb +0 -54
- data/lib/webgen/plugins/contentconverters/xmlbuilder.rb +0 -58
- data/lib/webgen/plugins/coreplugins/configuration.rb +0 -45
- data/lib/webgen/plugins/coreplugins/resourcemanager.rb +0 -307
- data/lib/webgen/plugins/filehandlers/copy.rb +0 -82
- data/lib/webgen/plugins/filehandlers/directory.rb +0 -126
- data/lib/webgen/plugins/filehandlers/filehandler.rb +0 -486
- data/lib/webgen/plugins/filehandlers/gallery.rb +0 -486
- data/lib/webgen/plugins/filehandlers/page.rb +0 -255
- data/lib/webgen/plugins/filehandlers/sipttra.rb +0 -73
- data/lib/webgen/plugins/filehandlers/template.rb +0 -115
- data/lib/webgen/plugins/htmlvalidators/default.rb +0 -39
- data/lib/webgen/plugins/htmlvalidators/xmllint.rb +0 -54
- data/lib/webgen/plugins/menustyles/default.rb +0 -80
- data/lib/webgen/plugins/menustyles/horizontal.rb +0 -85
- data/lib/webgen/plugins/menustyles/horizontal_dropdown.rb +0 -99
- data/lib/webgen/plugins/menustyles/section.rb +0 -68
- data/lib/webgen/plugins/menustyles/vertical.rb +0 -87
- data/lib/webgen/plugins/menustyles/vertical_dropdown.rb +0 -99
- data/lib/webgen/plugins/miscplugins/rendered_files.rb +0 -75
- data/lib/webgen/plugins/miscplugins/smileyreplacer.rb +0 -87
- data/lib/webgen/plugins/miscplugins/syntax_highlighter.rb +0 -72
- data/lib/webgen/plugins/miscplugins/treewalker.rb +0 -91
- data/lib/webgen/plugins/tags/block.rb +0 -65
- data/lib/webgen/plugins/tags/breadcrumbtrail.rb +0 -75
- data/lib/webgen/plugins/tags/customvar.rb +0 -54
- data/lib/webgen/plugins/tags/date.rb +0 -46
- data/lib/webgen/plugins/tags/download.rb +0 -155
- data/lib/webgen/plugins/tags/executecommand.rb +0 -69
- data/lib/webgen/plugins/tags/htmlmetainfo.rb +0 -27
- data/lib/webgen/plugins/tags/includefile.rb +0 -69
- data/lib/webgen/plugins/tags/langbar.rb +0 -55
- data/lib/webgen/plugins/tags/menu.rb +0 -111
- data/lib/webgen/plugins/tags/meta.rb +0 -53
- data/lib/webgen/plugins/tags/news.rb +0 -151
- data/lib/webgen/plugins/tags/relocatable.rb +0 -94
- data/lib/webgen/plugins/tags/sitemap.rb +0 -82
- data/lib/webgen/plugins/tags/tag_processor.rb +0 -279
- data/lib/webgen/plugins/tags/wikilink.rb +0 -62
- data/lib/webgen/rake/webgentask.rb +0 -161
- data/lib/webgen/sipttra_format.rb +0 -343
- data/lib/webgen/test.rb +0 -202
- data/test/fixtures/sample_site/src/chained.template +0 -3
- data/test/fixtures/sample_site/src/default.template +0 -3
- data/test/fixtures/sample_site/src/dir1/dir11/file111.de.page +0 -3
- data/test/fixtures/sample_site/src/dir1/dir11/file111.page +0 -3
- data/test/fixtures/sample_site/src/dir1/dir11/index.page +0 -3
- data/test/fixtures/sample_site/src/dir1/file11.page +0 -3
- data/test/fixtures/sample_site/src/dir2/file21.page +0 -3
- data/test/fixtures/sample_site/src/embedded.rhtml +0 -1
- data/test/fixtures/sample_site/src/file1.page +0 -8
- data/test/fixtures/sample_site/src/file2.de.page +0 -6
- data/test/fixtures/sample_site/src/index.de.page +0 -5
- data/test/fixtures/sample_site/src/index.en.page +0 -1
- data/test/fixtures/sample_site/src/invalid.template +0 -3
- data/test/fixtures/sample_site/src/test.jpg +0 -1
- data/test/fixtures/sample_site/src/test.template +0 -3
- data/test/fixtures/sample_site/src/test.todo +0 -7
- data/test/fixtures/tc_content/blocks.yaml +0 -40
- data/test/fixtures/tc_content/correct.yaml +0 -65
- data/test/fixtures/tc_content/incorrect.yaml +0 -42
- data/test/fixtures/tc_filehandler_filehandler/backing/metainfo.yaml +0 -9
- data/test/fixtures/tc_filehandler_filehandler/backing_empty/metainfo.yaml +0 -6
- data/test/fixtures/tc_filehandler_filehandler/sample_plugin.rb +0 -49
- data/test/fixtures/tc_filehandler_filehandler/unmodified +0 -0
- data/test/fixtures/tc_filehandler_gallery/test.gallery +0 -2
- data/test/fixtures/tc_filehandler_gallery/test1.gallery +0 -2
- data/test/fixtures/tc_filehandler_gallery/test1.jpg +0 -0
- data/test/fixtures/tc_filehandler_gallery/test2.jpg +0 -0
- data/test/fixtures/tc_filehandler_gallery/test3.jpg +0 -0
- data/test/fixtures/tc_filehandler_gallery/test4.jpg +0 -0
- data/test/fixtures/tc_filehandler_page/testdata.yaml +0 -10
- data/test/fixtures/tc_menustyles_default/menustyle.rb +0 -7
- data/test/fixtures/tc_node/nodes.yaml +0 -64
- data/test/fixtures/tc_plugin/handlerplugin.rb +0 -15
- data/test/fixtures/tc_plugin/plugin1.rb +0 -35
- data/test/fixtures/tc_plugin/plugin2.rb +0 -8
- data/test/fixtures/tc_sipttra_format/test.sipttra +0 -46
- data/test/fixtures/tc_tags_includefile/testfile +0 -1
- data/test/fixtures/tc_tags_tag_processor/test_file1 +0 -1
- data/test/fixtures/tc_tags_tag_processor/testtag.rb +0 -17
- data/test/fixtures/tc_website/correct.yaml +0 -6
- data/test/fixtures/tc_website/incorrect_structure.yaml +0 -2
- data/test/fixtures/tc_website/incorrect_yaml.yaml +0 -5
- data/test/fixtures/tc_website/meta_info_test.yaml +0 -10
- data/test/fixtures/tc_website/testdir/README +0 -1
- data/test/fixtures/tc_website/testdir/falsedir/README +0 -1
- data/test/runtests.rb +0 -2
- data/test/unittests/tc_composite.rb +0 -82
- data/test/unittests/tc_config.rb +0 -18
- data/test/unittests/tc_content.rb +0 -96
- data/test/unittests/tc_contentconverters_default.rb +0 -13
- data/test/unittests/tc_contentconverters_html.rb +0 -16
- data/test/unittests/tc_contentconverters_markdown.rb +0 -22
- data/test/unittests/tc_contentconverters_rdoc.rb +0 -16
- data/test/unittests/tc_contentconverters_textile.rb +0 -22
- data/test/unittests/tc_contentconverters_xmlbuilder.rb +0 -22
- data/test/unittests/tc_filehandler_copy.rb +0 -65
- data/test/unittests/tc_filehandler_directory.rb +0 -134
- data/test/unittests/tc_filehandler_filehandler.rb +0 -294
- data/test/unittests/tc_filehandler_gallery.rb +0 -165
- data/test/unittests/tc_filehandler_page.rb +0 -183
- data/test/unittests/tc_filehandler_sipttra.rb +0 -26
- data/test/unittests/tc_filehandler_template.rb +0 -64
- data/test/unittests/tc_htmlvalidators_default.rb +0 -12
- data/test/unittests/tc_htmlvalidators_xmllint.rb +0 -19
- data/test/unittests/tc_languages.rb +0 -57
- data/test/unittests/tc_listener.rb +0 -72
- data/test/unittests/tc_menustyles_default.rb +0 -51
- data/test/unittests/tc_menustyles_horizontal.rb +0 -64
- data/test/unittests/tc_menustyles_horizontal_dropdown.rb +0 -18
- data/test/unittests/tc_menustyles_section.rb +0 -59
- data/test/unittests/tc_menustyles_vertical.rb +0 -79
- data/test/unittests/tc_menustyles_vertical_dropdown.rb +0 -18
- data/test/unittests/tc_node.rb +0 -205
- data/test/unittests/tc_plugin.rb +0 -221
- data/test/unittests/tc_resourcemanager.rb +0 -42
- data/test/unittests/tc_sipttra_format.rb +0 -58
- data/test/unittests/tc_smileyreplacer.rb +0 -25
- data/test/unittests/tc_syntax_highlighter.rb +0 -30
- data/test/unittests/tc_tags_block.rb +0 -27
- data/test/unittests/tc_tags_breadcrumbtrail.rb +0 -56
- data/test/unittests/tc_tags_customvar.rb +0 -24
- data/test/unittests/tc_tags_date.rb +0 -16
- data/test/unittests/tc_tags_download.rb +0 -32
- data/test/unittests/tc_tags_executecommand.rb +0 -37
- data/test/unittests/tc_tags_includefile.rb +0 -46
- data/test/unittests/tc_tags_langbar.rb +0 -42
- data/test/unittests/tc_tags_menu.rb +0 -50
- data/test/unittests/tc_tags_meta.rb +0 -19
- data/test/unittests/tc_tags_relocatable.rb +0 -66
- data/test/unittests/tc_tags_sitemap.rb +0 -33
- data/test/unittests/tc_tags_tag_processor.rb +0 -107
- data/test/unittests/tc_tags_wikilink.rb +0 -22
- data/test/unittests/tc_treewalker.rb +0 -51
- data/test/unittests/tc_website.rb +0 -188
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SourceHandler::Metainfo
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> TODO: This information needs to be updated
|
|
6
|
+
{.exclamation}
|
|
7
|
+
|
|
8
|
+
### The meta information backing file {#metainfo-file}
|
|
9
|
+
|
|
10
|
+
The meta information backing file contains meta information about files/directories in the source
|
|
11
|
+
directory. It has two sections both of which have to be in YAML format and both have to have the
|
|
12
|
+
same structure: a source backing section and an output backing section which is optional. The
|
|
13
|
+
sections are separated by three dashes on an otherwise empty line.
|
|
14
|
+
|
|
15
|
+
The source backing section is used to apply meta information to a file before a node for this file
|
|
16
|
+
is created. A file handler plugin can therefore use this meta information during the creation of the
|
|
17
|
+
node. Make sure that you use a valid source path, i.e. a path that resolves to a file in the source
|
|
18
|
+
directory!
|
|
19
|
+
|
|
20
|
+
The output backing section is used to apply meta information after _all_ nodes have been created and
|
|
21
|
+
to create so called "virtual nodes". The paths specified in the output backing section have to be:
|
|
22
|
+
|
|
23
|
+
* valid (localized) canonical names (for assigning meta info to existing nodes) or
|
|
24
|
+
* a path pattern for matching against localized canonical names (for assigning meta info to multiple
|
|
25
|
+
existing nodes)
|
|
26
|
+
* the desired output names (for creating virtual nodes)!
|
|
27
|
+
|
|
28
|
+
The different cases are handled like this:
|
|
29
|
+
|
|
30
|
+
* If a path has a `*` or a `?` in it, it is considered a path pattern and the meta information is
|
|
31
|
+
assigned to all nodes whose localized canonical name matches the pattern.
|
|
32
|
+
|
|
33
|
+
> Since the localized canonical name of the nodes are used, you need to remember that the pattern
|
|
34
|
+
> `**/*.html` sets the meta information on all nodes ending in `.html` whereas the pattern
|
|
35
|
+
> `**/*.en.html` only sets the meta information on English nodes ending in `.html`.
|
|
36
|
+
{.information}
|
|
37
|
+
|
|
38
|
+
* If a specified path resolves to an already created node, the meta information is applied to this
|
|
39
|
+
node.
|
|
40
|
+
|
|
41
|
+
* If the path ends in an slash, a directory node is created with the meta information.
|
|
42
|
+
|
|
43
|
+
* Otherwise, a virtual node is created with the specified meta information and empty content - a
|
|
44
|
+
virtual node _never_ creates a real output file!
|
|
45
|
+
|
|
46
|
+
This facility can be used, for example, to specify meta information common to a set of nodes (for
|
|
47
|
+
example, the author of blog pages), to include links to external web pages in menus or to create a
|
|
48
|
+
whole menu with custom sections and multiple references in different sections to the same node!
|
|
49
|
+
|
|
50
|
+
Following is a sample meta information backing file with explanations afterwards:
|
|
51
|
+
|
|
52
|
+
index.page:
|
|
53
|
+
inMenu: true
|
|
54
|
+
sort_info: 2
|
|
55
|
+
|
|
56
|
+
images:
|
|
57
|
+
indexFile: ~
|
|
58
|
+
---
|
|
59
|
+
index.html:
|
|
60
|
+
inMenu: false
|
|
61
|
+
|
|
62
|
+
wiki.html:
|
|
63
|
+
title: Link to wiki
|
|
64
|
+
url: http://myhost.com/path/to/my/wiki
|
|
65
|
+
inMenu: true
|
|
66
|
+
sort_info: 5
|
|
67
|
+
|
|
68
|
+
api.html:
|
|
69
|
+
title: API Reference
|
|
70
|
+
url: http://myhost.com/api
|
|
71
|
+
|
|
72
|
+
virtdir/:
|
|
73
|
+
indexFile: index.html
|
|
74
|
+
|
|
75
|
+
virtdir/index.html:
|
|
76
|
+
title: A virtual index file
|
|
77
|
+
inMenu: true
|
|
78
|
+
url: /index.page
|
|
79
|
+
|
|
80
|
+
virtdir/other.html:
|
|
81
|
+
inMenu: true
|
|
82
|
+
url: /otherdir/linked.de.page
|
|
83
|
+
|
|
84
|
+
**/*.html:
|
|
85
|
+
author: The Real Author
|
|
86
|
+
|
|
87
|
+
The above sample meta information backing file consists of both sections: the mandatory source
|
|
88
|
+
section and the optional output section. As you can see each section is described using a hash of
|
|
89
|
+
hashes, i.e. the keys are paths and the values are the meta information hashes.
|
|
90
|
+
|
|
91
|
+
The source section specifies additional meta information for the `index.page` file and for the
|
|
92
|
+
`images` directory: the `index.page` gets the `inMenu` and `sort_info` meta information set and it
|
|
93
|
+
is specified that the `images` directory has no `indexFile`.
|
|
94
|
+
|
|
95
|
+
The output section is more interesting than the source section:
|
|
96
|
+
|
|
97
|
+
* The first entry references an existing file, therefore the meta information for that file
|
|
98
|
+
(`index.html`) is set appropriately.
|
|
99
|
+
|
|
100
|
+
* The second entry specifies that under the `root` directory a virtual node with the path
|
|
101
|
+
`wiki.html` should be created (the node will be virtual as the path references no existing file).
|
|
102
|
+
It should have the specified title and should be in the menu with the specified
|
|
103
|
+
order. Furthermore, a special *`url`* key is used. This key can only be used for virtual file
|
|
104
|
+
nodes (not directory nodes) in the output section and it specifies the link target for the node.
|
|
105
|
+
So, whenever a reference to `wiki.html` is requested the resolved `url` is returned. This `url`
|
|
106
|
+
can be a link to an outside page or it can refer to another node, as described below. The `url` is
|
|
107
|
+
assumed to be relative to the directory the virtual node is in.
|
|
108
|
+
|
|
109
|
+
* The third entry also specifies a virtual node linking to an external page, but one which will not
|
|
110
|
+
appear in a menu. Such nodes are normally inserted into the output section so that the
|
|
111
|
+
Tag/Relocatable plugin can be used.
|
|
112
|
+
|
|
113
|
+
* The next three entries add virtual entries to the menu to show how one page can appear in more
|
|
114
|
+
than one directory: the `virtdir/index.html` links to the top level `index.page` and
|
|
115
|
+
`virtdir/other.html` links to a page in another subdirectory, namely `/otherdir/linked.de.page`.
|
|
116
|
+
|
|
117
|
+
* The last entry set the `author` meta information on all nodes that end with `.html`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Webgen::SourceHandler::Page
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> TODO: this needs to be redone!
|
|
6
|
+
{.exclamation}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Processing
|
|
10
|
+
|
|
11
|
+
TODO: redo this whole section
|
|
12
|
+
|
|
13
|
+
There is a well defined procesing order for files in WebPage Format:
|
|
14
|
+
|
|
15
|
+
* After reading in the file, it is split into the blocks.
|
|
16
|
+
|
|
17
|
+
* Each content block is converted to HTML (depends on the format specifier) and the HTML sections
|
|
18
|
+
are resolved (caveat: only those with an `id` attribute)
|
|
19
|
+
|
|
20
|
+
* When writing out the file, the converted content is first processed with ERB (if specified to do
|
|
21
|
+
so),
|
|
22
|
+
|
|
23
|
+
* then webgen tags are replaced and,
|
|
24
|
+
|
|
25
|
+
* finally, the result is written.
|
|
26
|
+
|
|
27
|
+
The first two steps happen when the file is read and the last three when the file is written.
|
|
28
|
+
|
|
29
|
+
#### Converting to HTML
|
|
30
|
+
|
|
31
|
+
The conversion of a content block to HTML is done via the ContentConverter plugins. Each plugin is
|
|
32
|
+
able to convert a special marked-up text to HTML.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Webgen Page Format
|
|
3
|
+
---
|
|
4
|
+
## Webgen Page Format
|
|
5
|
+
|
|
6
|
+
The Webgen Page Format is a custom format designed primarily for page and template files. It
|
|
7
|
+
consists of an optional meta information block and one or more blocks of data; it is very simple and
|
|
8
|
+
easy to use.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
A file using the Webgen Page Format consists of one or more blocks which are the smallest units
|
|
13
|
+
recongnized. Blocks are separated from each other through a line containing three dashes. This is
|
|
14
|
+
illustrated in the following examples which are all valid files in WebPage Format:
|
|
15
|
+
|
|
16
|
+
Example 1:
|
|
17
|
+
|
|
18
|
+
Here is a block!
|
|
19
|
+
|
|
20
|
+
Example 2:
|
|
21
|
+
|
|
22
|
+
This is one block of the file
|
|
23
|
+
---
|
|
24
|
+
This is another block.
|
|
25
|
+
|
|
26
|
+
Example 3:
|
|
27
|
+
|
|
28
|
+
Block 1
|
|
29
|
+
--- name:block2
|
|
30
|
+
Block 2
|
|
31
|
+
--- name:block3
|
|
32
|
+
Block 3...
|
|
33
|
+
|
|
34
|
+
If you want to use three dashes in a block but you don't want to end the block, you have to escape
|
|
35
|
+
them with a backslash character, like this:
|
|
36
|
+
|
|
37
|
+
Block 1
|
|
38
|
+
\---
|
|
39
|
+
still Block 1
|
|
40
|
+
--- name:block2
|
|
41
|
+
Block 2
|
|
42
|
+
|
|
43
|
+
All of the above examples show one kind of block, the content block. However, there may also be
|
|
44
|
+
another type of block: the meta information block. Following is a short description of both kinds,
|
|
45
|
+
starting with the meta information block.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Meta Information Block
|
|
49
|
+
|
|
50
|
+
Each file in Webgen Page Format can have zero or one meta information blocks. This block is
|
|
51
|
+
specified at the beginning of the file. To tell the parser that the first block is the meta
|
|
52
|
+
information block and not a content block, you have to start the file with three dashes:
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
title: The title set by Meta info
|
|
56
|
+
---
|
|
57
|
+
This is the content of the file
|
|
58
|
+
|
|
59
|
+
The above defines a meta information block and a content block. The meta information block has to be
|
|
60
|
+
in YAML format and should contain key-value pairs of meta information. [YAML](http://www.yaml.org)
|
|
61
|
+
is a simple markup language designed for ease of use and although you define structured data with
|
|
62
|
+
it, it feels like just writing a plain text document.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Content Blocks
|
|
66
|
+
|
|
67
|
+
A content block is used to provide content in a specific format. Each file in Webgen Page Format
|
|
68
|
+
needs to have at least one content block which may be empty. However, it can have as many content
|
|
69
|
+
blocks as necessary. Each content block needs to have a unique name and additional options can also
|
|
70
|
+
be set.
|
|
71
|
+
|
|
72
|
+
The name uniquely identifies a content block and is used to access it. The only option used by
|
|
73
|
+
webgen is the `pipeline` option which specifies the processing pipeline for the block. The
|
|
74
|
+
processing pipeline is used for rendering the block by using the specified content processors in the
|
|
75
|
+
specified order. There are several different content processors available - have a look at the
|
|
76
|
+
[content processor listing]({relocatable: contentprocessor/}) for an overview.
|
|
77
|
+
|
|
78
|
+
There are also defaults for the name and the options of a block but they can be overwritten. You can
|
|
79
|
+
use one of two ways to do this:
|
|
80
|
+
|
|
81
|
+
* you either specify the name and additional options of the block on the starting line with the
|
|
82
|
+
three dashes
|
|
83
|
+
|
|
84
|
+
* or you use the special meta information `block` to define the names and options of one or all
|
|
85
|
+
blocks.
|
|
86
|
+
|
|
87
|
+
The following example uses the first technique to override the name and/or the `pipeline` option:
|
|
88
|
+
|
|
89
|
+
1. content block of the file
|
|
90
|
+
--- name:sidebar pipeline:maruku,tags
|
|
91
|
+
2. content block of the file
|
|
92
|
+
--- name:other
|
|
93
|
+
3. content block of the file
|
|
94
|
+
|
|
95
|
+
The first block has no identifieres set (there is no line with three dashes and the identifieres).
|
|
96
|
+
Therefore the default value for the name is used: `content`. The second block is named `sidebar` and
|
|
97
|
+
uses the processing pipeline `maruku,tags`. As you can see, the name of a block as well as
|
|
98
|
+
additional options are specified by stating the key (e.g. `name` or `pipeline`) followed by a colon
|
|
99
|
+
and the value. Multiple options are separated via one or more spaces.
|
|
100
|
+
|
|
101
|
+
> Only the first block gets the default name of `content`. The second and following blocks have
|
|
102
|
+
> numbered names like `block2`, `block3` and so on.
|
|
103
|
+
{.information}
|
|
104
|
+
|
|
105
|
+
You can also set the name and additional options of the content blocks by using the special `blocks`
|
|
106
|
+
meta information. It is a hash using the index of a block (or the special value `default`) as key
|
|
107
|
+
and the options as values. The above example can therefore also be written like this:
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
blocks: \{2: {name: sidebar, pipeline: maruku,tags}, 3: {name: other}}
|
|
111
|
+
---
|
|
112
|
+
1. content block of the file
|
|
113
|
+
---
|
|
114
|
+
2. content block of the file
|
|
115
|
+
---
|
|
116
|
+
3. content block of the file
|
|
117
|
+
|
|
118
|
+
When selecting a value for the name of a block or an option, the following precedence is used (from
|
|
119
|
+
low to high):
|
|
120
|
+
|
|
121
|
+
* global defaults set via the `default` key of the meta information `blocks`
|
|
122
|
+
* block defaults set via the meta information `blocks`
|
|
123
|
+
* the `--- line` options
|
|
124
|
+
|
|
125
|
+
As stated above, the "option" `name` is special insofar that when it is not set, an automatic name
|
|
126
|
+
gets generated.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
module Webgen
|
|
2
|
+
|
|
3
|
+
# A blackboard object provides two features for inter-object communication:
|
|
4
|
+
#
|
|
5
|
+
# * services: An object can add a service to the blackboard which can be called by any other
|
|
6
|
+
# object by just specifing the service name. Therefore it is easy to change the
|
|
7
|
+
# underlying implementation of the service and there are no hard dependencies on
|
|
8
|
+
# specific class or method names.
|
|
9
|
+
#
|
|
10
|
+
# * listeners: Objects may register themselves for specific messsage names and get notified when
|
|
11
|
+
# such a message gets dispatched.
|
|
12
|
+
class Blackboard
|
|
13
|
+
|
|
14
|
+
# Create a new Blackboard object.
|
|
15
|
+
def initialize
|
|
16
|
+
@listener = {}
|
|
17
|
+
@services = {}
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Add the +callable_object+ or the given block as listener for the messages +msg_names+ (one
|
|
21
|
+
# message name or an array of message names).
|
|
22
|
+
def add_listener(msg_names = nil, callable_object = nil, &block)
|
|
23
|
+
callable_object = callable_object || block
|
|
24
|
+
if !callable_object.nil?
|
|
25
|
+
raise ArgumentError, "The listener needs to respond to 'call'" unless callable_object.respond_to?(:call)
|
|
26
|
+
[msg_names].flatten.compact.each {|name| (@listener[name] ||= []) << callable_object}
|
|
27
|
+
else
|
|
28
|
+
raise ArgumentError, "You have to provide a callback object or a block"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Remove the given object from the dispatcher queues of the message names specified in
|
|
33
|
+
# +msg_names+.
|
|
34
|
+
def del_listener(msg_names, callable_object)
|
|
35
|
+
[msg_names].flatten.each {|name| @listener[name].delete(callable_object) if @listener[name]}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Dispatch the message +msg_name+ to all listeners for this message, passing the given
|
|
39
|
+
# arguments.
|
|
40
|
+
def dispatch_msg(msg_name, *args)
|
|
41
|
+
return unless @listener[msg_name]
|
|
42
|
+
@listener[msg_name].each {|obj| obj.call(*args)}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Add a service named +service_name+ provided by the +callable_object+ or a block to the
|
|
46
|
+
# blackboard.
|
|
47
|
+
def add_service(service_name, callable_object = nil, &block)
|
|
48
|
+
callable_object = callable_object || block
|
|
49
|
+
if @services.has_key?(service_name)
|
|
50
|
+
raise "The service name '#{service_name}' is already taken"
|
|
51
|
+
else
|
|
52
|
+
raise ArgumentError, "An object providing a service needs to respond to 'call'" unless callable_object.respond_to?(:call)
|
|
53
|
+
@services[service_name] = callable_object
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Delete the service +service_name+.
|
|
58
|
+
def del_service(service_name)
|
|
59
|
+
@services.delete(service_name)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Invoke the service called +service_name+ with the given arguments.
|
|
63
|
+
def invoke(service_name, *args, &block)
|
|
64
|
+
if @services.has_key?(service_name)
|
|
65
|
+
@services[service_name].call(*args, &block)
|
|
66
|
+
else
|
|
67
|
+
raise ArgumentError, "No such service named '#{service_name}' available"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|
data/lib/webgen/cache.rb
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
require 'set'
|
|
2
|
+
require 'facets/kernel/constant'
|
|
3
|
+
|
|
4
|
+
module Webgen
|
|
5
|
+
|
|
6
|
+
# A cache object provides access to various caches to speed up rendering of a website.
|
|
7
|
+
#
|
|
8
|
+
# permanent:: The permanent cache should be used for data that should be available between webgen
|
|
9
|
+
# runs.
|
|
10
|
+
#
|
|
11
|
+
# volatile:: The volatile cache is used for data that can easily be regenerated but might be
|
|
12
|
+
# expensive to do so. This cache is not stored between webgen runs.
|
|
13
|
+
#
|
|
14
|
+
# standard:: The standard cache saves data between webgen runs and returns the cached data (not
|
|
15
|
+
# the newly set data) if it is available. This is useful, for example, to store file
|
|
16
|
+
# modifcation times and check if a file has been changed between runs.
|
|
17
|
+
class Cache
|
|
18
|
+
|
|
19
|
+
# The permanent cache hash.
|
|
20
|
+
attr_reader :permanent
|
|
21
|
+
|
|
22
|
+
# Create a new cache object.
|
|
23
|
+
def initialize()
|
|
24
|
+
@old_data = {}
|
|
25
|
+
@new_data = {}
|
|
26
|
+
@volatile = {}
|
|
27
|
+
@permanent = {:classes => []}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Return the cached data (or, if it is not available, the new data) identified by +key+ from the
|
|
31
|
+
# standard cache.
|
|
32
|
+
def [](key)
|
|
33
|
+
if @old_data.has_key?(key)
|
|
34
|
+
@old_data[key]
|
|
35
|
+
else
|
|
36
|
+
@new_data[key]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Store +value+ identified by +key+ in the standard cache.
|
|
41
|
+
def []=(key, value)
|
|
42
|
+
@new_data[key] = value
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Restore the caches from +data+ and recreate all cached instances (see #instance).
|
|
46
|
+
def restore(data)
|
|
47
|
+
@old_data, @permanent = *data
|
|
48
|
+
@permanent[:classes].each {|klass| instance(klass)}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Return all caches that should be available between webgen runs.
|
|
52
|
+
def dump
|
|
53
|
+
[@old_data.merge(@new_data), @permanent]
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Return the volatile cache hash. If volatile caching has not been enabled, a new hash is
|
|
57
|
+
# returned on every invocation!
|
|
58
|
+
def volatile
|
|
59
|
+
(@volatile[:enabled] ? @volatile : {})
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Enable the volatile cache.
|
|
63
|
+
def enable_volatile_cache
|
|
64
|
+
@volatile[:enabled] = true
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Return the unique instance of the class +name+. This method should be used when it is
|
|
68
|
+
# essential that webgen uses only one object of a class or when an object should automatically
|
|
69
|
+
# be recreated upon cache restoration (see #restore).
|
|
70
|
+
def instance(name)
|
|
71
|
+
@permanent[:classes] << name unless @permanent[:classes].include?(name)
|
|
72
|
+
(@volatile[:classes] ||= {})[name] ||= constant(name).new
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end
|
data/lib/webgen/cli.rb
CHANGED
|
@@ -1,457 +1,116 @@
|
|
|
1
|
-
#
|
|
2
|
-
#--
|
|
3
|
-
#
|
|
4
|
-
# $Id: cli.rb 601 2007-02-14 21:20:44Z 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 'rbconfig'
|
|
24
|
-
require 'fileutils'
|
|
25
1
|
require 'cmdparse'
|
|
26
2
|
require 'webgen/website'
|
|
3
|
+
require 'webgen/version'
|
|
27
4
|
|
|
28
5
|
module Webgen
|
|
29
6
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
7
|
+
# Namespace for all classes that act as CLI commands.
|
|
8
|
+
#
|
|
9
|
+
# = Implementing a CLI command
|
|
10
|
+
#
|
|
11
|
+
# Each CLI command class needs to be put into this module and has to end with +Command+, otherwise
|
|
12
|
+
# it is not used. A CLI command is an extension that can be invoked from the webgen command and
|
|
13
|
+
# thus needs to be derived from CmdParse::Command. For detailed information on this class and the
|
|
14
|
+
# whole cmdparse package have a look at http://cmdparse.rubyforge.org!
|
|
15
|
+
#
|
|
16
|
+
# = Sample CLI command
|
|
17
|
+
#
|
|
18
|
+
# Here is a sample CLI command extension:
|
|
19
|
+
#
|
|
20
|
+
# require 'webgen/cli'
|
|
21
|
+
#
|
|
22
|
+
# class Webgen::CLI::SampleCommand < CmdParse::Command
|
|
23
|
+
#
|
|
24
|
+
# def initialize
|
|
25
|
+
# super('sample', false)
|
|
26
|
+
# self.short_desc = "This sample command just outputs its parameters"
|
|
27
|
+
# self.description = Utils.format("Uses the global verbosity level and outputs additional " +
|
|
28
|
+
# "information when the level is set to verbose!")
|
|
29
|
+
# @username = nil
|
|
30
|
+
# self.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
31
|
+
# opts.separator "Options:"
|
|
32
|
+
# opts.on('-u', '--user USER', String,
|
|
33
|
+
# 'Specify an additional user name to output') {|@username|}
|
|
34
|
+
# end
|
|
35
|
+
# end
|
|
36
|
+
#
|
|
37
|
+
# def execute(args)
|
|
38
|
+
# if args.length == 0
|
|
39
|
+
# raise OptionParser::MissingArgument.new('ARG1 [ARG2 ...]')
|
|
40
|
+
# else
|
|
41
|
+
# puts "Command line arguments:"
|
|
42
|
+
# args.each {|arg| puts arg}
|
|
43
|
+
# if commandparser.verbosity == :verbose
|
|
44
|
+
# puts "Yeah, some additional information is always cool!"
|
|
45
|
+
# end
|
|
46
|
+
# puts "The entered username: #{@username}" if @username
|
|
47
|
+
# end
|
|
48
|
+
# end
|
|
49
|
+
#
|
|
50
|
+
# end
|
|
51
|
+
#
|
|
52
|
+
# Note the use of Utils.format in the initialize method so that the long text gets wrapped
|
|
53
|
+
# correctly! The Utils class provides some other useful methods, too!
|
|
54
|
+
#
|
|
55
|
+
# For information about which attributes are available on the webgen command parser instance have
|
|
56
|
+
# a look at Webgen::CLI::CommandParser!
|
|
57
|
+
module CLI
|
|
58
|
+
|
|
59
|
+
autoload :RunCommand, 'webgen/cli/run_command'
|
|
60
|
+
autoload :CreateCommand, 'webgen/cli/create_command'
|
|
61
|
+
|
|
62
|
+
autoload :Utils, 'webgen/cli/utils'
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# This is the command parser class used for handling the webgen command line interface. After
|
|
66
|
+
# creating an instance, the inherited #parse method can be used for parsing the command line
|
|
67
|
+
# arguments and executing the requested command.
|
|
68
|
+
class CommandParser < CmdParse::CommandParser
|
|
69
|
+
|
|
70
|
+
# The website directory. Default: the current working directory.
|
|
71
|
+
attr_reader :directory
|
|
72
|
+
|
|
73
|
+
# The verbosity level. Default: <tt>:normal</tt>
|
|
74
|
+
attr_reader :verbosity
|
|
75
|
+
|
|
76
|
+
# The log level. Default: <tt>Logger::WARN</tt>
|
|
77
|
+
attr_reader :log_level
|
|
78
|
+
|
|
79
|
+
def initialize # :nodoc:
|
|
80
|
+
super(true)
|
|
81
|
+
@directory = Dir.pwd
|
|
82
|
+
@verbosity = :normal
|
|
83
|
+
@log_level = ::Logger::WARN
|
|
84
|
+
|
|
85
|
+
self.program_name = "webgen"
|
|
86
|
+
self.program_version = Webgen::VERSION
|
|
87
|
+
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
88
|
+
opts.separator "Global options:"
|
|
89
|
+
opts.on("--directory DIR", "-d", String, "The website directory (default: the current directory)") {|@directory|}
|
|
90
|
+
opts.on("--verbose", "-v", "Print more output") { @verbosity = :verbose }
|
|
91
|
+
opts.on("--quiet", "-q", "No output") { @verbosity = :quiet }
|
|
92
|
+
opts.on("--log-level", "-l", [0, 1, 2, 3], "The logging level (0..debug, 3..error)") {|@log_level|}
|
|
93
|
+
opts.on("--log-filter", "-f", Regexp, 'Filter for logging events') {|@log_filter|}
|
|
39
94
|
end
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def self.method_missing( id, text = nil )
|
|
45
|
-
text.to_s
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class CliUtils
|
|
52
|
-
|
|
53
|
-
def self.format( content, indent = 0, width = 100 )
|
|
54
|
-
content ||= ''
|
|
55
|
-
return [content] if content.length + indent <= width
|
|
56
|
-
lines = []
|
|
57
|
-
while content.length + indent > width
|
|
58
|
-
index = content[0..(width-indent-1)].rindex(' ')
|
|
59
|
-
lines << (lines.empty? ? '' : ' '*indent) + content[0..index]
|
|
60
|
-
content = content[index+1..-1]
|
|
61
|
-
end
|
|
62
|
-
lines << ' '*indent + content unless content.strip.empty?
|
|
63
|
-
lines
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def self.headline( text, indent = 2 )
|
|
67
|
-
' '*indent + "#{Color.bold( text )}"
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def self.section( text, ljustlength = 0, indent = 4, color = :green )
|
|
71
|
-
' '*indent + "#{Color.send( color, text )}".ljust( ljustlength - indent + Color.send( color ).length + Color.reset.length )
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def self.dirinfo_output( opts, name, dirinfo )
|
|
75
|
-
ljust = 15 + opts.summary_indent.length
|
|
76
|
-
opts.separator CliUtils.section( 'Name', ljust, opts.summary_indent.length + 2 ) + "#{Color.lred( name )}"
|
|
77
|
-
|
|
78
|
-
dirinfo.infos.sort.each do |name, value|
|
|
79
|
-
desc = CliUtils.format( value, ljust )
|
|
80
|
-
opts.separator CliUtils.section( name.capitalize, ljust, opts.summary_indent.length + 2 ) + desc.shift
|
|
81
|
-
desc.each {|line| opts.separator line}
|
|
82
|
-
end
|
|
83
|
-
opts.separator ''
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
class CreateCommand < CmdParse::Command
|
|
90
|
-
|
|
91
|
-
def initialize
|
|
92
|
-
super( 'create', false )
|
|
93
|
-
self.short_desc = "Creates the basic directories and files for webgen."
|
|
94
|
-
self.description = CliUtils.format( "\nIf the global verbosity level is set to 0 or 1, the created files are listed." )
|
|
95
|
-
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
96
|
-
opts.separator "Options:"
|
|
97
|
-
opts.on( '-t', '--template TEMPLATE', Webgen::WebSiteTemplate.entries.keys, 'Specify the template which should be used' ) {|@template|}
|
|
98
|
-
opts.on( '-s', '--style STYLE', Webgen::WebSiteStyle.entries.keys, 'Specify the style which should be used' ) {|@style|}
|
|
99
|
-
opts.separator ""
|
|
100
|
-
opts.separator "Arguments:"
|
|
101
|
-
opts.separator opts.summary_indent + "DIR: the base directory for the website"
|
|
102
|
-
opts.separator ""
|
|
103
|
-
opts.separator "Available templates and styles:"
|
|
104
|
-
opts.separator ""
|
|
105
|
-
opts.separator opts.summary_indent + "#{Color.bold( 'Templates' )}"
|
|
106
|
-
Webgen::WebSiteTemplate.entries.sort.each {|name, entry| CliUtils.dirinfo_output( opts, name, entry ) }
|
|
107
|
-
opts.separator opts.summary_indent + "#{Color.bold( 'Styles' )}"
|
|
108
|
-
Webgen::WebSiteStyle.entries.sort.each {|name, entry| CliUtils.dirinfo_output( opts, name, entry ) }
|
|
109
|
-
end
|
|
110
|
-
@template = 'default'
|
|
111
|
-
@style = 'default'
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def usage
|
|
115
|
-
"Usage: #{commandparser.program_name} [global options] create [options] DIR"
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def execute( args )
|
|
119
|
-
if args.length == 0
|
|
120
|
-
raise OptionParser::MissingArgument.new( 'DIR' )
|
|
121
|
-
else
|
|
122
|
-
files = Webgen::WebSite.create_website( args[0], @template, @style )
|
|
123
|
-
if (0..1) === commandparser.verbosity
|
|
124
|
-
puts "The following files were created:"
|
|
125
|
-
puts files.collect {|f| "- " + f }.join("\n")
|
|
95
|
+
self.add_command(CmdParse::HelpCommand.new)
|
|
96
|
+
self.add_command(CmdParse::VersionCommand.new)
|
|
97
|
+
Webgen::CLI.constants.select {|c| c =~ /.+Command$/ }.each do |c|
|
|
98
|
+
self.add_command(Webgen::CLI.const_get(c).new, (c == 'RunCommand' ? true : false))
|
|
126
99
|
end
|
|
127
100
|
end
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
class UseCommand < CmdParse::Command
|
|
133
|
-
|
|
134
|
-
def initialize( cmdparser )
|
|
135
|
-
super( 'use', true )
|
|
136
|
-
self.short_desc = "Changes the used website or gallery styles"
|
|
137
|
-
|
|
138
|
-
@force = false
|
|
139
|
-
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
140
|
-
opts.separator "Options:"
|
|
141
|
-
opts.on( '-f', '--[no-]force', 'If specified, existing files are overwritten without asking.' ) {|@force|}
|
|
142
|
-
end
|
|
143
101
|
|
|
144
|
-
#
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
CliUtils.format("\nCopies the style files for the website style STYLE to the website " +
|
|
149
|
-
"directory defined by the global directory option, overwritting existing " +
|
|
150
|
-
"files. If the global verbosity level is set to 0 or 1, the copied files are listed.")
|
|
151
|
-
useWebsiteStyle.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
152
|
-
opts.separator "Available styles:"
|
|
153
|
-
opts.separator ""
|
|
154
|
-
Webgen::WebSiteStyle.entries.sort.each {|name, entry| CliUtils.dirinfo_output( opts, name, entry ) }
|
|
155
|
-
end
|
|
156
|
-
def useWebsiteStyle.usage
|
|
157
|
-
"Usage: #{commandparser.program_name} [global options] use website_style STYLE"
|
|
158
|
-
end
|
|
159
|
-
useWebsiteStyle.set_execution_block do |args|
|
|
160
|
-
if args.length == 0
|
|
161
|
-
raise OptionParser::MissingArgument.new( 'STYLE' )
|
|
162
|
-
else
|
|
163
|
-
if @force || ask_overwrite
|
|
164
|
-
files = Webgen::WebSite.use_website_style( cmdparser.directory, args[0] )
|
|
165
|
-
if (0..1) === cmdparser.verbosity
|
|
166
|
-
puts "The following files were created or overwritten:"
|
|
167
|
-
puts files.collect {|f| "- " + f }.join("\n")
|
|
168
|
-
end
|
|
169
|
-
end
|
|
102
|
+
# Utility method for sub-commands to create the correct Webgen::Website object.
|
|
103
|
+
def create_website
|
|
104
|
+
website = Webgen::Website.new(@directory) do |config|
|
|
105
|
+
config['logger.mask'] = @log_filter
|
|
170
106
|
end
|
|
107
|
+
website.logger.level = @log_level
|
|
108
|
+
website.logger.verbosity = @verbosity
|
|
109
|
+
website
|
|
171
110
|
end
|
|
172
|
-
self.add_command( useWebsiteStyle )
|
|
173
111
|
|
|
174
|
-
# Use gallery style command.
|
|
175
|
-
useGalleryStyle = CmdParse::Command.new( 'gallery_style', false )
|
|
176
|
-
useGalleryStyle.short_desc = "Changes the used gallery style"
|
|
177
|
-
useGalleryStyle.description =
|
|
178
|
-
CliUtils.format("\nCopies the gallery templates for the gallery style STYLE to the website " +
|
|
179
|
-
"directory defined by the global directory option, overwritting existing files. " +
|
|
180
|
-
"If the global verbosity level is set to 0 or 1, the copied files are listed.")
|
|
181
|
-
useGalleryStyle.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
182
|
-
opts.separator "Available styles:"
|
|
183
|
-
opts.separator ""
|
|
184
|
-
Webgen::GalleryStyle.entries.sort.each {|name, entry| CliUtils.dirinfo_output( opts, name, entry ) }
|
|
185
|
-
end
|
|
186
|
-
def useGalleryStyle.usage
|
|
187
|
-
"Usage: #{commandparser.program_name} [global options] use gallery_style STYLE"
|
|
188
|
-
end
|
|
189
|
-
useGalleryStyle.set_execution_block do |args|
|
|
190
|
-
if args.length == 0
|
|
191
|
-
raise OptionParser::MissingArgument.new( 'STYLE' )
|
|
192
|
-
else
|
|
193
|
-
if @force || ask_overwrite
|
|
194
|
-
files = Webgen::WebSite.use_gallery_style( cmdparser.directory, args[0] )
|
|
195
|
-
if (0..1) === cmdparser.verbosity
|
|
196
|
-
puts "The following files were created or overwritten:"
|
|
197
|
-
puts files.collect {|f| "- " + f }.join("\n")
|
|
198
|
-
end
|
|
199
|
-
end
|
|
200
|
-
end
|
|
201
|
-
end
|
|
202
|
-
self.add_command( useGalleryStyle )
|
|
203
|
-
|
|
204
|
-
# Use sipttra style command.
|
|
205
|
-
useSipttraStyle = CmdParse::Command.new( 'sipttra_style', false )
|
|
206
|
-
useSipttraStyle.short_desc = "Changes the used sipttra style"
|
|
207
|
-
useSipttraStyle.description =
|
|
208
|
-
CliUtils.format("\nCopies the sipttra styles files for the sipttra style STYLE to the website " +
|
|
209
|
-
"directory defined by the global directory option, overwritting existing files. " +
|
|
210
|
-
"If the global verbosity level is set to 0 or 1, the copied files are listed.")
|
|
211
|
-
useSipttraStyle.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
212
|
-
opts.separator "Available styles:"
|
|
213
|
-
opts.separator ""
|
|
214
|
-
Webgen::SipttraStyle.entries.sort.each {|name, entry| CliUtils.dirinfo_output( opts, name, entry ) }
|
|
215
|
-
end
|
|
216
|
-
def useSipttraStyle.usage
|
|
217
|
-
"Usage: #{commandparser.program_name} [global options] use sipttra_style STYLE"
|
|
218
|
-
end
|
|
219
|
-
useSipttraStyle.set_execution_block do |args|
|
|
220
|
-
if args.length == 0
|
|
221
|
-
raise OptionParser::MissingArgument.new( 'STYLE' )
|
|
222
|
-
else
|
|
223
|
-
if @force || ask_overwrite
|
|
224
|
-
files = Webgen::WebSite.use_sipttra_style( cmdparser.directory, args[0] )
|
|
225
|
-
if (0..1) === cmdparser.verbosity
|
|
226
|
-
puts "The following files were created or overwritten:"
|
|
227
|
-
puts files.collect {|f| "- " + f }.join("\n")
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
self.add_command( useSipttraStyle )
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
#######
|
|
236
|
-
private
|
|
237
|
-
#######
|
|
238
|
-
|
|
239
|
-
def ask_overwrite
|
|
240
|
-
printf "Existing files may get overwritten, procede (yes/no)? : "
|
|
241
|
-
$stdin.gets =~ /y|yes/
|
|
242
112
|
end
|
|
243
113
|
|
|
244
114
|
end
|
|
245
115
|
|
|
246
|
-
|
|
247
|
-
class ShowCommand < CmdParse::Command
|
|
248
|
-
|
|
249
|
-
def initialize( cmdparser )
|
|
250
|
-
super( 'show', true )
|
|
251
|
-
self.short_desc = "Shows various information"
|
|
252
|
-
|
|
253
|
-
# Show plugins command
|
|
254
|
-
showPlugins = CmdParse::Command.new( 'plugins', false )
|
|
255
|
-
showPlugins.short_desc = "Shows the available plugins"
|
|
256
|
-
showPlugins.set_execution_block do |args|
|
|
257
|
-
puts "List of loaded plugins:"
|
|
258
|
-
headers = Hash.new {|h,k| h[k] = (k.nil? ? "Other Plugins" : k.gsub(/([A-Z][a-z])/, ' \1').strip) }
|
|
259
|
-
|
|
260
|
-
header = ''
|
|
261
|
-
cmdparser.website.manager.plugin_classes.sort {|a, b| a.plugin_name <=> b.plugin_name }.each do |plugin|
|
|
262
|
-
newHeader = headers[plugin.plugin_name[/^.*?(?=\/)/]]
|
|
263
|
-
unless newHeader == header
|
|
264
|
-
puts "\n" + CliUtils.headline( newHeader )
|
|
265
|
-
header = newHeader
|
|
266
|
-
end
|
|
267
|
-
puts CliUtils.section( plugin.plugin_name[/\w+$/], 33 ) + CliUtils.format( plugin.config.infos[:summary], 33 ).join("\n")
|
|
268
|
-
end
|
|
269
|
-
end
|
|
270
|
-
self.add_command( showPlugins )
|
|
271
|
-
|
|
272
|
-
# Show config command
|
|
273
|
-
showConfig = CmdParse::Command.new( 'config', false )
|
|
274
|
-
showConfig.short_desc = "Shows information like the parameters for all or the matched plugins"
|
|
275
|
-
showConfig.description =
|
|
276
|
-
CliUtils.format( "\nIf no argument is provided, all plugins and their information are listed. If " +
|
|
277
|
-
"an argument is specified, all plugin names that match the argument are listed." ).join("\n")
|
|
278
|
-
showConfig.set_execution_block do |args|
|
|
279
|
-
puts "List of plugin informations:"
|
|
280
|
-
puts
|
|
281
|
-
|
|
282
|
-
cmdparser.website.manager.plugins.sort {|a, b| a[0] <=> b[0] }.each do |name, plugin|
|
|
283
|
-
next if args.length > 0 && /#{args[0]}/i !~ name
|
|
284
|
-
|
|
285
|
-
config = plugin.class.config
|
|
286
|
-
puts CliUtils.headline( name )
|
|
287
|
-
ljust = 25
|
|
288
|
-
|
|
289
|
-
puts CliUtils.section( 'Summary', ljust ) + CliUtils.format( config.infos[:summary], ljust ).join("\n") if config.infos[:summary]
|
|
290
|
-
puts CliUtils.section( 'Author', ljust ) + CliUtils.format( config.infos[:author], ljust ).join("\n") if config.infos[:author]
|
|
291
|
-
puts CliUtils.section( 'Description', ljust ) + CliUtils.format( config.infos[:description], ljust ).join("\n") if config.infos[:description]
|
|
292
|
-
puts CliUtils.section( 'Tag names', ljust ) + plugin.tags.join(", ") if plugin.respond_to?( :tags )
|
|
293
|
-
puts CliUtils.section( 'Handles paths', ljust ) + plugin.path_patterns.collect {|r,f| f}.inspect if plugin.respond_to?( :path_patterns )
|
|
294
|
-
puts CliUtils.section( 'Dependencies', ljust ) + config.dependencies.join(', ') if !config.dependencies.empty?
|
|
295
|
-
|
|
296
|
-
if !config.params.empty?
|
|
297
|
-
puts "\n" + CliUtils.section( 'Parameters' )
|
|
298
|
-
config.params.sort.each do |name, item|
|
|
299
|
-
print "\n" + CliUtils.section( 'Parameter', ljust, 6 )
|
|
300
|
-
puts Color.lred( item.name ) + ": " + Color.lblue( plugin.instance_eval {param( name )}.inspect ) +
|
|
301
|
-
" (" + item.default.inspect + ")"
|
|
302
|
-
puts CliUtils.section( 'Description', ljust, 6 ) + CliUtils.format( item.description, ljust ).join("\n")
|
|
303
|
-
end
|
|
304
|
-
end
|
|
305
|
-
|
|
306
|
-
otherinfos = config.infos.select {|k,v| ![:name, :author, :summary, :description, :tags, :path_patterns].include?( k ) }
|
|
307
|
-
puts "\n" +CliUtils.section( 'Other Information' ) unless otherinfos.empty?
|
|
308
|
-
otherinfos.each {|name, value| puts CliUtils.section( name.to_s.tr('_', ' '), ljust, 6 ) + value.inspect }
|
|
309
|
-
|
|
310
|
-
puts
|
|
311
|
-
end
|
|
312
|
-
end
|
|
313
|
-
self.add_command( showConfig )
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
end
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
class CheckCommand < CmdParse::Command
|
|
320
|
-
|
|
321
|
-
def initialize( cmdparser )
|
|
322
|
-
super( 'check', true )
|
|
323
|
-
self.short_desc = "Checks things like validity of the config file or the availability of optional libraries"
|
|
324
|
-
|
|
325
|
-
# Check configuration file command
|
|
326
|
-
checkConfig = CmdParse::Command.new( 'config', false )
|
|
327
|
-
checkConfig.short_desc = "Checks the validity of the configuration and outputs the used options"
|
|
328
|
-
checkConfig.set_execution_block do |args|
|
|
329
|
-
begin
|
|
330
|
-
if File.exists?( File.join( cmdparser.directory, 'config.yaml' ) )
|
|
331
|
-
print CliUtils.section( "Checking configuration file syntax...", 50, 0, :bold )
|
|
332
|
-
config_file = ConfigurationFile.new( File.join( cmdparser.directory, 'config.yaml' ) )
|
|
333
|
-
puts Color.green( 'OK' )
|
|
334
|
-
|
|
335
|
-
puts CliUtils.section( "Checking parameters...", 0, 0, :bold )
|
|
336
|
-
config_file.config.each do |plugin_name, params|
|
|
337
|
-
params.each do |param_name, value|
|
|
338
|
-
print CliUtils.section( "#{plugin_name}:#{param_name}", 50, 2, :reset )
|
|
339
|
-
if cmdparser.website.manager.plugin_class_for_name( plugin_name ).nil?
|
|
340
|
-
puts Color.lred( 'NOT OK' ) + ': no such plugin'
|
|
341
|
-
else
|
|
342
|
-
begin
|
|
343
|
-
cmdparser.website.manager.param_for_plugin( plugin_name, param_name )
|
|
344
|
-
puts Color.green( 'OK' )
|
|
345
|
-
rescue PluginParamNotFound => e
|
|
346
|
-
puts Color.lred( 'NOT OK' ) + ': no such parameter'
|
|
347
|
-
end
|
|
348
|
-
end
|
|
349
|
-
end
|
|
350
|
-
end
|
|
351
|
-
else
|
|
352
|
-
print CliUtils.section( "No configuration file found!", 50, 0, :bold )
|
|
353
|
-
end
|
|
354
|
-
rescue ConfigurationFileInvalid => e
|
|
355
|
-
puts Color.lred( 'NOT OK' ) + ': ' + e.message
|
|
356
|
-
end
|
|
357
|
-
end
|
|
358
|
-
self.add_command( checkConfig, true )
|
|
359
|
-
|
|
360
|
-
# Check optional libraries
|
|
361
|
-
checkLibs = CmdParse::Command.new( 'libs', false )
|
|
362
|
-
checkLibs.short_desc = "Checks the availability of optional libraries used by plugins"
|
|
363
|
-
checkLibs.set_execution_block do |args|
|
|
364
|
-
puts CliUtils.format( "List of optional libraries (the info line specifies which functionality will be available " +
|
|
365
|
-
"if the needed gems are installed):" ).join("\n")
|
|
366
|
-
puts
|
|
367
|
-
|
|
368
|
-
cmdparser.website.manager.plugin_loaders.each do |loader|
|
|
369
|
-
loader.optional_parts.sort.each do |name, options|
|
|
370
|
-
puts CliUtils.headline( name )
|
|
371
|
-
puts CliUtils.section( 'Info', 25 ) + CliUtils.format( options[:info], 25 ).join("\n")
|
|
372
|
-
puts CliUtils.section( 'Needed gems', 25 ) + options[:needed_gems].join( ', ' )
|
|
373
|
-
puts CliUtils.section( 'Loaded', 25 ) + ( options[:loaded] ? Color.green( 'yes' ) : Color.lred( 'no' ) )
|
|
374
|
-
puts CliUtils.section( 'Error message', 25 ) + CliUtils.format( options[:error_msg], 25 ).join("\n") unless options[:loaded]
|
|
375
|
-
puts
|
|
376
|
-
end
|
|
377
|
-
end
|
|
378
|
-
end
|
|
379
|
-
self.add_command( checkLibs )
|
|
380
|
-
end
|
|
381
|
-
|
|
382
|
-
end
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
class CommandParser < CmdParse::CommandParser
|
|
386
|
-
|
|
387
|
-
VERBOSITY_UNUSED = -1
|
|
388
|
-
|
|
389
|
-
attr_reader :directory
|
|
390
|
-
attr_reader :website
|
|
391
|
-
attr_reader :verbosity
|
|
392
|
-
attr_reader :config_file
|
|
393
|
-
|
|
394
|
-
def initialize
|
|
395
|
-
super( true )
|
|
396
|
-
@directory = Dir.pwd
|
|
397
|
-
@verbosity = VERBOSITY_UNUSED
|
|
398
|
-
|
|
399
|
-
self.program_name = "webgen"
|
|
400
|
-
self.program_version = Webgen::VERSION
|
|
401
|
-
self.options = CmdParse::OptionParserWrapper.new do |opts|
|
|
402
|
-
opts.separator "Global options:"
|
|
403
|
-
opts.on( "--directory DIR", "-d", String, "The website directory, if none specified, current directory is used." ) {|@directory|}
|
|
404
|
-
opts.on( "--verbosity LEVEL", "-V", Integer, "The verbosity level (0-3)" ) {|@verbosity|}
|
|
405
|
-
end
|
|
406
|
-
|
|
407
|
-
# Run command
|
|
408
|
-
run = CmdParse::Command.new( 'run', false )
|
|
409
|
-
run.short_desc = "Runs webgen, ie. generates the HTML files"
|
|
410
|
-
run.description = CliUtils.format("\nWith no arguments, renders the whole site. If file names are " +
|
|
411
|
-
"specified (don't include the path/to/src/ part), only those are rendered." )
|
|
412
|
-
run.set_execution_block do |args|
|
|
413
|
-
@website.render( args )
|
|
414
|
-
end
|
|
415
|
-
self.add_command( run, true )
|
|
416
|
-
|
|
417
|
-
self.add_command( CreateCommand.new )
|
|
418
|
-
self.add_command( ShowCommand.new( self ) )
|
|
419
|
-
self.add_command( UseCommand.new( self ) )
|
|
420
|
-
self.add_command( CmdParse::HelpCommand.new )
|
|
421
|
-
self.add_command( CmdParse::VersionCommand.new )
|
|
422
|
-
self.add_command( CheckCommand.new( self ) )
|
|
423
|
-
end
|
|
424
|
-
|
|
425
|
-
def param_for_plugin( plugin_name, param )
|
|
426
|
-
if [plugin_name, param] == ['Core/Configuration', 'loggerLevel'] && @verbosity != VERBOSITY_UNUSED
|
|
427
|
-
@verbosity
|
|
428
|
-
elsif @config_file
|
|
429
|
-
@config_file.param_for_plugin( plugin_name, param )
|
|
430
|
-
else
|
|
431
|
-
Webgen::PluginParamValueNotFound
|
|
432
|
-
end
|
|
433
|
-
end
|
|
434
|
-
|
|
435
|
-
def parse( argv = ARGV )
|
|
436
|
-
super do |level, cmd_name|
|
|
437
|
-
if level == 0
|
|
438
|
-
@config_file = Webgen::WebSite.load_config_file( @directory )
|
|
439
|
-
@website = Webgen::WebSite.new( @directory, self )
|
|
440
|
-
@website.manager.init
|
|
441
|
-
@website.manager.plugins.
|
|
442
|
-
each {|name,plugin| self.add_command( plugin ) if plugin.kind_of?( Webgen::CommandPlugin ) }
|
|
443
|
-
end
|
|
444
|
-
end
|
|
445
|
-
end
|
|
446
|
-
|
|
447
|
-
end
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
# Main program for the webgen CLI.
|
|
451
|
-
def self.cli_main
|
|
452
|
-
Color.colorify if $stdout.isatty && !Config::CONFIG['arch'].include?( 'mswin32' )
|
|
453
|
-
cmdparser = CommandParser.new
|
|
454
|
-
cmdparser.parse
|
|
455
|
-
end
|
|
456
|
-
|
|
457
116
|
end
|