From johan at johansorensen.com Thu Sep 1 09:58:07 2005 From: johan at johansorensen.com (=?ISO-8859-1?Q?Johan_S=F8rensen?=) Date: Thu Sep 1 09:51:48 2005 Subject: .to_html on entry attributes Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, First time user here, long time reader (of Hobix blogs).. I'm having a custom entry type class called "Quote" where I've (among others) defined the following "field" (not sure exactly what they're called in hobix terms?): _ :quote_note, :req => true, :edit_as => :text, :search => :fulltext, :text_processor => true And in my hobix.out.quick I'm trying to turn that field into html using entry.quote_note.to_html (since it's usually textile), and the following exception occur: /Users/johan/Hobix/lib/hobix/out/quick.rb:124:in `load': Error `undefined method `to_html' for "\"Google\":http:// google.com":String' in erb /path/to/skels/.... (Hobix::Out::QuickError) The yaml line looks like this: quote_note: "Google":http://google.com I've even tried lots of different approaches; RedCloth.new (entry.quote_note) directly in the view; an accessor in the Quote class that converts it to redcloth etc, but I either get the above error or the text non-textilized.. JS (despite all this, Hobix is like pure crack, so much fun) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFDFwjvK4mRAD1utSoRAkxXAJkBAPrwa2aOci8F+++hzlVdgByVGwCg2TnT /S8tVJlqE+EfNL42hYtVmMQ= =rIQG -----END PGP SIGNATURE----- From sl33p3r at free.fr Thu Sep 1 18:06:14 2005 From: sl33p3r at free.fr (Frederick Ros) Date: Thu Sep 1 17:34:29 2005 Subject: .to_html on entry attributes In-Reply-To: References: Message-ID: <20050901220614.GB14449@hal.void.org> Johan S?rensen wrote : | /Users/johan/Hobix/lib/hobix/out/quick.rb:124:in `load': Error | `undefined method `to_html' for "\"Google\":http:// | google.com":String' in erb /path/to/skels/.... (Hobix::Out::QuickError) | | The yaml line looks like this: | quote_note: "Google":http://google.com | | | I've even tried lots of different approaches; RedCloth.new | (entry.quote_note) directly in the view; an accessor in the Quote | class that converts it to redcloth etc, but I either get the above | error or the text non-textilized.. Hi, This seems strange, as regarding your error it seems that you're trying to apply the to_html method to a string .... The easiest (but the crapest ?) would be to add something like: class String def to_html RedCloth.new( self ).to_html end end Best Regards, -- Frederick Ros aka Sleeper -- sleeper@jabber.fr Linux is obsolete (Andrew Tanenbaum) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20050902/24f6390a/attachment.bin From mental at rydia.net Thu Sep 1 17:45:29 2005 From: mental at rydia.net (mental@rydia.net) Date: Thu Sep 1 17:38:47 2005 Subject: .to_html on entry attributes In-Reply-To: <20050901220614.GB14449@hal.void.org> References: <20050901220614.GB14449@hal.void.org> Message-ID: <1125611129.431776791b35d@www.rydia.net> Quoting Frederick Ros : > Johan S?rensen wrote : > | /Users/johan/Hobix/lib/hobix/out/quick.rb:124:in `load': Error > | `undefined method `to_html' for "\"Google\":http:// > | google.com":String' in erb /path/to/skels/.... > (Hobix::Out::QuickError) > | > | The yaml line looks like this: > | quote_note: "Google":http://google.com > > This seems strange, as regarding your error it seems that you're > trying to apply the to_html method to a string .... I think the real problem he's trying to solve is how to have @quote_note initially parsed as RedCloth rather than a String, as is already done for e.g. @content. (to which I don't know the answer offhand; I've not gotten that into custom entry classes -- yet) -mental From sl33p3r at free.fr Thu Sep 1 18:33:41 2005 From: sl33p3r at free.fr (Frederick Ros) Date: Thu Sep 1 18:01:55 2005 Subject: Fwd: Re: .to_html on entry attributes Message-ID: <20050901223341.GD14449@hal.void.org> Oops .. I forgot the ML :( mental@rydia.net wrote : | I think the real problem he's trying to solve is how to have | @quote_note initially parsed as RedCloth rather than a String, as | is already done for e.g. @content. | | (to which I don't know the answer offhand; I've not gotten that into | custom entry classes -- yet) In my case I had the same thing with the title field. So I declared something like: def title title_str = guess_language( @title ) RedCloth.new title_str end -- Frederick Ros aka Sleeper -- sleeper@jabber.fr Use data arrays to avoid repetitive control sequences. - The Elements of Programming Style (Kernighan & Plaugher) ----- End forwarded message ----- -- Frederick Ros aka Sleeper -- sleeper@jabber.fr I did this 'cause Linux gives me a woody. It doesn't generate revenue. (Dave '-ddt->` Taylor, announcing DOOM for Linux) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20050902/392a48e7/attachment.bin From johan at johansorensen.com Thu Sep 1 18:58:50 2005 From: johan at johansorensen.com (=?ISO-8859-1?Q?Johan_S=F8rensen?=) Date: Thu Sep 1 18:52:32 2005 Subject: .to_html on entry attributes In-Reply-To: <20050901223341.GD14449@hal.void.org> References: <20050901223341.GD14449@hal.void.org> Message-ID: <117B20CF-24E8-41C9-A2C3-5F3B80F9DB59@johansorensen.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2 sep 2005, at 00.33, Frederick Ros wrote: > In my case I had the same thing with the title field. > So I declared something like: > > def title > title_str = guess_language( @title ) > RedCloth.new title_str > end Yes, that was the solution I ended up with eventually after thinking about what exactly it was I was doing :) ok, another newbie question to entertain you guys with (probably more related to yaml than hobix itself), this: foo: "bar":http://google.com gives me There was an error saving the entry: ArgumentError: parse error on line 4, col -1: but: foo: | "bar":http://google.com works like a charm, but if I have some character(s) before the first doublequote in the first example it also works lovely, so I need to escape that string somehow, but \" and !str "foo" fails do that it seems.. JS -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFDF4eqK4mRAD1utSoRAs67AJ0dEJLi/XiyGtMDUeaNFXh+a9G7+gCgl58H +KUt5I9U5Y/5zmqdBMXYt+s= =rf5W -----END PGP SIGNATURE----- From wmorgan-hobix-is-the-way at masanjin.net Thu Sep 1 19:36:10 2005 From: wmorgan-hobix-is-the-way at masanjin.net (William Morgan) Date: Thu Sep 1 19:29:22 2005 Subject: .to_html on entry attributes In-Reply-To: <1125611129.431776791b35d@www.rydia.net> References: <20050901220614.GB14449@hal.void.org> <1125611129.431776791b35d@www.rydia.net> Message-ID: <20050901233610.GA1432@masanjin.net> Excerpts from mental@rydia.net's mail of 1 Sep 2005 (CDT): > I think the real problem he's trying to solve is how to have > @quote_note initially parsed as RedCloth rather than a String, as > is already done for e.g. @content. > > (to which I don't know the answer offhand; I've not gotten that into > custom entry classes -- yet) To my limited understanding of the custom entry code, he's doing the right thing. Setting text_processer => true should be sufficient to make the field pre-parsed by the default text processor, namely RedCloth. Johan, are there any other parts of the backtrace you can show us that might be useful? I know sometimes ERb likes to hide the problem from you completely... -- William From tilman at code-monkey.de Fri Sep 2 16:28:12 2005 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Fri Sep 2 16:21:25 2005 Subject: Tags-related feature request Message-ID: <20050902222812.4ff8c9f5.tilman@code-monkey.de> Hi, with the not-so-recent addition of tags support, I wonder whether it's possible to make Hobix store articles in a central place, without hardcoding the "primary tag" in the path to the file (which is the directory the article is stored in). I'd like to produce URLs like they are used in typo (and probably every other blogging engine ;), which don't give away the "primary tag". Has anyone thought about this? Regards, Tilman -- learn to quote: http://www.netmeister.org/news/learn2quote.html From wmorgan-hobix-is-the-way at masanjin.net Fri Sep 2 17:14:04 2005 From: wmorgan-hobix-is-the-way at masanjin.net (William Morgan) Date: Fri Sep 2 17:07:16 2005 Subject: Tags-related feature request In-Reply-To: <20050902222812.4ff8c9f5.tilman@code-monkey.de> References: <20050902222812.4ff8c9f5.tilman@code-monkey.de> Message-ID: <20050902211404.GA20221@masanjin.net> You can store all your entries in directly in htdocs/ and simply add a tags: field to each. Then there's no concept of a primary tag / section. Is that the behavior you wanted? I'm not that familiar with typo. > > -- learn to quote: http://www.netmeister.org/news/learn2quote.html > _______________________________________________ Hobix-is-the-way > mailing list Hobix-is-the-way@rubyforge.org > http://rubyforge.org/mailman/listinfo/hobix-is-the-way -- William From mental at rydia.net Fri Sep 2 17:20:30 2005 From: mental at rydia.net (mental@rydia.net) Date: Fri Sep 2 17:13:51 2005 Subject: Tags-related feature request In-Reply-To: <20050902222812.4ff8c9f5.tilman@code-monkey.de> References: <20050902222812.4ff8c9f5.tilman@code-monkey.de> Message-ID: <1125696030.4318c21eefc80@www.rydia.net> Quoting Tilman Sauerbeck : > Hi, > with the not-so-recent addition of tags support, I wonder whether > it's possible to make Hobix store articles in a central place, > without hardcoding the "primary tag" in the path to the file > (which is the directory the article is stored in). The "primary tag" is not mandatory; I don't think there's anything stopping you from plopping everything directly in the entries/ directory and only using tags: for tagging. -mental From why at hobix.com Fri Sep 2 17:35:18 2005 From: why at hobix.com (why the lucky stiff) Date: Fri Sep 2 17:28:29 2005 Subject: Tags-related feature request In-Reply-To: <20050902222812.4ff8c9f5.tilman@code-monkey.de> References: <20050902222812.4ff8c9f5.tilman@code-monkey.de> Message-ID: <4318C596.9080208@hobix.com> Tilman Sauerbeck wrote: >I'd like to produce URLs like they are used in typo (and probably every other blogging engine ;), which don't give away the "primary tag". > > The best technique for this was recently covered in a changelog explanation. Looking for it... Here it is: Read the bottom of the message: BaseContent::link_format. Only works with CVS Hobix. _why From tilman at code-monkey.de Sat Sep 3 10:43:27 2005 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat Sep 3 10:36:38 2005 Subject: Tags-related feature request In-Reply-To: <20050902211404.GA20221@masanjin.net> References: <20050902222812.4ff8c9f5.tilman@code-monkey.de> <20050902211404.GA20221@masanjin.net> Message-ID: <20050903164327.1847eb12.tilman@code-monkey.de> On Fri, 2 Sep 2005 16:14:04 -0500 William Morgan wrote: > You can store all your entries in directly in htdocs/ and simply add a > tags: field to each. Then there's no concept of a primary tag / section. > > Is that the behavior you wanted? I'm not that familiar with typo. Yes, together with what why said (overriding Hobix::BaseContent.link_format), that would work. However, it's not possible to create entries without a category: # hobix post blog Hobix::ProjectPage blah *** Loading /home/tilman/devel/websites/blog/hobix.out.quick The category for blah doesn't exist. Create it [Yn]? Does anyone want to fix/enhance this? :) Regards, Tilman -- learn to quote: http://www.netmeister.org/news/learn2quote.html From tilman at code-monkey.de Sat Sep 3 18:05:33 2005 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sat Sep 3 17:58:42 2005 Subject: Tags-related feature request In-Reply-To: <20050903164327.1847eb12.tilman@code-monkey.de> References: <20050902222812.4ff8c9f5.tilman@code-monkey.de> <20050902211404.GA20221@masanjin.net> <20050903164327.1847eb12.tilman@code-monkey.de> Message-ID: <20050904000533.4a2bcc13.tilman@code-monkey.de> On Sat, 3 Sep 2005 16:43:27 +0200 Tilman Sauerbeck wrote: > On Fri, 2 Sep 2005 16:14:04 -0500 William Morgan wrote: > > > You can store all your entries in directly in htdocs/ and simply add a > > tags: field to each. Then there's no concept of a primary tag / section. > > > > Is that the behavior you wanted? I'm not that familiar with typo. > > Yes, together with what why said (overriding Hobix::BaseContent.link_format), that would work. > > However, it's not possible to create entries without a category: > [...] I think that error occured because I didn't create the entries/ directory yet. So now I can create entries without giving the section. After this, I stumbled on the following problems: I'm using a custom entry class for my project pages (see http://code-monkey.de/ for my current setup), called Hobix::ProjectPage. I put its implementation in lib/local.rb, and it looks like this: class ProjectPage < BaseEntry _ :title, :req => true, :edit_as => :text, :search => :fulltext _ :content, :req => true, :edit_as => :textarea, :search => :fulltext, :text_processor => true no_implicit_tags def content self.class.text_processor.new(@content) end end I added a couple of entries (put them just below entries/, no section). When I wanted to upgen the blog, I got the same "method to_html not found for String..." errors that Johan Sorensen reported some days ago. I fixed this my implementing ProjectPage#content, as you can see above. I had a look at the code and I noticed that Hobix only dealt with IndexEntry objects when it created the monthly index pages. This raises the question, do I have to create my own IndexEntry class as well for my ProjectPage entries? If so, how do I tell Hobix to use my own IndexEntry class instead of the original one? Also, how do I make Hobix *not* include my ProjectPage entries in the monthly/weekly/whatever summaries, if I don't use sections? AFAIK currently you have to set the "ignore" flag in the section to false to prevent this. Is there any way to accomplish the same without sections? Thanks, Tilman -- learn to quote: http://www.netmeister.org/news/learn2quote.html From tom at gehennom.net Mon Sep 5 02:32:22 2005 From: tom at gehennom.net (Thomas Cowart) Date: Mon Sep 5 02:25:54 2005 Subject: [total noob] Archive link Message-ID: <431BE676.606@gehennom.net> I just started fiddling around with hobix today and have most everything set up. the last link I have that's acting wonky is the default archive link from the default index.html. When I build the new blog it makes this link a local link -- that is, it's instead of href="xxx.xxx.xxx.xxx:2000/gmf/2005/09". I don't mind fixing this on my own, but I have no idea where the archiving stuff is built and can't find anything about it in the .hobixrc or the hobix.yaml files (i hate not having grep on windows). can someone help? thanks, Thomas Cowart From tom at gehennom.net Mon Sep 5 13:51:28 2005 From: tom at gehennom.net (Thomas Cowart) Date: Mon Sep 5 13:44:31 2005 Subject: [total noob] Archive link Message-ID: <431C85A0.1040309@gehennom.net> > the last link I have that's acting wonky is the default archive > link from the default index.html. When I build the new blog it makes > this link a local link -- that is, it's > instead of href="xxx.xxx.xxx.xxx:2000/gmf/2005/09". I don't mind > fixing this on my own, but I have no idea where the archiving stuff is > built and can't find anything about it in the .hobixrc or the > hobix.yaml files Okay. After some sleep, serching, and epiphany I realized what I was looking for was the quick.rb template. The issue I was having is also in the CSS tag (@import "C:/gmf/site.css";) in there and it deals with the Weblog::expand_path (and therefore the File::expand_path function). The CSS and the Archves are the only places where this is used in quick.rb and since this is the only default template that uses CSS, is that function necessary? Was it just left in there by accident? Thomas From tom at gehennom.net Mon Sep 5 15:44:13 2005 From: tom at gehennom.net (Thomas Cowart) Date: Mon Sep 5 15:37:17 2005 Subject: [total noob] Archive link Message-ID: <431CA00D.1040004@gehennom.net> > Okay. After some sleep, serching, and epiphany I realized what I was > looking for was the quick.rb template. The issue I was having is also > in the CSS tag (@import "C:/gmf/site.css";) in there and it deals with > the Weblog::expand_path (and therefore the File::expand_path > function). The CSS and the Archves are the only places where this is > used in quick.rb and since this is the only default template that uses > CSS, is that function necessary? Was it just left in there by > accident? This is in weblog.rb, line 313, btw. The problem was that File::expand_path autoomatically appends stuff to the beginning of the pathname so that it is valid under whatever OS it's being used in. Under unix(-like) systems, this works because it just adds a '/'. big deal. With Windows it seems to add a "C:" automatically. I just appended .gsub( /^\w:/, '') to the function to get rid of the drive letter, since gsub seems like the way to do things around here. does anyone have any better suggestions? sorry for wasting so much time (and I hope this gets posted correctly) Thomas From jbd at justindossey.com Wed Sep 14 18:38:50 2005 From: jbd at justindossey.com (jbd@justindossey.com) Date: Wed, 14 Sep 2005 17:38:50 -0500 (CDT) Subject: to_yaml and to_yaml_orig Message-ID: Hey all, I'm seeing intermittent errors with dumping Entry objects to yaml. The Entry object I'm dumping is perfectly fine, but it gives me Stack level too deep . . . /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml_orig' /usr/lib/ruby/site_ruby/1.8/hobix/entry.rb:97:in `to_yaml' How do yall recommend I debug or fix this issue? -- Justin Dossey From tilman at code-monkey.de Wed Sep 21 12:57:05 2005 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Wed, 21 Sep 2005 18:57:05 +0200 Subject: [PATCH] Ruby 1.8.3 fix Message-ID: <20050921165704.GA32027@code-monkey.de> Hi, here's a patch which makes Hobix work w/ Ruby 1.8.3. Regards, Tilman -- learn to quote: http://www.netmeister.org/news/learn2quote.html -------------- next part -------------- Index: lib/hobix/commandline.rb =================================================================== RCS file: /var/cvs/hobix/hobix/lib/hobix/commandline.rb,v retrieving revision 1.29 diff -u -r1.29 commandline.rb --- lib/hobix/commandline.rb 14 Aug 2005 00:16:15 -0000 1.29 +++ lib/hobix/commandline.rb 21 Sep 2005 16:36:24 -0000 @@ -25,7 +25,7 @@ ## [ [ENV['HOME'], ENV['HOME']], - [ENV['APPDATA'], File.join( ENV['APPDATA'], 'Hobix' )] + [ENV['APPDATA'], File.join( ENV['APPDATA'] || "", 'Hobix' )] ].each do |home_top, home_dir| next unless home_top if File.exists? home_top From sl33p3r at free.fr Fri Sep 30 15:59:55 2005 From: sl33p3r at free.fr (Frederick Ros) Date: Fri, 30 Sep 2005 21:59:55 +0200 Subject: [PATCH] Ruby 1.8.3 fix In-Reply-To: <20050921165704.GA32027@code-monkey.de> References: <20050921165704.GA32027@code-monkey.de> Message-ID: <20050930195955.GA9266@hal.void.org> Tilman Sauerbeck wrote : | Hi, | here's a patch which makes Hobix work w/ Ruby 1.8.3. Hi, Sorry for the delay !!! I've commited the patch to CVS. I also commited 2 other patches: one to allow plugin to change the output file name, the other one to change - to _ when encountered in a skel filename. By the way, i think it would be great to officially tag and deliver a 0.4 version ... What do you think about that ? -- Frederick Ros aka Sleeper -- sleeper at jabber.fr "...[Linux's] capacity to talk via any medium except smoke signals." (By Dr. Greg Wettstein, Roger Maris Cancer Center) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20050930/eaf71f82/attachment.bin From paul at luon.net Fri Sep 30 15:58:20 2005 From: paul at luon.net (Paul van Tilburg) Date: Fri, 30 Sep 2005 21:58:20 +0200 Subject: [PATCH] Ruby 1.8.3 fix In-Reply-To: <20050930195955.GA9266@hal.void.org> References: <20050921165704.GA32027@code-monkey.de> <20050930195955.GA9266@hal.void.org> Message-ID: <20050930195820.GA26388@power.luon.net> On Fri, Sep 30, 2005 at 09:59:55PM +0200, Frederick Ros wrote: > By the way, i think it would be great to officially tag and deliver a > 0.4 version ... > > What do you think about that ? Ow, yes, please! My package users are begging for a new version :) Good work, Paul -- Student @ Eindhoven | email: paul at luon.net University of Technology, The Netherlands | JID: paul at luon.net >>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20050930/c0f965dd/attachment-0001.bin From splaestro at gmail.com Fri Sep 30 16:16:18 2005 From: splaestro at gmail.com (Brian C Young) Date: Fri, 30 Sep 2005 15:16:18 -0500 Subject: [PATCH] Ruby 1.8.3 fix In-Reply-To: <20050930195820.GA26388@power.luon.net> References: <20050921165704.GA32027@code-monkey.de> <20050930195955.GA9266@hal.void.org> <20050930195820.GA26388@power.luon.net> Message-ID: <433D9D12.40209@gmail.com> Paul van Tilburg wrote: >On Fri, Sep 30, 2005 at 09:59:55PM +0200, Frederick Ros wrote: > > >>By the way, i think it would be great to officially tag and deliver a >>0.4 version ... >> >>What do you think about that ? >> >> > >Ow, yes, please! My package users are begging for a new version :) > >Good work, > >Paul > > I second that! I was reading through the ML archives last night, marveling at all the new stuff that's been added. Can it be made available so that 'hobix upgrade' will pick up the latest? Thanks. Brian