From nicolas.delsaux at gmail.com Sun Mar 9 13:02:32 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sun, 9 Mar 2008 18:02:32 +0100 Subject: [webgen-users] issue with plugin loading Message-ID: <418361960803091002k6147b3adv9e1729453dd8e6fe@mail.gmail.com> OK, I'm once again talking about my future almighty isbn loader. I have written quite all the ruby code I need and, using a basic test, checked it works. Now, I'me having issues running the code. When I run webgen, I got the following error : C:\Documents and Settings\Maison\Bureau\nicolas-delsaux.is-a-geek>webgen C:/Documents and Settings/Maison/Bureau/nicolas-delsaux.is-a-geek/plugin/database/04_role.rb:1:in `load_plugin': uniniti alized constant #::AbstractBaseEntry (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:224:in `load_from_file' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:223:in `catch' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:223:in `load_from_file' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:237:in `load_from_block' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:237:in `catch' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:237:in `load_from_block' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:236:in `catch' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:236:in `load_from_block' ... 11 levels... from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/cli.rb:454:in `cli_main' from c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/bin/webgen:4 from c:/ruby/bin/webgen:18:in `load' from c:/ruby/bin/webgen:18 My plugin folder hierarchy is as follow : plugin | filelist.rb | filemdate.rb | isbn_converter.rb | ndx_converter.rb | +---database | 01_definition.rb | 02_product.rb | 03_person.rb | 04_role.rb | \---grabbers amazon.rb noosfere.rb with class AbstractBaseEntry locate in 01_definition.rb file. i've used these prefixes in order to help werbgen loading all correctly, but it does not seems to work. Is there any thinkable workaround ? Or am I doing something just plain wrong ? I believe putting all database (well, kirbybase, in my case) code in one file would solve my issue, but I fear the remedy being worst than the evil, no ? -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From t_leitner at gmx.at Sun Mar 9 15:12:43 2008 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 9 Mar 2008 20:12:43 +0100 Subject: [webgen-users] issue with plugin loading In-Reply-To: <418361960803091002k6147b3adv9e1729453dd8e6fe@mail.gmail.com> References: <418361960803091002k6147b3adv9e1729453dd8e6fe@mail.gmail.com> Message-ID: <20080309201243.5df78851@noeato.local> Am Sun, 9 Mar 2008 18:02:32 +0100 schrieb "Nicolas Delsaux" : > OK, I'm once again talking about my future almighty isbn loader. > I have written quite all the ruby code I need and, using a basic test, > checked it works. > Now, I'me having issues running the code. > When I run webgen, I got the following error : > > C:\Documents and > Settings\Maison\Bureau\nicolas-delsaux.is-a-geek>webgen C:/Documents > and > Settings/Maison/Bureau/nicolas-delsaux.is-a-geek/plugin/database/04_role.rb:1:in > `load_plugin': uniniti alized constant > #::AbstractBaseEntry (NameError) from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:224:in > `load_from_file' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:223:in > `catch' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:223:in > `load_from_file' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:237:in > `load_from_block' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:237:in > `catch' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:237:in > `load_from_block' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:236:in > `catch' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/plugin.rb:236:in > `load_from_block' ... 11 levels... > from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/lib/webgen/cli.rb:454:in > `cli_main' from > c:/ruby/lib/ruby/gems/1.8/gems/webgen-0.4.6/bin/webgen:4 from > c:/ruby/bin/webgen:18:in `load' from c:/ruby/bin/webgen:18 I can't say anything with this stack trace only. Do you require the 01_definition.rb file in the plugin in which you use AbstractBaseEntry? You could also try using ::AbstractBaseEntry in the plugin file. If none of this works, could you post the plugin code? Would help me a lot. -- Thomas From nicolas.delsaux at gmail.com Mon Mar 10 04:44:26 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Mon, 10 Mar 2008 09:44:26 +0100 Subject: [webgen-users] issue with plugin loading In-Reply-To: <20080309201243.5df78851@noeato.local> References: <418361960803091002k6147b3adv9e1729453dd8e6fe@mail.gmail.com> <20080309201243.5df78851@noeato.local> Message-ID: <418361960803100144h6dbd9c31w98c91e7cd56009f8@mail.gmail.com> On 3/9/08, Thomas Leitner wrote: > > I can't say anything with this stack trace only. Do you require the > 01_definition.rb file in the plugin in which you use AbstractBaseEntry? According to webgen documentation, I do absolutly no require in my plugin cdoe, expecting webgen to automagically require all the code in the plugin folder hierarchy. > You could also try using ::AbstractBaseEntry in the plugin file. OK, using that trick changed a little exception stack. now, there is no more t #:: in it, but the exception continue to be the same. > If > none of this works, could you post the plugin code? Would help me a lot. I guess so ;-) Well, you'll have first to install kirbybase, since I generate a small db storing both products and persons locally (for better page generation), and Hpricot, but this one I think you already have installed. You'll also have to create a page containing a isbn tag, like the following : Thanks for your help. -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. -------------- next part -------------- A non-text attachment was scrubbed... Name: plugin.zip Type: application/zip Size: 12100 bytes Desc: not available Url : http://rubyforge.org/pipermail/webgen-users/attachments/20080310/e216bd29/attachment.zip From nicolas.delsaux at gmail.com Sat Mar 15 04:39:54 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sat, 15 Mar 2008 09:39:54 +0100 Subject: [webgen-users] new webgen plugin : google analytics Message-ID: <418361960803150139i1fcebf9ande8ea395dad00e94@mail.gmail.com> Hi all In order to add visit tracking to my webgen site, i've written a google analytics plugin which, given a google analytics key, automatically includes tre required javascripts. Requirements : in your page template, put {googleAnalytics: key: your_google_key} just before your tag. And that's all. The code is the following : =========================================================== class GoogleAnalyticsTag < Tags::DefaultTag infos( :name => 'Custom/GoogleAnalytics', :summary => "Allows website tracking thanks to Google Analytics ga.js code" ) register_tag 'googleAnalytics' param 'key', 1, 'The Google analytics code given at google analytics website' def process_tag(tag, chain) key = param('key') return < var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); EOT end end =========================================================== -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From thewoolleyman at gmail.com Sat Mar 15 17:59:00 2008 From: thewoolleyman at gmail.com (Chad Woolley) Date: Sat, 15 Mar 2008 14:59:00 -0700 Subject: [webgen-users] new webgen plugin : google analytics In-Reply-To: <418361960803150139i1fcebf9ande8ea395dad00e94@mail.gmail.com> References: <418361960803150139i1fcebf9ande8ea395dad00e94@mail.gmail.com> Message-ID: On Sat, Mar 15, 2008 at 1:39 AM, Nicolas Delsaux wrote: > Hi all > In order to add visit tracking to my webgen site, i've written a > google analytics plugin which, given a google analytics key, > automatically includes tre required javascripts. This would be great to get into webgen. I do it manually with a page fragment that is included in every page with includeFile. Does this automatically go on every page, or do you still have to use includeFile? From nicolas.delsaux at gmail.com Sun Mar 16 04:50:51 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sun, 16 Mar 2008 09:50:51 +0100 Subject: [webgen-users] new webgen plugin : google analytics In-Reply-To: References: <418361960803150139i1fcebf9ande8ea395dad00e94@mail.gmail.com> Message-ID: <418361960803160150p5b177ce0ne782f4875f7313f6@mail.gmail.com> On 3/15/08, Chad Woolley wrote: > > This would be great to get into webgen. I do it manually with a page > fragment that is included in every page with includeFile. Does this > automatically go on every page, or do you still have to use > includeFile? > Well, I simply put the {googleAnalytics: key: MY_KEY} in my default.template, and all is done. -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From nicolas.delsaux at gmail.com Sun Mar 16 04:59:09 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sun, 16 Mar 2008 09:59:09 +0100 Subject: [webgen-users] include a page in another Message-ID: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> Hi, for my isbn plugin, I'm wishing to incldue generated isbn pages in caller pages (the ones with tags). But I want my isbn page to be processed before for its tags to be transformed (like the relocatable or other ones). Besides, i do not want its header to be included. Is there an easy solution for that, or should I do the work myself ? -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From t_leitner at gmx.at Mon Mar 17 04:42:54 2008 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 17 Mar 2008 09:42:54 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> Message-ID: <20080317094254.20aecc7f@noeato.mat.univie.ac.at> Am Sun, 16 Mar 2008 09:59:09 +0100 schrieb "Nicolas Delsaux" : > Hi, > for my isbn plugin, I'm wishing to incldue generated isbn pages in > caller pages (the ones with tags). > But I want my isbn page to be processed before for its tags to be > transformed (like the relocatable or other ones). Besides, i do not > want its header to be included. > Is there an easy solution for that, or should I do the work myself ? You can manually include a rendered page in another page by using ERB code. However, there is currently no tag for this. Including a rendered page can be done like this: <%= @plugin_manager['FileHandlers::PageHandler'].render_node(my_node, 'content', false) %> Which renders the block 'content' of node 'my_node' and don't uses templates. -- Thomas From nicolas.delsaux at gmail.com Mon Mar 17 08:30:54 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Mon, 17 Mar 2008 13:30:54 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <20080317094254.20aecc7f@noeato.mat.univie.ac.at> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> Message-ID: <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> On 3/17/08, Thomas Leitner wrote: > > You can manually include a rendered page in another page by using ERB > code. However, there is currently no tag for this. Including a rendered > page can be done like this: > > <%= @plugin_manager['FileHandlers::PageHandler'].render_node(my_node, > 'content', false) %> > > Which renders the block 'content' of node 'my_node' and don't uses > templates. > Ok, but how do i define 'my_node' ? I fear it must be a webgen node, and that I cannot use ab absolute file path instead ? Besides, I was thinking about using the generated page content by including it during my ContentConverter "call" method, but it does not seems to wrok, unfortunatly. -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From t_leitner at gmx.at Mon Mar 17 10:16:15 2008 From: t_leitner at gmx.at (Thomas Leitner) Date: Mon, 17 Mar 2008 15:16:15 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> Message-ID: <20080317151615.2e6ce554@noeato.mat.univie.ac.at> Am Mon, 17 Mar 2008 13:30:54 +0100 schrieb "Nicolas Delsaux" : > On 3/17/08, Thomas Leitner wrote: > > > > You can manually include a rendered page in another page by using > > ERB code. However, there is currently no tag for this. Including a > > rendered page can be done like this: > > > > <%= > > @plugin_manager['FileHandlers::PageHandler'].render_node(my_node, > > 'content', false) %> > > > > Which renders the block 'content' of node 'my_node' and don't uses > > templates. > > > Ok, but how do i define 'my_node' ? > I fear it must be a webgen node, and that I cannot use ab absolute > file path instead ? > Besides, I was thinking about using the generated page content by > including it during my ContentConverter "call" method, but it does not > seems to wrok, unfortunatly. > Yes, 'my_node' needs to be a webgen node pointing to the page file which you want to have rendered. The node can be found like this: node.resolve_node('/path/to/pagefile.page') or using a relative path like node.resolve_node('../mypagefile.page') where 'node' is the node of the page that gets current rendered and this variable is accessible while the content of page is rendered with ERB. As these are plain Ruby commands, they also work in a plugin. So it is possible to include them in your ContentConverter. Can you specify more exactly how you want to page content to be included in the 'call' method? -- Thomas From nicolas.delsaux at gmail.com Mon Mar 17 10:32:07 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Mon, 17 Mar 2008 15:32:07 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <20080317151615.2e6ce554@noeato.mat.univie.ac.at> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> <20080317151615.2e6ce554@noeato.mat.univie.ac.at> Message-ID: <418361960803170732k294f6b3wd7546a85c294fdb0@mail.gmail.com> On 3/17/08, Thomas Leitner wrote: > > > Yes, 'my_node' needs to be a webgen node pointing to the page file > which you want to have rendered. The node can be found like this: > > node.resolve_node('/path/to/pagefile.page') > > or using a relative path like > > node.resolve_node('../mypagefile.page') > > where 'node' is the node of the page that gets current rendered and > this variable is accessible while the content of page is rendered with > ERB. > > As these are plain Ruby commands, they also work in a plugin. So it is > possible to include them in your ContentConverter. Can you specify more > exactly how you want to page content to be included in the 'call' > method? > Remember my isbn crazy plugin ? Well ... in it, i generate, from an isbn number a bunch of pages : one for the product, and one for each person which contributed to (author, translators, ...) I then generate cross-references from them. But, since a simple link in my source page would be kind of useless, I include the product page in the source page, and this is when i want my content to be processed correctly. I've already hacked some of your code for that. indeed, for this to work, it's by far simpler to change the relocatable behaviour to be able to handle absolute destination path. Here is the modification I've done ================= a modified relocatable plugin handling absolute destination path ======================= class RelocatableTag < DefaultTag infos( :name => 'Tag/Relocatable', :author => Webgen::AUTHOR, :summary => 'Adds a relative path to the specified name if necessary' ) param 'path', nil, 'The path which should be relocatable' param 'resolveFragment', true, 'Specifies if the fragment part (#something) in the path should also be resolved' set_mandatory 'path', true register_tag 'relocatable' def relativize(_source, _dest) sourcedirs = _source.split("/") destdirs = _dest.split("/") source_count = sourcedirs.size dest_count = destdirs.size size = [source_count, dest_count].min src = sourcedirs[0..size] same_path = true src.each_index do |i| if same_path if src[i]!=destdirs[i] same_path = false src[i]=nil end else src[i]=nil end end src.compact! common_size = src.size # -1 is to remove filename returned = "../"*((source_count-1)-common_size) returned << destdirs.slice(common_size, (dest_count-common_size))*"/" return returned end def process_tag( tag, chain ) uri_string = param( 'path' ) result = '' unless uri_string.nil? # Before all, check if path is an absolute file path path = File.expand_path(uri_string) # hypothesis : when path is the expanded path, input path was an absolute one that may be relativised if path==uri_string if File.exists? path # path of last opened file stored here current_file_path = File.expand_path(chain.last.node_info[:src]) # Now relativising uri_string = relativize(current_file_path, path) end end begin uri = URI.parse( uri_string ) if uri.absolute? result = uri_string else result = resolve_path( uri, chain ) end log(:error) { "Could not resolve path '#{uri_string}' in <#{chain.first.node_info[:src]}>" } if result.empty? rescue URI::InvalidURIError => e log(:error) { "Error while parsing path for tag relocatable in <#{chain.first.node_info[:src]}>: #{e.message}" } end end result end ####### private ####### def query_fragment( uri ) (uri.query.nil? ? '' : '?'+ uri.query ) + (uri.fragment.nil? ? '' : '#' + uri.fragment) end def resolve_path( uri, chain ) dest_node = chain.first.resolve_node( uri.path ) if !dest_node.nil? && (File.basename( uri.path ) == dest_node.node_info[:pagename] || dest_node.is_directory?) dest_node = dest_node.node_for_lang( chain.last['lang'] ) end if !dest_node.nil? && !uri.fragment.nil? && param( 'resolveFragment' ) dest_node = dest_node.resolve_node( '#' + uri.fragment ) end if dest_node.nil? '' else chain.last.route_to( dest_node.is_fragment? ? dest_node.parent : dest_node ) + query_fragment( uri ) end end end ======================================== end ================================= I think that, added to the erb magick, it could be enough (I'll check that this evening). -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From margent at gmail.com Tue Mar 18 10:43:47 2008 From: margent at gmail.com (Marc Argent) Date: Tue, 18 Mar 2008 14:43:47 +0000 Subject: [webgen-users] Other Menu Content Message-ID: <4d6854f30803180743y68c81788wb1d2270a08410546@mail.gmail.com> Dear all, Is there an another way, rather than using metainfo.yaml, to add links to external websites and files to the navigation menu? I would prefer something that I could configure on a per directory basis. Best wishes, Marc Argent From t_leitner at gmx.at Wed Mar 19 11:24:42 2008 From: t_leitner at gmx.at (Thomas Leitner) Date: Wed, 19 Mar 2008 16:24:42 +0100 Subject: [webgen-users] Other Menu Content In-Reply-To: <4d6854f30803180743y68c81788wb1d2270a08410546@mail.gmail.com> References: <4d6854f30803180743y68c81788wb1d2270a08410546@mail.gmail.com> Message-ID: <20080319162442.70731ed4@noeato.local> Am Tue, 18 Mar 2008 14:43:47 +0000 schrieb "Marc Argent" : > Is there an another way, rather than using metainfo.yaml, to add links > to external websites and files to the navigation menu? I would prefer > something that I could configure on a per directory basis. The metainfo.yaml is currently the only place to configure links to external websites. -- Thomas From t_leitner at gmx.at Wed Mar 19 11:33:52 2008 From: t_leitner at gmx.at (Thomas Leitner) Date: Wed, 19 Mar 2008 16:33:52 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <418361960803170732k294f6b3wd7546a85c294fdb0@mail.gmail.com> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> <20080317151615.2e6ce554@noeato.mat.univie.ac.at> <418361960803170732k294f6b3wd7546a85c294fdb0@mail.gmail.com> Message-ID: <20080319163352.58151fe7@noeato.local> Am Mon, 17 Mar 2008 15:32:07 +0100 schrieb "Nicolas Delsaux" : > Remember my isbn crazy plugin ? > Well ... in it, i generate, from an isbn number a bunch of pages : one > for the product, and one for each person which contributed to (author, > translators, ...) > I then generate cross-references from them. > But, since a simple link in my source page would be kind of useless, I > include the product page in the source page, and this is when i want > my content to be processed correctly. > I've already hacked some of your code for that. > indeed, for this to work, it's by far simpler to change the > relocatable behaviour to be able to handle absolute destination path. > Here is the modification I've done > > > > I think that, added to the erb magick, it could be enough (I'll check > that this evening). Okay. I think that including the rendered page with ERB like I showed you should do the trick. Regarding absolute destination paths: Tag/Relocatable can resolve absolute destination paths just fine. Is your modification doing something special which the default implementation does not do? Just a note: Tag/Relocatable can only resolve nodes that are handled by webgen! -- Thomas From nicolas.delsaux at gmail.com Wed Mar 19 11:49:39 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Wed, 19 Mar 2008 16:49:39 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <20080319163352.58151fe7@noeato.local> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> <20080317151615.2e6ce554@noeato.mat.univie.ac.at> <418361960803170732k294f6b3wd7546a85c294fdb0@mail.gmail.com> <20080319163352.58151fe7@noeato.local> Message-ID: <418361960803190849n25025a24vdef4a00dbc1f68de@mail.gmail.com> On 3/19/08, Thomas Leitner wrote: > > Regarding absolute destination paths: Tag/Relocatable can resolve > absolute destination paths just fine. Is your modification doing > something special which the default implementation does not do? Just a > note: Tag/Relocatable can only resolve nodes that are handled by webgen! > In my case, handled paths may not exist yet (as is the case when i link to pages I am currently creating, and have not registered as nodes. Besides, is there a special thing to register a page that my plugin is currently creating in the src folder as a node to be processed ? -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien. From t_leitner at gmx.at Wed Mar 19 13:41:29 2008 From: t_leitner at gmx.at (Thomas Leitner) Date: Wed, 19 Mar 2008 18:41:29 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <418361960803190849n25025a24vdef4a00dbc1f68de@mail.gmail.com> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> <20080317151615.2e6ce554@noeato.mat.univie.ac.at> <418361960803170732k294f6b3wd7546a85c294fdb0@mail.gmail.com> <20080319163352.58151fe7@noeato.local> <418361960803190849n25025a24vdef4a00dbc1f68de@mail.gmail.com> Message-ID: <20080319184129.0c990af3@noeato.local> Am Wed, 19 Mar 2008 16:49:39 +0100 schrieb "Nicolas Delsaux" : > On 3/19/08, Thomas Leitner wrote: > > > > Regarding absolute destination paths: Tag/Relocatable can resolve > > absolute destination paths just fine. Is your modification doing > > something special which the default implementation does not do? > > Just a note: Tag/Relocatable can only resolve nodes that are > > handled by webgen! > > > In my case, handled paths may not exist yet (as is the case when i > link to pages I am currently creating, and have not registered as > nodes. > Besides, is there a special thing to register a page that my plugin is > currently creating in the src folder as a node to be processed ? Regarding your question: no, there is no such thing. If you need to have the page files written to the src directory, I think I would create a script that creates the needed page files and then just run webgen. If you have no need for actually creating files on the disk, create the nodes while webgen is processing the source files, ie. by creating a file handler that creates these files. Then, when webgen generates the HTML files, all needed nodes are there. -- Thomas From nicolas.delsaux at gmail.com Sat Mar 22 03:35:59 2008 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sat, 22 Mar 2008 08:35:59 +0100 Subject: [webgen-users] include a page in another In-Reply-To: <20080317151615.2e6ce554@noeato.mat.univie.ac.at> References: <418361960803160159t7bb48e7k9ea962faa51cd5bf@mail.gmail.com> <20080317094254.20aecc7f@noeato.mat.univie.ac.at> <418361960803170530n31678a14hdad31fbb79dcd6fb@mail.gmail.com> <20080317151615.2e6ce554@noeato.mat.univie.ac.at> Message-ID: <418361960803220035r31dcfc07sd02b372767760d21@mail.gmail.com> On 3/17/08, Thomas Leitner wrote: > > Yes, 'my_node' needs to be a webgen node pointing to the page file > which you want to have rendered. The node can be found like this: > > node.resolve_node('/path/to/pagefile.page') > > or using a relative path like > > node.resolve_node('../mypagefile.page') > > where 'node' is the node of the page that gets current rendered and > this variable is accessible while the content of page is rendered with > ERB. > Well, using this method did not seems to work. Instead, i do the following, which seems to do the job quite well : page_handler = {} page_handler.merge!(self.plugin_manager['ContentConverter/Default'].registered_handlers()) page_handler['default']= self.plugin_manager['ContentConverter/Default'].registered_handlers()['ndx'] product_webpagedata = WebPageData.new(product.get_page, page_handler) returned << product_webpagedata.blocks['content'].content The registered_handler trick is here since WebPageData relies upon a default renderer. -- Nicolas Delsaux N'imprimez ce mail que si vous ne savez pas le lire sur l'?cran : les ?lectrons se recyclent bien, le papier, beaucoup moins bien.