webgen 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +870 -0
- data/Rakefile +37 -36
- data/VERSION +1 -1
- data/data/webgen/resources.yaml +2 -2
- data/data/webgen/webgui/app.rb +11 -0
- data/data/webgen/webgui/controller/main.rb +30 -26
- data/data/webgen/webgui/{view/page.xhtml → layout/default.xhtml} +8 -8
- data/data/webgen/webgui/start.rb +9 -0
- data/data/webgen/webgui/view/create_website.xhtml +6 -14
- data/data/webgen/webgui/view/manage_website.xhtml +2 -2
- data/data/webgen/website_bundles/default/README +6 -0
- data/data/webgen/website_bundles/default/src/index.page +15 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/1024px/src/images/background.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/bg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/front.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas00/src/images/menubg2.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/bg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/images/front.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas01/src/print.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/bodybg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/contbg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/footerbg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient1.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient2.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/blinkarrow.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/bodybg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/contentbg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/entrybg.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/flash2.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globe.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/globebottom.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/linkarrow.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/menuhover.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/bodybg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas05/src/images/front.png +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.css +6 -4
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/default.template +2 -2
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/bodybg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/boxbg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/greypx.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/header.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/innerbg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/leaves.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas06/src/images/tabs.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/browserfix.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/bodybg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas07/src/images/sidebarbg.gif +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas08/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas08/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/default.template +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-black.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-green.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-orange.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-purple.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg-red.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/bodybg.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/footerbg.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-black.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-green.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-orange.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-purple.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover-red.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/andreas09/src/images/menuhover.jpg +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/simple/README +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.css +0 -0
- data/data/webgen/{website_styles → website_bundles/style}/simple/src/default.template +0 -0
- data/data/webgen/website_skeleton/README +1 -1
- data/data/webgen/website_skeleton/config.yaml +5 -4
- data/doc/contentprocessor/blocks.page +43 -10
- data/doc/contentprocessor/builder.page +1 -1
- data/doc/contentprocessor/erb.page +12 -11
- data/doc/contentprocessor/redcloth.page +3 -1
- data/doc/extensions.page +3 -3
- data/doc/faq.page +13 -10
- data/doc/getting_started.page +12 -15
- data/doc/index.page +7 -1
- data/doc/manual.page +78 -27
- data/doc/reference_configuration.page +166 -3
- data/doc/reference_website_styles.page +28 -0
- data/doc/source/filesystem.page +39 -0
- data/doc/source/tararchive.page +40 -0
- data/doc/tag/tikz.page +2 -1
- data/doc/webgen_page_format.page +13 -12
- data/doc/website_styles.metainfo +8 -0
- data/lib/webgen/blackboard.rb +2 -2
- data/lib/webgen/cache.rb +4 -4
- data/lib/webgen/cli.rb +29 -16
- data/lib/webgen/cli/apply_command.rb +66 -0
- data/lib/webgen/cli/create_command.rb +22 -16
- data/lib/webgen/cli/utils.rb +23 -0
- data/lib/webgen/cli/webgui_command.rb +31 -16
- data/lib/webgen/configuration.rb +8 -6
- data/lib/webgen/contentprocessor.rb +4 -5
- data/lib/webgen/contentprocessor/blocks.rb +2 -0
- data/lib/webgen/contentprocessor/builder.rb +6 -3
- data/lib/webgen/contentprocessor/erb.rb +6 -3
- data/lib/webgen/contentprocessor/erubis.rb +7 -6
- data/lib/webgen/contentprocessor/haml.rb +6 -3
- data/lib/webgen/contentprocessor/rdoc.rb +0 -1
- data/lib/webgen/contentprocessor/redcloth.rb +3 -1
- data/lib/webgen/context.rb +73 -0
- data/lib/webgen/context/nodes.rb +36 -0
- data/lib/webgen/coreext.rb +3 -2
- data/lib/webgen/default_config.rb +3 -1
- data/lib/webgen/deprecated.rb +53 -0
- data/lib/webgen/node.rb +24 -19
- data/lib/webgen/output.rb +50 -7
- data/lib/webgen/page.rb +45 -36
- data/lib/webgen/path.rb +1 -1
- data/lib/webgen/source.rb +32 -4
- data/lib/webgen/source/resource.rb +3 -3
- data/lib/webgen/source/stacked.rb +1 -1
- data/lib/webgen/source/tararchive.rb +73 -0
- data/lib/webgen/sourcehandler.rb +4 -4
- data/lib/webgen/sourcehandler/base.rb +36 -24
- data/lib/webgen/sourcehandler/copy.rb +1 -1
- data/lib/webgen/sourcehandler/feed.rb +2 -2
- data/lib/webgen/sourcehandler/fragment.rb +1 -1
- data/lib/webgen/sourcehandler/metainfo.rb +15 -6
- data/lib/webgen/sourcehandler/page.rb +9 -5
- data/lib/webgen/sourcehandler/virtual.rb +44 -7
- data/lib/webgen/tag/base.rb +19 -13
- data/lib/webgen/tag/link.rb +1 -0
- data/lib/webgen/version.rb +1 -1
- data/lib/webgen/webgentask.rb +15 -13
- data/lib/webgen/website.rb +42 -11
- data/lib/webgen/websiteaccess.rb +1 -1
- data/lib/webgen/websitemanager.rb +61 -66
- data/man/man1/webgen.1 +4 -0
- data/misc/default.css +13 -0
- data/misc/default.template +1 -1
- data/misc/htmldoc.metainfo +2 -1
- data/misc/style.page +33 -0
- data/test/test_cli.rb +1 -7
- data/test/test_common_sitemap.rb +2 -2
- data/test/test_contentprocessor_blocks.rb +14 -1
- data/test/test_contentprocessor_builder.rb +3 -1
- data/test/test_contentprocessor_erb.rb +3 -2
- data/test/test_contentprocessor_erubis.rb +3 -3
- data/test/test_contentprocessor_fragments.rb +3 -3
- data/test/test_contentprocessor_haml.rb +3 -2
- data/test/test_contentprocessor_maruku.rb +3 -3
- data/test/test_contentprocessor_rdiscount.rb +1 -1
- data/test/test_contentprocessor_rdoc.rb +1 -1
- data/test/test_contentprocessor_redcloth.rb +9 -2
- data/test/test_contentprocessor_sass.rb +1 -1
- data/test/test_contentprocessor_tags.rb +1 -1
- data/test/{test_contentprocessor_context.rb → test_context.rb} +9 -7
- data/test/test_node.rb +27 -21
- data/test/test_page.rb +4 -4
- data/test/test_source_tararchive.rb +65 -0
- data/test/test_sourcehandler_fragment.rb +1 -1
- data/test/test_sourcehandler_memory.rb +6 -6
- data/test/test_sourcehandler_metainfo.rb +34 -13
- data/test/test_sourcehandler_page.rb +8 -0
- data/test/test_sourcehandler_virtual.rb +51 -12
- data/test/test_tag_breadcrumbtrail.rb +4 -4
- data/test/test_tag_coderay.rb +1 -1
- data/test/test_tag_date.rb +1 -1
- data/test/test_tag_executecommand.rb +1 -1
- data/test/test_tag_includefile.rb +3 -3
- data/test/test_tag_langbar.rb +6 -6
- data/test/test_tag_link.rb +8 -2
- data/test/test_tag_menu.rb +9 -9
- data/test/test_tag_metainfo.rb +1 -1
- data/test/test_tag_relocatable.rb +1 -1
- data/test/test_tag_sitemap.rb +1 -1
- data/test/test_tag_tikz.rb +2 -2
- data/test/test_website.rb +17 -0
- data/test/test_websitemanager.rb +16 -21
- metadata +146 -187
- data/data/webgen/website_templates/default/README +0 -6
- data/data/webgen/website_templates/default/src/index.page +0 -8
- data/data/webgen/website_templates/project/README +0 -5
- data/data/webgen/website_templates/project/src/about.page +0 -12
- data/data/webgen/website_templates/project/src/download.page +0 -15
- data/data/webgen/website_templates/project/src/features.page +0 -8
- data/data/webgen/website_templates/project/src/index.page +0 -9
- data/data/webgen/website_templates/project/src/screenshots.page +0 -18
- data/lib/webgen/contentprocessor/context.rb +0 -89
data/Rakefile
CHANGED
@@ -7,6 +7,8 @@ begin
|
|
7
7
|
rescue LoadError
|
8
8
|
end
|
9
9
|
|
10
|
+
require 'rdoc/task'
|
11
|
+
|
10
12
|
begin
|
11
13
|
require 'rubyforge'
|
12
14
|
rescue LoadError
|
@@ -17,16 +19,10 @@ begin
|
|
17
19
|
rescue LoadError
|
18
20
|
end
|
19
21
|
|
20
|
-
begin
|
21
|
-
require 'dcov'
|
22
|
-
rescue LoadError
|
23
|
-
end
|
24
|
-
|
25
22
|
require 'fileutils'
|
26
23
|
require 'rake/clean'
|
27
24
|
require 'rake/testtask'
|
28
25
|
require 'rake/packagetask'
|
29
|
-
require 'rake/rdoctask'
|
30
26
|
|
31
27
|
$:.unshift('lib')
|
32
28
|
require 'webgen/webgentask'
|
@@ -60,16 +56,23 @@ Webgen::WebgenTask.new('htmldoc') do |site|
|
|
60
56
|
['/', "Webgen::Source::FileSystem", 'misc', 'htmldoc.metainfo'],
|
61
57
|
['/', "Webgen::Source::FileSystem", 'misc', 'htmldoc.virtual'],
|
62
58
|
['/', "Webgen::Source::FileSystem", 'misc', 'images/**/*']]
|
59
|
+
prefix = "webgen-website-bundle-"
|
60
|
+
config['resources'].select {|name, data| name =~ /^#{prefix}style/}.each do |name, data|
|
61
|
+
config['sources'] <<
|
62
|
+
["/website_styles/#{name.sub(prefix, '')}", "Webgen::Source::FileSystem", 'misc', 'style.page']
|
63
|
+
config['sources'] <<
|
64
|
+
["/website_styles/#{name.sub(prefix, '')}", 'Webgen::Source::Resource', name, '/src/**', '/src']
|
65
|
+
end
|
63
66
|
config['output'] = ['Webgen::Output::FileSystem', 'htmldoc']
|
64
67
|
end
|
65
68
|
end
|
66
69
|
|
67
|
-
rd =
|
70
|
+
rd = RDoc::Task.new do |rdoc|
|
68
71
|
rdoc.rdoc_dir = 'htmldoc/rdoc'
|
69
72
|
rdoc.title = 'webgen'
|
70
|
-
rdoc.main = '
|
71
|
-
rdoc.options << '--line-numbers' << '--
|
72
|
-
rdoc.rdoc_files.include('lib
|
73
|
+
rdoc.main = 'lib/webgen/website.rb'
|
74
|
+
rdoc.options << '--line-numbers' << '--all'
|
75
|
+
rdoc.rdoc_files.include('lib')
|
73
76
|
end
|
74
77
|
|
75
78
|
tt = Rake::TestTask.new do |test|
|
@@ -156,23 +159,23 @@ EOF
|
|
156
159
|
#### Dependencies, requirements and files
|
157
160
|
|
158
161
|
s.files = PKG_FILES.to_a
|
159
|
-
s.add_dependency('cmdparse', '2.0.2')
|
162
|
+
s.add_dependency('cmdparse', '>= 2.0.2')
|
160
163
|
s.add_dependency('maruku', '0.5.9')
|
161
|
-
s.add_dependency('facets', '2.4.
|
162
|
-
s.
|
163
|
-
s.
|
164
|
-
s.
|
165
|
-
s.add_development_dependency('rcov', '0.8.1.2.0')
|
166
|
-
s.add_development_dependency('
|
167
|
-
s.add_development_dependency('
|
168
|
-
s.add_development_dependency('
|
169
|
-
s.add_development_dependency('
|
170
|
-
s.add_development_dependency('
|
171
|
-
s.add_development_dependency('
|
172
|
-
s.add_development_dependency('
|
173
|
-
s.add_development_dependency('
|
174
|
-
s.add_development_dependency('
|
175
|
-
s.add_development_dependency('
|
164
|
+
s.add_dependency('facets', '2.4.5')
|
165
|
+
s.add_development_dependency('rake', '>= 0.8.3')
|
166
|
+
s.add_development_dependency('ramaze', '>= 2009.04')
|
167
|
+
s.add_development_dependency('launchy', '>= 0.3.2')
|
168
|
+
s.add_development_dependency('rcov', '>= 0.8.1.2.0')
|
169
|
+
s.add_development_dependency('rubyforge', '>= 1.0.0')
|
170
|
+
s.add_development_dependency('RedCloth', '>= 4.1.9')
|
171
|
+
s.add_development_dependency('haml', '>= 2.0.9')
|
172
|
+
s.add_development_dependency('builder', '>= 2.1.0')
|
173
|
+
s.add_development_dependency('rdoc', '>= 2.4.2')
|
174
|
+
s.add_development_dependency('coderay', '>= 0.7.4.214')
|
175
|
+
s.add_development_dependency('feedtools', '>= 0.2.29')
|
176
|
+
s.add_development_dependency('erubis', '>= 2.6.2')
|
177
|
+
s.add_development_dependency('rdiscount', '>= 1.2.9')
|
178
|
+
s.add_development_dependency('archive-tar-minitar', '>= 0.5.2')
|
176
179
|
|
177
180
|
s.require_path = 'lib'
|
178
181
|
|
@@ -182,7 +185,7 @@ EOF
|
|
182
185
|
#### Documentation
|
183
186
|
|
184
187
|
s.has_rdoc = true
|
185
|
-
s.rdoc_options = ['--line-numbers', '--
|
188
|
+
s.rdoc_options = ['--line-numbers', '--all', '--main', 'lib/webgen/website.rb']
|
186
189
|
|
187
190
|
#### Author and project details
|
188
191
|
|
@@ -273,6 +276,13 @@ The official version is called 'webgen' and can be installed via
|
|
273
276
|
['/', "Webgen::Source::FileSystem", '../misc', 'default.css'],
|
274
277
|
['/documentation/', "Webgen::Source::FileSystem", '../misc', 'htmldoc.virtual'],
|
275
278
|
['/', "Webgen::Source::FileSystem", '../misc', 'images/**/*']]
|
279
|
+
prefix = "webgen-website-bundle-"
|
280
|
+
config['resources'].select {|name, data| name =~ /^#{prefix}style/}.each do |name, data|
|
281
|
+
config['sources'] <<
|
282
|
+
["/documentation/website_styles/#{name.sub(prefix, '')}", "Webgen::Source::FileSystem", '../misc', 'style.page']
|
283
|
+
config['sources'] <<
|
284
|
+
["/documentation/website_styles/#{name.sub(prefix, '')}", 'Webgen::Source::Resource', name, '/src/**', '/src']
|
285
|
+
end
|
276
286
|
end
|
277
287
|
end
|
278
288
|
|
@@ -302,15 +312,6 @@ The official version is called 'webgen' and can be installed via
|
|
302
312
|
end
|
303
313
|
end
|
304
314
|
|
305
|
-
if defined? Dcov
|
306
|
-
desc "Analyze documentation coverage"
|
307
|
-
task :dcov do
|
308
|
-
class Dcov::Analyzer; def generate; end; end
|
309
|
-
class NilClass; def file_absolute_name; nil; end; end
|
310
|
-
Dcov::Analyzer.new(:path => Dir.getwd, :files => Dir.glob('lib/**'))
|
311
|
-
end
|
312
|
-
end
|
313
|
-
|
314
315
|
EXCLUDED_FOR_TESTS=FileList.new(['lib/webgen/cli{*,**/*}', 'lib/webgen/version.rb',
|
315
316
|
'lib/webgen/output.rb', 'lib/webgen/source.rb',
|
316
317
|
'lib/webgen/tag.rb', 'lib/webgen/default_config.rb',
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.8
|
data/data/webgen/resources.yaml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
website_skeleton: webgen-website-skeleton
|
2
|
-
|
3
|
-
|
2
|
+
website_bundles/style/*: webgen-website-bundle-style-$basename
|
3
|
+
website_bundles/default: webgen-website-bundle-default
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This file contains your application, it requires dependencies and necessary
|
2
|
+
# parts of the application.
|
3
|
+
#
|
4
|
+
# It will be required from either `config.ru` or `start.rb`
|
5
|
+
|
6
|
+
# Add the directory this file resides in to the load path, so you can run the
|
7
|
+
# app from any other working directory
|
8
|
+
$LOAD_PATH.unshift(__DIR__)
|
9
|
+
|
10
|
+
# Initialize controllers and models
|
11
|
+
require 'controller/main'
|
@@ -34,19 +34,26 @@ class MemoryOutput
|
|
34
34
|
|
35
35
|
end
|
36
36
|
|
37
|
+
|
37
38
|
class MainController < Ramaze::Controller
|
38
39
|
|
39
|
-
layout
|
40
|
+
layout(:default) {|name, wish| !["path_autocomplete", "preview_website", "preview_website_bundles"].include?(name)}
|
41
|
+
helper :xhtml
|
42
|
+
engine :Etanni
|
43
|
+
|
44
|
+
def initialize
|
45
|
+
@title = 'webgen webgui'
|
46
|
+
end
|
40
47
|
|
41
48
|
def site_ops
|
42
49
|
session['website_dir'] = request['website_dir'].to_s
|
43
50
|
|
44
51
|
if File.directory?(session['website_dir'])
|
45
|
-
redirect
|
52
|
+
redirect r(:manage_website)
|
46
53
|
elsif session['website_dir']
|
47
|
-
redirect
|
54
|
+
redirect r(:create_website)
|
48
55
|
else
|
49
|
-
redirect
|
56
|
+
redirect r('/')
|
50
57
|
end
|
51
58
|
end
|
52
59
|
|
@@ -57,7 +64,6 @@ class MainController < Ramaze::Controller
|
|
57
64
|
''
|
58
65
|
end
|
59
66
|
end
|
60
|
-
deny_layout :path_autocomplete
|
61
67
|
|
62
68
|
def manage_website
|
63
69
|
if request['render_site'] && session['website_dir']
|
@@ -77,37 +83,29 @@ class MainController < Ramaze::Controller
|
|
77
83
|
ws = Webgen::Website.new(session['website_dir'])
|
78
84
|
ws.init
|
79
85
|
ws.execute_in_env do
|
80
|
-
|
81
|
-
path = File.join(*args)
|
82
|
-
response.header["Content-Type"] = Ramaze::Tool::MIME.trait[:types][File.extname(path)].to_s
|
83
|
-
response.header['Cache-Control'] = 'no-store'
|
84
|
-
response.header['Pragma'] = 'no-cache'
|
85
|
-
response.body = (oi.read(path) rescue '')
|
86
|
-
throw(:respond)
|
86
|
+
send_preview_file(args, ws.blackboard.invoke(:output_instance))
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
def create_website
|
91
|
-
@
|
92
|
-
@cur_template = request['website_template'] || @cur_template || 'default'
|
91
|
+
@cur_bundle = request['website_bundle'] || @cur_bundle || 'style-andreas07'
|
93
92
|
|
94
93
|
if request['create_site']
|
95
94
|
wm = Webgen::WebsiteManager.new(session['website_dir'])
|
96
95
|
wm.create_website
|
97
|
-
wm.
|
98
|
-
wm.
|
96
|
+
wm.apply_bundle('default')
|
97
|
+
wm.apply_bundle(@cur_bundle)
|
99
98
|
|
100
|
-
redirect
|
99
|
+
redirect r(:manage_website)
|
101
100
|
else
|
102
101
|
wm = Webgen::WebsiteManager.new(session['website_dir'])
|
103
|
-
@
|
104
|
-
@styles = wm.styles.keys.select {|k| k =~ /^website-|[^-]+/ }.sort
|
102
|
+
@bundles = wm.bundles.keys.sort
|
105
103
|
|
106
|
-
if !@
|
104
|
+
if !@cur_bundle.nil?
|
107
105
|
ws = Webgen::Website.new('unknown', nil) do |config|
|
108
106
|
config['sources'] = [
|
109
|
-
['/', 'Webgen::Source::Resource', 'webgen-website-
|
110
|
-
['/', 'Webgen::Source::Resource', 'webgen-website-
|
107
|
+
['/', 'Webgen::Source::Resource', 'webgen-website-bundle-default', '/src/**', '/src'],
|
108
|
+
['/', 'Webgen::Source::Resource', 'webgen-website-bundle-' + @cur_bundle, '/src/**', '/src']
|
111
109
|
]
|
112
110
|
config['output'] = ['MemoryOutput']
|
113
111
|
config['website.cache'] = [:memory, '']
|
@@ -118,14 +116,20 @@ class MainController < Ramaze::Controller
|
|
118
116
|
end
|
119
117
|
end
|
120
118
|
|
121
|
-
def
|
119
|
+
def preview_website_bundles(*args)
|
122
120
|
throw(:respond) unless session['create_website_preview']
|
121
|
+
send_preview_file(args, session['create_website_preview'])
|
122
|
+
end
|
123
|
+
|
124
|
+
def send_preview_file(args, oi)
|
123
125
|
path = File.join(*args)
|
124
|
-
|
126
|
+
path += ".html" if path !~ /\.\w+$/
|
127
|
+
response.header["Content-Type"] = Rack::Mime.mime_type(File.extname(path)).to_s
|
125
128
|
response.header['Cache-Control'] = 'no-store'
|
126
129
|
response.header['Pragma'] = 'no-cache'
|
127
|
-
response.body =
|
128
|
-
throw(:respond)
|
130
|
+
response.body = [(oi.read(path) rescue '')]
|
131
|
+
throw(:respond, response)
|
129
132
|
end
|
133
|
+
private :send_preview_file
|
130
134
|
|
131
135
|
end
|
@@ -7,24 +7,24 @@
|
|
7
7
|
<meta http-equiv="Content-Style-Type" content="text/css" />
|
8
8
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
9
|
|
10
|
-
<link href="#{
|
11
|
-
<link href="#{
|
10
|
+
<link href="#{r '/css/style.css'}" rel="stylesheet" type="text/css" />
|
11
|
+
<link href="#{r '/css/jquery.autocomplete.css'}" rel="stylesheet" type="text/css" />
|
12
12
|
|
13
|
-
<script type='text/javascript' src="#{
|
14
|
-
<script type='text/javascript' src="#{
|
13
|
+
<script type='text/javascript' src="#{r '/js/jquery.js'}"></script>
|
14
|
+
<script type='text/javascript' src="#{r '/js/jquery.autocomplete.js'}"></script>
|
15
15
|
<script type='text/javascript'>
|
16
16
|
$(document).ready(function() {
|
17
|
-
$("#website_dir").autocomplete('#{
|
17
|
+
$("#website_dir").autocomplete('#{r :path_autocomplete}');
|
18
18
|
});
|
19
19
|
</script>
|
20
20
|
</head>
|
21
21
|
<body>
|
22
22
|
<div id="header">
|
23
|
-
<img src="#{
|
24
|
-
<h2><a href="#{
|
23
|
+
<img src="#{r '/img/webgen_logo.png'}" alt='logo' />
|
24
|
+
<h2><a href="#{r '/'}">webgen <span>webgui</span></a></h2>
|
25
25
|
|
26
26
|
<div id='site-select-form'>
|
27
|
-
<form method='post' action='#{
|
27
|
+
<form method='post' action='#{r :site_ops}'>
|
28
28
|
<p>
|
29
29
|
<input type='text' id='website_dir' name='website_dir' value='#{session["website_dir"]}' size="70" />
|
30
30
|
<input type='submit' id='set_site' name='set_site' value='Set website directory' />
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Use this file directly like `ruby start.rb` if you don't want to use the
|
2
|
+
# `ramaze start` command.
|
3
|
+
# All application related things should go into `app.rb`, this file is simply
|
4
|
+
# for options related to running the application locally.
|
5
|
+
|
6
|
+
require 'ramaze'
|
7
|
+
require File.expand_path('app', File.dirname(__FILE__))
|
8
|
+
|
9
|
+
Ramaze.start(:adapter => :webrick, :port => 7000, :file => __FILE__)
|
@@ -1,22 +1,14 @@
|
|
1
|
-
<form method='post' action='#{
|
1
|
+
<form method='post' action='#{r :create_website}'>
|
2
2
|
<p>
|
3
|
-
Choose a <label for="website_style">
|
4
|
-
<select name="
|
5
|
-
<?r for
|
6
|
-
<option #{
|
3
|
+
Choose a <label for="website_style">website bundle:</label>
|
4
|
+
<select name="website_bundle" id="website_bundle">
|
5
|
+
<?r for bundle in @bundles ?>
|
6
|
+
<option #{bundle == @cur_bundle ? selected='selected' : ''}>#{bundle}</option>
|
7
7
|
<?r end ?>
|
8
8
|
</select>
|
9
|
-
|
10
|
-
and a <label for="website_template">template:</label>
|
11
|
-
<select name="website_template" id="website_template">
|
12
|
-
<?r for template in @templates ?>
|
13
|
-
<option #{template == @cur_template ? selected='selected' : ''}>#{template}</option>
|
14
|
-
<?r end ?>
|
15
|
-
</select>
|
16
|
-
|
17
9
|
<input type='submit' id='preview_site' name='preview_site' value='Preview website' />
|
18
10
|
<input type='submit' id='create_site' name='create_site' value='Create website' />
|
19
11
|
</p>
|
20
12
|
</form>
|
21
13
|
|
22
|
-
<object type='text/html' data='#{
|
14
|
+
<object type='text/html' data='#{r :preview_website_bundles, "/index.html"}' width='100%' height='600px' style='border: 1px solid black' />
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<form method='post' action='#{
|
1
|
+
<form method='post' action='#{r :manage_website}'>
|
2
2
|
<p>
|
3
3
|
<label for='verbosity'>Verbosity:
|
4
4
|
<select id='verbosity' name='verbosity'>
|
@@ -15,4 +15,4 @@
|
|
15
15
|
<pre>#{CGI::escapeHTML(@log.to_s)}</pre>
|
16
16
|
</div>
|
17
17
|
|
18
|
-
<object id='website_preview' type='text/html' data='#{
|
18
|
+
<object id='website_preview' type='text/html' data='#{r :preview_website, "/index.html"}' width='100%' height='600px' style='border: 1px solid black' />
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
title: Empty Index Page
|
3
|
+
in_menu: true
|
4
|
+
routed_title: New webgen Website
|
5
|
+
---
|
6
|
+
## Welcome to *webgen*!
|
7
|
+
|
8
|
+
This is just a place holder for the start page for your new website!
|
9
|
+
|
10
|
+
You can start by adjusting the meta information for this page file and adding some real content and
|
11
|
+
then adding some more page files!
|
12
|
+
|
13
|
+
For more information about webgen have a look at the [documentation]!
|
14
|
+
|
15
|
+
[documentation]: http://webgen.rubyforge.org/documentation/index.html
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient1.png
RENAMED
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas03/src/images/gradient2.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/blinkarrow.gif
RENAMED
File without changes
|
File without changes
|
data/data/webgen/{website_styles → website_bundles/style}/andreas04/src/images/contentbg.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|