# -*- ruby -*- # # $Id$ # # webgen: template based static website generator # Copyright (C) 2004 Thomas Leitner # # This program is free software; you can redistribute it and/or modify it under the terms of the GNU # General Public License as published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along with this program; if not, # write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # begin require 'rubygems' require 'rake/gempackagetask' rescue Exception end require 'fileutils' require 'rake/clean' require 'rake/packagetask' require 'rake/rdoctask' require 'rake/testtask' # General things ############################################################## $:.push File.expand_path( File.join( File.dirname(__FILE__), 'lib' ) ) require 'webgen/config' require 'webgen/rake/webgentask' PKG_NAME = "webgen" PKG_VERSION = Webgen::VERSION.join( '.' ) PKG_FULLNAME = PKG_NAME + "-" + PKG_VERSION PKG_SUMMARY = Webgen::SUMMARY PKG_DESCRIPTION = Webgen::DESCRIPTION SRC_RB = FileList['lib/**/*.rb'] # The default task is run if rake is given no explicit arguments. desc "Default Task" task :default => :test # End user tasks ################################################################ desc "Prepares for installation" task :prepare do ruby "setup.rb config" ruby "setup.rb setup" end desc "Installs the package #{PKG_NAME}" task :install => [:prepare] do ruby "setup.rb install" end CLEAN.exclude( 'doc/src/documentation/plugins/core' ) CLEAN.exclude( 'doc/output/documentation/plugins/core' ) task :clean do ruby "setup.rb clean" end desc "Creates the whole documentation" task :doc => [:rdoc, :webgen] Webgen::Rake::WebgenTask.new do |webgen| webgen.directory = File.join( File.dirname( __FILE__ ), 'doc' ) webgen.clobber_outdir = true end task :webgen => [:create_examples] rd = Rake::RDocTask.new do |rdoc| rdoc.rdoc_dir = 'doc/output/rdoc' rdoc.title = PKG_NAME rdoc.options << '--line-numbers' << '--inline-source' << '-m README' rdoc.rdoc_files.include( 'README' ) rdoc.rdoc_files.include( 'lib/**/*.rb' ) end CLOBBER << "doc/examples" CLOBBER << "doc/src/examples/website_templates" CLOBBER << "doc/src/examples/website_styles" CLOBBER << "doc/src/examples/gallery_styles" CLOBBER << "doc/src/examples/sipttra_styles" CLOBBER << "doc/plugin/gallery" desc "Creates the files for the examples section of the docu" task :create_examples do require 'webgen/website' # website templates data = {} data[:dirname] = 'Website Templates' data[:desc]= "h2. List of website templates The website templates open in an iframe when you use the menu items. Use the links provided below to open the website templates directly (fullscreen). Following is the list of all available website templates: " data[:entries] = Webgen::WebSiteTemplate.entries create_examples( 'website_templates', data, nil, 'default' ) # website styles data = {} data[:dirname] = 'Website Styles' data[:desc]= "h2. List of website styles The website styles open in an iframe when you use the menu items. Use the links provided below to open the website styles directly (fullscreen). Following is the list of all available website styles: " data[:entries] = Webgen::WebSiteStyle.entries create_examples( 'website_styles', data, 'project', nil ) # gallery styles Webgen::GalleryStyle.entries.each do |name, entry| base_dir = "doc/src/examples/gallery_styles/#{name}" files_mtime = (entry.files + entry.plugin_files).collect {|f| File.mtime( f) }.max dir_mtime = File.mtime( base_dir ) rescue Time.parse("1970-1-1") if dir_mtime < files_mtime puts "Creating example files for gallery style '#{name}'..." mkdir_p( "doc/plugin/gallery/#{name}" ) FileUtils.cp( entry.plugin_files, "doc/plugin/gallery/#{name}" ) mkdir_p( base_dir ) FileUtils.touch( base_dir ) entry.copy_to( base_dir ) additional = case name when 'slides' then "layouter: slides\nthumbnailResizeMethod: :cropped" else '' end File.open( File.join( base_dir, "#{name}.gallery" ), 'w+' ) do |f| f.write("title: index images: ../../images/* imagesPerPage: 8 mainPageMetaInfo: inMenu: true #{additional} --- ../../images/image01.jpg: title: Chinese Garden description: This picture show the Chinese Garden located in the outskirts of Vienna (Austria). ../../images/image02.jpg: title: Goldenes Dach description: This is the landmark of Innsbruck (Tyrol, Austria), called the 'Goldene Dach' (golden roof). ../../images/image03.jpg: title: Mountains in Innsbruck description: A view from the NordPark in Innsbruck. ../../images/image04.jpg: title: Kristallwelten 1 description: The entry to the 'Kristallwelten' of Swarovski in Innsbruck. ../../images/image05.jpg: title: Kristallwelten 2 description: On the roof of the building. ../../images/image06.jpg: title: Kristallwelten 3 description: Some crystals. ../../images/image07.jpg: title: Minimundus 1 description: A french castle ../../images/image08.jpg: title: Minimundus 2 description: A small copy of the Sagrada Familia of Barcelona. ../../images/image09.jpg: title: Minimundus 3 description: The Stephansdom in Vienna. ../../images/image10.jpg: title: Minimundus 4 description: Overview of Minimundus, a place with smaller versions of famous buildings. ../../images/image11.jpg: title: Velden description: Photo from Velden, Wörtersee, Carinthia, Austria ../../images/image12.jpg: title: Stockholm 1 description: A 300-year-old ship, the Wasa, located in the Wasamuseet in Stockholm. ../../images/image13.jpg: title: Stockholm 2 description: A fort near Stockholm. ../../images/image14.jpg: title: Stockholm 3 description: Overview of Gamla Stan (old town centre of Stockholm) ../../images/image15.jpg: title: Stockholm 4 description: View from a bridge in the direction of Gamla Stan ../../images/image16.jpg: title: Zakynthos 1 description: An isle that looks like a turtle ../../images/image17.jpg: title: Zakynthos 2 description: The oldest olive tree of Zakynthos. ../../images/image18.jpg: title: Zakynthos 3 description: The Navagio ship wreck, very famous Greek tourist destination. ") end end end data = {} data[:dirname] = 'Gallery Styles' data[:desc]= "h2. List of gallery styles The gallery style example pages open in an iframe when you use the menu items. Use the links provided below to open the gallery style example pages directly (fullscreen). Following is the list of all available gallery styles: " data[:entries] = Webgen::GalleryStyle.entries create_example_index( "doc/src/examples/gallery_styles/index.page", data ) # sipttra styles Webgen::SipttraStyle.entries.each do |name, entry| base_dir = "doc/src/examples/sipttra_styles/#{name}" files_mtime = entry.files.collect {|f| File.mtime( f ) }.max dir_mtime = File.mtime( base_dir ) rescue Time.parse("1970-1-1") if dir_mtime < files_mtime puts "Creating example files for sipttra style '#{name}'..." mkdir_p( base_dir ) FileUtils.touch( base_dir ) entry.copy_to( base_dir ) File.open( File.join( base_dir, "index.todo" ), 'w+' ) do |f| f.write("--- webgen-metainfo: template: sipttra.template --- ###### Milestones ###### * Feb07 (2007-02-28) Bug fixes and small enhancements - include patches/requests created since 0.4.1 release - add support for sipttra files, the Simple Plain Text Tracker * F: Ideas and todo items for future versions This milestone holds all ideas/todo items/requests which are implemented some time in the future. ###### Implementation (open) ###### * T002 [F] add localization support for all files See also FR#7891 * T003 [F] add additional tests for sipttra implementation ## Implementation (closed) ## * T004 [Feb07] use HTML as default format for templates See also FR#7893 * T006 [Feb07] add parameter for not showing index files in breadcrumb trail See also PATCH#7942 * T007 [Feb07] implement a plugin for storing/accessing global variables * T001 [Feb07] add support for sipttra files ###### Bugs (open) ###### * T013 [Feb07] fix TreeWalker (write mail to mailing list and ask what should be done with it) ## Bugs (closed) ## * T005 [Feb07] check all styles for correctly selected menu items style issues because of new span element when File/DefaultHandler:linkToCurrentPage is false * T009 [Feb07] PluginManager#init: log typo for 'creating plugin of class...' * T012 [Feb07] update copyright notices for included website templates See also Bug#8725 * T008 [Feb07] PluginLoader shouldn't load plugins that are already loaded in the DEFAULT_WRAPPER_MODULE When site plugins use the load_plugin command to load plugins that are shipped with webgen and loaded by default, some plugins don't work correctly as plugin classes get defined twice with different oids. ###### Documentation (open) ###### * T011 [Feb07] add example section for sipttra style files ## Documentation (closed) ## * T010 [Feb07] add some example sites It was requested that one should be able to download some zipped examples sites from the examples section showing basic use cases for webgen. ") end File.open( File.join( base_dir, "default.template" ), 'w+' ) do |f| f.write( '--- template: ~ ---