From nicolas.delsaux at gmail.com Mon Nov 13 14:53:31 2006 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Mon, 13 Nov 2006 20:53:31 +0100 Subject: [Pimki-users] register as developper for Pimki In-Reply-To: <3ff47be90611091436p2552f639if25f068651f823c6@mail.gmail.com> References: <20061107083038.C47305240F08@rubyforge.org> <3ff47be90611071523m314ede97m6ad3bdd95d3ec859@mail.gmail.com> <418361960611090901t55ae8eeeke0b51b9710d66868@mail.gmail.com> <3ff47be90611091436p2552f639if25f068651f823c6@mail.gmail.com> Message-ID: <418361960611131153u599adf0gaabdf0b1ba155a7e@mail.gmail.com> On 11/9/06, Assaph Mehr wrote: > Hi Nicolas, > > > * Prepare the database > > Run 'rake migrate' from the project root. This should create and > initialise the DB as db/dev.db3. > (I'm betting this is the step you missed ;) Obviously, you were right. Well, in fact, there were also issues regarding dependancies, issues that I solved using Locomotive (since I'm quite a Mac newbie, I had weird issues regardin the install of sqlite-ruby package and the lack of a valid ruby.h file). > > * Start the application > > Hopefully it should work. if not, send me the development.log. Oh my god, it's alive, it's ALIVE :-) > > Looking forward to your feedback. Nice new stylesheet. So, now, i must do a svn update to sync with latest news, and start coding my own features. Besides, I''ve noticed in the instiki doc that there already exists a footnote system, but not working like mine : the main difference is that I add the footnote directly where its calling link appears, allowing me not to handle those crazy numbers. In fact, it's a port of docbook system making my footnotes look like : My text needs a footnoteAnd here is the footnote. Do you think it could be added, since I find this system really cleaner ? So, i must now check my suggested features and choose the one to work on first ... Well, the look was quite long, since dyndns seems to have borken my nicolas-delsaux.homelinux.net website, which runs a pimki 1.8.2 containing all feature descriptions and details. So .. I think i could start by taking a look at code syntax highlight. Candidates highlighters are http://rubyforge.org/projects/syntax http://rd.cycnus.de/coderay/ I have a little preference for coderay, since it's more adapted to my needs, which include Java, Javascript, XML, ... and Ruby of course. So ... from what I can imagine (never forget I'm a complete Ruby newbie), the first step would be to download my candidate (say coderay) as a gem (like says the doc) For the rendering, I have choose to use the method already used in my good lod wordpress plugin : a square bracketed tag at the begining, and the closing one at the end and inside the code, like in [RUBY] require 'coderay' tokens = CodeRay.scan "puts 'Hello, world!'", :ruby page = tokens.html :line_numbers => :inline, :wrap => :page puts page [/RUBY] >From what I've seen, i believe it should only be a rendering modification. I guess it could be a custom chunk element ... Sidenote : I believe this chunk system could also be used for my SF library So, I create one more chunk with simple beta code : # Chunk for including syntax highlighted computer code. # This chunk uses the coderay library class SyntacticHighlightChunk < Chunk SYNTAX_HIGHLIGHT_PATTERN = Regexp.new('RUBY', Regexp::MULTILINE) def self.pattern() SYNTAX_HIGHLIGHT_PATTERN end def resolved_text(view) 'toto' end end More due to my lack of skill on regexp than anything else Besides, one should implement here a kind of proxy system like the one mentionned in one of the ruby blogs I read ... that's it : eigenvalue : http://eigenclass.org/hiki.rb?cmd=view&p=ruby+plugins&key=plugin So, back to my code ... I added my chunk to the POST_ENGINE ones and reloaded my page and nothing happens. Well, that may be called a bad karma. To be continued ... > Cheers, > Assaph > -- 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 Tue Nov 14 15:03:23 2006 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Tue, 14 Nov 2006 21:03:23 +0100 Subject: [Pimki-users] register as developper for Pimki In-Reply-To: <3ff47be90611132005i51cdd77av2b38e34737911b6f@mail.gmail.com> References: <20061107083038.C47305240F08@rubyforge.org> <3ff47be90611071523m314ede97m6ad3bdd95d3ec859@mail.gmail.com> <418361960611090901t55ae8eeeke0b51b9710d66868@mail.gmail.com> <3ff47be90611091436p2552f639if25f068651f823c6@mail.gmail.com> <418361960611131153u599adf0gaabdf0b1ba155a7e@mail.gmail.com> <3ff47be90611132005i51cdd77av2b38e34737911b6f@mail.gmail.com> Message-ID: <418361960611141203q35abb7cejd14249c9b824651b@mail.gmail.com> On 11/14/06, Assaph Mehr wrote: > > Oh my god, it's alive, it's ALIVE :-) > > bwahahahaha! :-D > Once again, i put the list in copy, for the sake of memory. > > Thanks. It stretches my graphic design skills to the max.... > I may provide here a little knowledge, since I made myself (with obvious display bugs) my blog stylesheet. > > Yep. When you're ready to submit a patch just update your copy, > resolve conflicts if any and re-run the tests. Use svn diff to create > a patch and send it to me. OK > > > Do you think it could be added, since I find this system really cleaner ? > > The current footnote mechanics are using textile (RedCloth) - there is > no specific support for them. If you want to add a special chunk... Let me guess ... If I want that chunk, I can just ... code it :-)) > > Tried the site and got a 500 error. Let me know if you want me to take a look. Should be corrected now. Take a look at http://nicolas-delsaux.homelinux.net/leblog/show/Pimki+2 There is a bottom link for features proposals. > > To be more inline with the rest of the chunks syntax it should > probably be something like: > [code[ruby]] > at the start and a simple > [[code]] > to end the section. This easily allows using other languages, like > [code[java]]. I use the double brackets for links, and the > [keyword[parameters]] syntax for "macros". There are already some > special such constructs, like: > [bliki[thread]] - links to bliki threads > [>other web[page name]] - links to pages on other webs > [!my-macro[params...]] - macro expansion (planned :) Suggestion included in feature ! > > So i want to keep the same syntax. Note that I was still playing with > the advanced syntax in the trunk, so it may change a little. Once I > have something I like I'll make sure everything conforms. And you'll make sure I can merge my changes with ease ? > > Not sure what you're after, but if you want to put plain text > "objects" and later reference them then definitely yes. Look : [sf[isbn]]227363847495 for retrieving book info [sf[title][sf[] for fetching nearby titles [sf[person]] for a person name All managed with chunks and page dynamic creation. > > You also need to be a bit careful when adding the chunk into the > processing order. The "engine" part is the markup engine > (textile/markdown etc). So for the syntax-highlight chunk it should be > before the engine, and it should mask it's content from further > processing. I believe i can get inspired reading existing code, like, say, ... GlossaryDefinition. I've already notice i only have to insert my class name in the PRE_ENGINE_ACTIONS array (in the revision class). > > %r<\[\[code[([^\]]+)\]\](.*?)\[\[code\]\]>mi > > > This should obviously be replaced with a call to CodeRay ;-) In the final iteration, yes ;-) > You can easily cache the results, as they will not change between page > rendering (unlike links, which need to be resolved each time as the > page may have been created/deleted etc). > Let's use cache in v. 2 > > We all started there :) > Never forget I also begin in Rails ... > > I thought about chunks as plugins, but because the processing order > for chunks is VERY important I am not sure this is the proper way to > go. If someone already hacks the source, they can easily just add the > extra call at the right place to add the new chunk, which is a lot > simple and less error prone (at least until I have hundreds of people > writing customisations....) I'm OK with that, provided you never get that developper crowd. > > Check your regexp, check where you added the chunk etc. Start with > testing the chunk as stand-alone, then as part of page processing. How can I test correctly my chunk ? > > Looking forward to it! :) > You shouldn't hope so. Anyway ... to be continued ... -- 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 assaph at gmail.com Wed Nov 15 23:05:07 2006 From: assaph at gmail.com (Assaph Mehr) Date: Thu, 16 Nov 2006 15:05:07 +1100 Subject: [Pimki-users] register as developper for Pimki In-Reply-To: <418361960611141203q35abb7cejd14249c9b824651b@mail.gmail.com> References: <20061107083038.C47305240F08@rubyforge.org> <3ff47be90611071523m314ede97m6ad3bdd95d3ec859@mail.gmail.com> <418361960611090901t55ae8eeeke0b51b9710d66868@mail.gmail.com> <3ff47be90611091436p2552f639if25f068651f823c6@mail.gmail.com> <418361960611131153u599adf0gaabdf0b1ba155a7e@mail.gmail.com> <3ff47be90611132005i51cdd77av2b38e34737911b6f@mail.gmail.com> <418361960611141203q35abb7cejd14249c9b824651b@mail.gmail.com> Message-ID: <3ff47be90611152005i3ab8d1e4j806afd52e7843f75@mail.gmail.com> Hi Nicolas, Thanks for CC'ing the list. For those joining in, Nicolas has offered some help with Pimki development. If any one is interested in a sneak peek of the (very incomplete) Pimki2, the RubyForge guys are graciously hosting an demo instance at http://pimki.rubyforge.org/demo. I still haven't put the access controls, so I realise that by posting the address it'll be spammed in no time - but feel free to play with it. It also has a section on implementing the Pimki2 features. Feel free to comment on those there or on the list. > > Thanks. It stretches my graphic design skills to the max.... > > > I may provide here a little knowledge, since I made myself (with > obvious display bugs) my blog stylesheet. I try to break the CSS into 3 sections/stylesheets: * positions (layout) - where each bit goes * general style - like borders, heading styles etc * colours - purely the colours of text and heading > > The current footnote mechanics are using textile (RedCloth) - there is > > no specific support for them. If you want to add a special chunk... > > Let me guess ... If I want that chunk, I can just ... code it :-)) :-) > Take a look at http://nicolas-delsaux.homelinux.net/leblog/show/Pimki+2 > There is a bottom link for features proposals. Cool. Will comment there. > > So i want to keep the same syntax. Note that I was still playing with > > the advanced syntax in the trunk, so it may change a little. Once I > > have something I like I'll make sure everything conforms. > > And you'll make sure I can merge my changes with ease ? Yep. I'll cleanup any existing code and any patch before merging. > Look : > [sf[isbn]]227363847495 for retrieving book info > [sf[title][sf[] for fetching nearby titles > [sf[person]] for a person name > All managed with chunks and page dynamic creation. I'd probably go with something like: [!sf-isbn[0380011220]] [!sf-title[Creatures of Light and Darkness]] [!sf-person[Roger Zelazny]] Note how it starts with a ! mark, denoting a macro and that the parameters are inside the inner brackets. If you want to create a custom chunk then maybe use a different mark, say &. For macros (!) I plan to make them be able to either expand to static XHTML or - if the site admin is crazy enough - to ruby/rhtml code. > I believe i can get inspired reading existing code, like, say, ... > GlossaryDefinition. > I've already notice i only have to insert my class name in the > PRE_ENGINE_ACTIONS array (in the revision class). Yep, that the way to do it. > > You can easily cache the results, as they will not change between page > > rendering (unlike links, which need to be resolved each time as the > > page may have been created/deleted etc). > > > Let's use cache in v. 2 By "cache" I mean the CHUNKS table 'cache' column. I do not plan on using Rails page caching. For the amount of users/hits a typical Pimki install should get it's far better to always serve fresh data. > > I thought about chunks as plugins, but because the processing order > > for chunks is VERY important I am not sure this is the proper way to > > go. If someone already hacks the source, they can easily just add the > > extra call at the right place to add the new chunk, which is a lot > > simple and less error prone (at least until I have hundreds of people > > writing customisations....) > > I'm OK with that, provided you never get that developper crowd. Well, there's Peter Fitzgibbons and now you. I'm on way to take over the world, bwahahaha :-) > > Check your regexp, check where you added the chunk etc. Start with > > testing the chunk as stand-alone, then as part of page processing. > > How can I test correctly my chunk ? First create a standalone test for it. Take a look at ./test/unit/glossary_chunks_test.rb or todo_chunk_test.rb for examples. There are a few assert_chunk_* helper methods in test_helper.rb. You can then add a few more test methods about how the chunk behaves together with other chunks. Look at the revision_test.rb for how to use the Page.revise mechanics. As always, if you run into any issue just ask. Cheers, Assaph From nicolas.delsaux at gmail.com Sat Nov 18 16:18:04 2006 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sat, 18 Nov 2006 22:18:04 +0100 Subject: [Pimki-users] register as developper for Pimki In-Reply-To: <3ff47be90611152005i3ab8d1e4j806afd52e7843f75@mail.gmail.com> References: <20061107083038.C47305240F08@rubyforge.org> <3ff47be90611071523m314ede97m6ad3bdd95d3ec859@mail.gmail.com> <418361960611090901t55ae8eeeke0b51b9710d66868@mail.gmail.com> <3ff47be90611091436p2552f639if25f068651f823c6@mail.gmail.com> <418361960611131153u599adf0gaabdf0b1ba155a7e@mail.gmail.com> <3ff47be90611132005i51cdd77av2b38e34737911b6f@mail.gmail.com> <418361960611141203q35abb7cejd14249c9b824651b@mail.gmail.com> <3ff47be90611152005i3ab8d1e4j806afd52e7843f75@mail.gmail.com> Message-ID: <418361960611181318y561ff4fbtf0c25472710814e7@mail.gmail.com> On 11/16/06, Assaph Mehr wrote: > Hi Nicolas, > > Yep, that the way to do it. That's now the way it's done. > > Well, there's Peter Fitzgibbons and now you. I'm on way to take over > the world, bwahahaha :-) > Oh my god, I'm feeling like you're a purple tentacle :-) > > First create a standalone test for it. Take a look at > ./test/unit/glossary_chunks_test.rb or todo_chunk_test.rb for > examples. There are a few assert_chunk_* helper methods in > test_helper.rb. Is there a URL I could read for knowing how to test and how to launch my test. > > As always, if you run into any issue just ask. Well, I now have a pure coding issue. I've written the following chunk : # Chunk for including syntax highlighted computer code. # This chunk uses the coderay library class SyntacticHighlightChunk < Chunk SYNTAX_HIGHLIGHT_PATTERN = %r<\[code\[([\w]+?)\]\](.*?)\[\[code\]\]>im def self.pattern() SYNTAX_HIGHLIGHT_PATTERN end def resolved_text(view) 'todo: syntax highlight' end end My issue is that, whatever I try, I cannot put any dynamic content in the resolve_content without getting a rendering error. I've tried params[0], @match_data.captures[0], and even other things, but none of them worked. It seems to me it's due to my poor understanding of regexp. From what I known, elements surrounded by "()" are memorized as regexp params and can be reused latter. but it seems that Ruby does not works this way ... Like you said, I added ? in the places i want my content to be memorized, but it neither worked. So, without coding yourself my work, can you give me a hint on the way to make it work. In fact, looking at pimki from my J2EE background, it seems to me I've a real poor understanding of the application flow. I now page rendering is done in the rhtml by invoking page.current_revision.display_content But the revision code is too rubyish to me. Furthermore, i don't really know when chunks are initialized, making my use of the regexp a little too voodoo for me. Are there any tools for easier ruby appls understanding (in J2EE world, i would invoke classical UML diagrams (sequence and the such), knowing there does not exists any tool for generating them). Cheers -- 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 Tue Nov 21 04:37:12 2006 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Tue, 21 Nov 2006 10:37:12 +0100 Subject: [Pimki-users] [doc]model and controllers Message-ID: <418361960611210137q5c54b34ek182a6a6a460b4ab1@mail.gmail.com> Using rav, I generated this diagram of my pimki version : http://nicolas-delsaux.is-a-geek.net/wordpress/index.php/archives/2006/cest-quand-meme-bien-foutu-rails/ Maybe it could be of any help, although I regret the lack of web workflow -- 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 assaph at gmail.com Tue Nov 21 22:34:00 2006 From: assaph at gmail.com (Assaph Mehr) Date: Wed, 22 Nov 2006 14:34:00 +1100 Subject: [Pimki-users] [doc]model and controllers In-Reply-To: <418361960611210137q5c54b34ek182a6a6a460b4ab1@mail.gmail.com> References: <418361960611210137q5c54b34ek182a6a6a460b4ab1@mail.gmail.com> Message-ID: <3ff47be90611211934v6eb1f1eenb5a4f8156da311ef@mail.gmail.com> On 11/21/06, Nicolas Delsaux wrote: > Using rav, I generated this diagram of my pimki version : > http://nicolas-delsaux.is-a-geek.net/wordpress/index.php/archives/2006/cest-quand-meme-bien-foutu-rails/ > Maybe it could be of any help, although I regret the lack of web workflow looks nice. I never actually bothered with an ERD though. I'll post a bit of an explanation on the demo site shortly: http://pimki.rubyforge.org/demo/show/InformationForDevelopers. Cheers, Assaph From nicolas.delsaux at gmail.com Fri Nov 24 05:17:49 2006 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Fri, 24 Nov 2006 11:17:49 +0100 Subject: [Pimki-users] register as developper for Pimki In-Reply-To: <3ff47be90611212107u308842bco6c26dec116a99f1@mail.gmail.com> References: <20061107083038.C47305240F08@rubyforge.org> <3ff47be90611071523m314ede97m6ad3bdd95d3ec859@mail.gmail.com> <418361960611090901t55ae8eeeke0b51b9710d66868@mail.gmail.com> <3ff47be90611091436p2552f639if25f068651f823c6@mail.gmail.com> <418361960611131153u599adf0gaabdf0b1ba155a7e@mail.gmail.com> <3ff47be90611132005i51cdd77av2b38e34737911b6f@mail.gmail.com> <418361960611141203q35abb7cejd14249c9b824651b@mail.gmail.com> <3ff47be90611152005i3ab8d1e4j806afd52e7843f75@mail.gmail.com> <418361960611181318y561ff4fbtf0c25472710814e7@mail.gmail.com> <3ff47be90611212107u308842bco6c26dec116a99f1@mail.gmail.com> Message-ID: <418361960611240217j47dd5fd9x16a74ffa2b9ca2f0@mail.gmail.com> On 11/22/06, Assaph Mehr wrote: > > You can start with a general guide to testing rails: > http://manuals.rubyonrails.com/read/book/5 > > > What's the error exactly? I'm a morron. THAT is the error. I was trying to do def resolved_text() params[0] end which fails. But after many tests, I tried params.inspect which returned me an array, and then I concluded with params[0].to_s which works awfully well. I will use cache latter, when all current issues will be solved. > > > It should... In fact, it is. > > I'll try to explain how it all works on > http://pimki.rubyforge.org/demo/show/Pimki2DataModel (.... and also > possibly better documenting my code ;). I've taken a look at it, and, without further reading, i can already say it will be helpful. > > BTW, As someone who has done UMLs professionally for a few years > before running away screaming, Normal reaction, I guess ;-) > I believe Ruby code - once the penny > drops - is actually more readable and compact than diagrams. yup. See ya latter for issue of the day : coderay requiring failing and, maybe, locomotive restart -- 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 Sat Nov 25 12:18:06 2006 From: nicolas.delsaux at gmail.com (Nicolas Delsaux) Date: Sat, 25 Nov 2006 18:18:06 +0100 Subject: [Pimki-users] [chunk[syntax highlight]] alpha version Message-ID: <418361960611250918t7ec2ad72yfcfe9f2d00702444@mail.gmail.com> So ... After just a few seconds for coding it :-)) I wrote a chunk for managing syntax highlight. This chunk is described in the diff joined. It requires coderay, so don't forget to gem install coderay Furthermore, i didn't diffed the revision.rb wherre this chunk is added as a pre-rendering one. Finally, here are the following issues : 1 - regexp may not handle more than one highlighted section (i must find out why) 2 - contrary to coderay's author description, i find coderay to be quite slow (I guess it's more du to my poor ruby, pimki and coderay knowledge, here is why coderay's author will receive a copy of this mail, with all my thanks for his library), requiring caching (which i was not able to install, due to a cache size issue - ah, the joices of DB-driven development), so it mlay slow down rendering ... a solution should be latter found. Besides, it's a good alpha version and a good entry point in pimki's marvelous world. -- 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: chunk_diff_for_syntax_highlight.diff Type: application/octet-stream Size: 1608 bytes Desc: not available Url : http://rubyforge.org/pipermail/pimki-users/attachments/20061125/740abed3/attachment.obj