McClelland, Scott
2011-Nov-23 00:21 UTC
[webgen-users] Script to Convert Webgen 0.4 to 0.5
When converting 0.4 to 0.5, I wrote a shell script that uses sed. I suppose Perl would be more portable, but this was very quick to put together, and it can be run in cygwin. Also, the first version of the script does not automatically go to subdirectories. I am interested to know if all the changes are correct, and if I missed anything. One of the symptoms I have is that everything seems to convert O.K., and webgen runs with no errors, but the content is missing. My guess is that some of the markup such as "h2." is not correct in webgen 0.5x, or something is wrong with the syntax somewhere. I have this in default.template <div id="content"> <webgen: block name="content" /> </div> Output of index.html is unchanged: <div id="content"> <webgen: block name="content" /> </div> Note: This script does in-place modification to all .page and .template files, so make a backup of the directory first. ----- Begin webgen_convert.sh Shell Script ----- #!/bin/sh #modify page files sed -e ''s/directoryName/routed_title/g'' -i *.page sed -e ''s/inMenu/in_menu/g'' -i *.page sed -e ''s/indexFile/index_path/g'' -i *.page sed -e ''s/omitIndexPath/omit_index_path/g'' -i *.page sed -e ''s/orderInfo/sort_info/g'' -i *.page # modify template files # working menu example: # {menu: {max_levels: 1, used_nodes: files}} sed -e ''s/menuStyle/menu_style/g'' -i *.template sed -e ''s/maxLevels/max_levels/g'' -i *.template sed -e ''s/breadcrumbTrail/breadcrumb_trail/g'' -i *.template # remove this line from .template files. # <link rel="stylesheet" href="{resource: webgen-css}" type="text/css" media="screen" / ----- End webgen_convert.sh Shell Script ----- Another issue I have is that files that use markup are apparently no longer converted to html, so I will have to figure out how to convert them. Some Examples: h2. h3. {download: {url: http://www.systemnotes.org/download/rhce/RHCE-Flash-Cards.pdf}<http://www.systemnotes.org/download/rhce/RHCE-Flash-Cards.pdf%7d>} | !images/arrow_5_left.png(back)!:index.html | p(inset-left). "News Videos":news.html More content in default.template, but I''m not sure if it works: <div id="navbar" class="content"> <span class="leftbox">Location: {breadcrumb_trail: }</span> <span class="rightbox">Language: {langbar: }</span> <div class="clearingdiv"> </div> </div> I also had trouble installing 0.4 after 0.5 is already installed, since some of the dependencies are too new. /****************************** Scott McClelland, B.S. CIS, CNE, MCSE, RHCT, HP APS, A+ *******************************/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20111123/14b43974/attachment.html>
On 2011-11-23 00:21 +0000 McClelland, Scott wrote:> I am interested to know if all the changes are correct, and if I > missed anything. One of the symptoms I have is that everything seems > to convert O.K., and webgen runs with no errors, but the content is > missing. My guess is that some of the markup such as "h2." is not > correct in webgen 0.5x, or something is wrong with the syntax > somewhere. > > I have this in default.template > <div id="content"> > <webgen: block name="content" /> > </div> > > Output of index.html is unchanged: > <div id="content"> > <webgen: block name="content" /> > </div> > > Note: This script does in-place modification to all .page > and .template files, so make a backup of the directory first.There must not be any space between `webgen` and `block`! It should be: <div id="content"> <webgen:block name="content" /> </div>> ----- Begin webgen_convert.sh Shell Script ----- > #!/bin/sh > > #modify page files > sed -e ''s/directoryName/routed_title/g'' -i *.page > sed -e ''s/inMenu/in_menu/g'' -i *.page > sed -e ''s/indexFile/index_path/g'' -i *.page > sed -e ''s/omitIndexPath/omit_index_path/g'' -i *.page > sed -e ''s/orderInfo/sort_info/g'' -i *.page > # modify template files > # working menu example: > # {menu: {max_levels: 1, used_nodes: files}} > > sed -e ''s/menuStyle/menu_style/g'' -i *.template > sed -e ''s/maxLevels/max_levels/g'' -i *.template > sed -e ''s/breadcrumbTrail/breadcrumb_trail/g'' -i *.template > > # remove this line from .template files. > # <link rel="stylesheet" href="{resource: webgen-css}" > type="text/css" media="screen" / > > ----- End webgen_convert.sh Shell Script -----These changes look good!> Another issue I have is that files that use markup are apparently no > longer converted to html, so I will have to figure out how to convert > them. > > Some Examples: > h2. > h3. > {download: {url: > http://www.systemnotes.org/download/rhce/RHCE-Flash-Cards.pdf}<http://www.systemnotes.org/download/rhce/RHCE-Flash-Cards.pdf%7d>} > | !images/arrow_5_left.png(back)!:index.html | p(inset-left). > "News Videos":news.htmlYou are using Textile as markup language but webgen changed the default markup language to Markdown in 0.5. You need to adjust the default markup language for the page files using the configuration file config.yaml. Add the following to it: default_processing_pipeline: Page: erb,tags,textile,blocks,fragments Also see http://webgen.rubyforge.org/documentation/faq.html#use-a-different-processing-pipeline-for-page-files> > More content in default.template, but I''m not sure if it works: > > <div id="navbar" class="content"> > <span class="leftbox">Location: {breadcrumb_trail: }</span> > <span class="rightbox">Language: {langbar: }</span> > <div class="clearingdiv"> </div> > </div>This should work without problems.> I also had trouble installing 0.4 after 0.5 is already installed, > since some of the dependencies are too new.This is a problem that effects many Ruby applications. Best way to overcome this problem is to install Ruby via rvm (see http://beginrescueend.com/) and create separate gemsets for each webgen version. You may also have a look at http://webgen.rubyforge.org/documentation/upgrading.html for further information on upgrading! Best regards, Thomas
McClelland, Scott
2012-Feb-23 03:30 UTC
[webgen-users] Script to Convert Webgen 0.4 to 0.5
Thanks, it is mostly working now. There are a few things I am still trying to figure out how to change. I looked at this page http://webgen.rubyforge.org/documentation/faq.html#add-page-specific-sidebar-content I am trying to modify variables in files from 0.4 to 0.5. I know the syntax has changed, and your example about the sidebar content is helpful, but I still don''t know exactly what to change. -- default.template -- <% if node.meta_info.has_key?(''additionalMetaTags'') %> {additionalMetaTags:} <% end %> -- about.page -- --- title: About inMenu: true orderInfo: 90 additionalMetaTags: <meta name="keywords" content="linux, administration, RHCE, shell, howto, tips, study, network, web design" /> --- Some text about the site... Another change: -- default.template -- <% if node.meta_info.has_key?(''pageTitle'') %> {pageTitle:} <% else %> {title:} - System Notes <% end %> -- linux/index.page -- --- title: Linux Home inMenu: false orderInfo: 30 directoryName: Linux pageTitle: Linux System Adminstrator | RHCE Study --- As always, you help is appreciated. Scott M. -----Original Message----- From: webgen-users-bounces at rubyforge.org [mailto:webgen-users-bounces at rubyforge.org] On Behalf Of Thomas Leitner Sent: Wednesday, November 23, 2011 8:52 AM To: webgen-users at rubyforge.org Subject: Re: [webgen-users] Script to Convert Webgen 0.4 to 0.5 On 2011-11-23 00:21 +0000 McClelland, Scott wrote:> I am interested to know if all the changes are correct, and if I > missed anything. One of the symptoms I have is that everything seems > to convert O.K., and webgen runs with no errors, but the content is > missing. My guess is that some of the markup such as "h2." is not > correct in webgen 0.5x, or something is wrong with the syntax > somewhere. > > I have this in default.template > <div id="content"> > <webgen: block name="content" /> > </div> > > Output of index.html is unchanged: > <div id="content"> > <webgen: block name="content" /> > </div> > > Note: This script does in-place modification to all .page > and .template files, so make a backup of the directory first.There must not be any space between `webgen` and `block`! It should be: <div id="content"> <webgen:block name="content" /> </div>> ----- Begin webgen_convert.sh Shell Script ----- > #!/bin/sh > > #modify page files > sed -e ''s/directoryName/routed_title/g'' -i *.page > sed -e ''s/inMenu/in_menu/g'' -i *.page > sed -e ''s/indexFile/index_path/g'' -i *.page > sed -e ''s/omitIndexPath/omit_index_path/g'' -i *.page > sed -e ''s/orderInfo/sort_info/g'' -i *.page > # modify template files > # working menu example: > # {menu: {max_levels: 1, used_nodes: files}} > > sed -e ''s/menuStyle/menu_style/g'' -i *.template > sed -e ''s/maxLevels/max_levels/g'' -i *.template > sed -e ''s/breadcrumbTrail/breadcrumb_trail/g'' -i *.template > > # remove this line from .template files. > # <link rel="stylesheet" href="{resource: webgen-css}" > type="text/css" media="screen" / > > ----- End webgen_convert.sh Shell Script -----These changes look good!> Another issue I have is that files that use markup are apparently no > longer converted to html, so I will have to figure out how to convert > them. > > Some Examples: > h2. > h3. > {download: {url: > http://www.systemnotes.org/download/rhce/RHCE-Flash-Cards.pdf}<http://www.systemnotes.org/download/rhce/RHCE-Flash-Cards.pdf%7d>} > | !images/arrow_5_left.png(back)!:index.html | p(inset-left). > "News Videos":news.htmlYou are using Textile as markup language but webgen changed the default markup language to Markdown in 0.5. You need to adjust the default markup language for the page files using the configuration file config.yaml. Add the following to it: default_processing_pipeline: Page: erb,tags,textile,blocks,fragments Also see http://webgen.rubyforge.org/documentation/faq.html#use-a-different-processing-pipeline-for-page-files> > More content in default.template, but I''m not sure if it works: > > <div id="navbar" class="content"> > <span class="leftbox">Location: {breadcrumb_trail: }</span> > <span class="rightbox">Language: {langbar: }</span> > <div class="clearingdiv"> </div> > </div>This should work without problems.> I also had trouble installing 0.4 after 0.5 is already installed, > since some of the dependencies are too new.This is a problem that effects many Ruby applications. Best way to overcome this problem is to install Ruby via rvm (see http://beginrescueend.com/) and create separate gemsets for each webgen version. You may also have a look at http://webgen.rubyforge.org/documentation/upgrading.html for further information on upgrading! Best regards, Thomas _______________________________________________ webgen-users mailing list webgen-users at rubyforge.org http://rubyforge.org/mailman/listinfo/webgen-users