From thiago.arrais at gmail.com Tue Sep 11 23:04:42 2007 From: thiago.arrais at gmail.com (Thiago Arrais) Date: Wed, 12 Sep 2007 00:04:42 -0300 Subject: [Mediacloth-devel] [PATCH] (Mediacloth) Fix lexer test Message-ID: It seems like someone changed the input file but forgot to update the corresponding output for the test. This patch fixes it and is the last one for test fixing. I hope to start sending some patches for easier generator customization today. Any thoughts on the previous ones? Regards, Thiago Arrais From thiago.arrais at gmail.com Wed Sep 12 16:02:21 2007 From: thiago.arrais at gmail.com (Thiago Arrais) Date: Wed, 12 Sep 2007 17:02:21 -0300 Subject: [Mediacloth-devel] [PATCH] (Mediacloth) Fix lexer test In-Reply-To: References: Message-ID: On 9/12/07, Alexander Dymo wrote: > Looks like you forgot to attach it ;) Oops, this is what I get for working late into the night. I'll try to remember to attach it to the message this time. ;-) There is another one coming soon... > Btw, we're currently using racc and hand-written parser for parsing, > what would you think about writing a PEG parser (maybe even packrat) > for wiki grammar (I'm just collecting ideas now on how to make our > code simpler and do more than it does now)? I need to do my research before having an opinion on that as I never have done any serious parsing myself for my Ruby endeavours. I generally like to use EBNF parsers for my projects, but I am not anywhere near religious about it. What do you expect to gain from converting to a PEG parser? Cheers, Thiago Arrais -- Mergulhando no Caos - http://thiagoarrais.wordpress.com Pensamentos, id?ias e devaneios sobre desenvolvimento de software e tecnologia em geral -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-lexer-test.diff Type: application/octet-stream Size: 625 bytes Desc: not available Url : http://rubyforge.org/pipermail/mediacloth-devel/attachments/20070912/589cf1d9/attachment.obj From thiago.arrais at gmail.com Wed Sep 12 16:38:17 2007 From: thiago.arrais at gmail.com (Thiago Arrais) Date: Wed, 12 Sep 2007 17:38:17 -0300 Subject: [Mediacloth-devel] [PATCH] (Mediacloth) Converts HTML generator to recursive style Message-ID: Here finally is one of my real feature-changing patches for Mediacloth. It converts the HTML generator from the previous accumulating style to a more recursive approach. There should be no changes for the code that uses the old generator, but this one is a little more open for extension. With this code in place, people will be able to customize their HTML generation code more easily. Now they only need to override the methods that they need to change instead of working around the accumulating style. Say we need to ignore formatting tags or to use a tag instead of the default format tags. With this changes, one just needs to subclass the MediaWikiHTMLGenerator class and override the parse_formatted method: class Generator < MediaWikiHTMLGenerator protected def parse_formatted(ast) "" + parse_wiki_ast(ast) + "" end end When the @html field is used as accumulator, we can't change the tag contents without messing with the other methods because they are tied by it. I also removed the private protection from the formatting_tag method in order to allow it to be overridden. There are some obvious improvements to be made to this patch. I am sending this version more as a request for comments than as a proper patch. Cheers, Thiago Arrais -------------- next part -------------- A non-text attachment was scrubbed... Name: converts-html-generator-to-recursive-style.diff Type: text/x-patch Size: 3136 bytes Desc: not available Url : http://rubyforge.org/pipermail/mediacloth-devel/attachments/20070912/cb2f8d2d/attachment.bin From thiago.arrais at gmail.com Tue Sep 18 08:36:59 2007 From: thiago.arrais at gmail.com (Thiago Arrais) Date: Tue, 18 Sep 2007 09:36:59 -0300 Subject: [Mediacloth-devel] [PATCH] (Mediacloth) Converts HTML generator to recursive style (again) Message-ID: Here is a slightly better (in my opinion, obviously) patch from the one that I had sent attached to my previous message: http://rubyforge.org/pipermail/mediacloth-devel/2007-September/000005.html The intent is basically the same: convert the HTML generator from a cumulative style to a recursive style (more details on the link above). The difference is that some code has been pulled up to the MediaWalker class and the parse_wiki_ast method is back due to backwards compatilibity reasons (people could have over-ridden it somewhere and would have their code broken). You will notice that the ASTs children are no longer being fetched by the .each method, but by .map instead. The only difference here is that .map returns a new array formed by the results of applying the passed block to each item on the list and this array can be .join'ed to yield a string. (This patch replaces the previous one) Cheers, Thiago Arrais -- Mergulhando no Caos - http://thiagoarrais.wordpress.com Pensamentos, id?ias e devaneios sobre desenvolvimento de software e tecnologia em geral -------------- next part -------------- A non-text attachment was scrubbed... Name: converts-walker-from-cumulative-to-recursive-style.diff Type: application/octet-stream Size: 4167 bytes Desc: not available Url : http://rubyforge.org/pipermail/mediacloth-devel/attachments/20070918/4609c698/attachment-0001.obj From Gregory.Murphy at Sun.COM Sun Sep 30 15:10:14 2007 From: Gregory.Murphy at Sun.COM (Gregory Murphy) Date: Sun, 30 Sep 2007 12:10:14 -0700 Subject: [Mediacloth-devel] Ping Message-ID: <46FFF496.8070908@sun.com> Is development active on this project? I have written to the owners, but not received a response. I would like to use Mediacloth, and help contribute to it by putting back patches for bug fixes. I'd prefer not to have to fork the code and keep the fixes to myself. // Gregory