Hello everyone, I want to extend RedCloth so my Faculty may use Instiki with the modified RedCloth plugin, for lab exercises. I thought I might use the RedCloth parser and identify new keywords like #!show_sol, #!hide_sol, #solution to permit administrators (professors, assistants) to hide the solutions for the lab exercises when students have to solve them and after that to show the solutions. Using a wiki for labs has lots of advantages and this is why we decided to extend an existent syntax (textile). Can you please give me some tips for this task? * Is it the right approach extending RedCloth? * I browsed the source but couldn''t find the file I should alter (I am Ruby newbie). * How do you find the keywords? Example: #!hide_sol ... # Use the `grep'' command to output the lines containing smth in file.txt #!solution{ cat file.txt | grep "smth" } ... and after the lab: #!show_sol ... # Use the `grep'' command to output the lines containing smth in file.txt #!solution{ cat file.txt | grep "smth" } ... Thank you in advance, Tibi
Hi, Tibi. Sorry I haven''t responded in so long. Things are quite busy at work right now. I suggest you don''t extend RedCloth but rather that you filter that text before passing it to RedCloth. Just a couple regular expressions in Ruby could handle it much better than RedCloth and at very low expense. Best wishes! Jason Garber On Sep 9, 2008, at 3:22 PM, Tibi Turbureanu wrote:> Hello everyone, > > I want to extend RedCloth so my Faculty may use Instiki with the > modified RedCloth plugin, for lab exercises. > > I thought I might use the RedCloth parser and identify new keywords > like > #!show_sol, #!hide_sol, #solution to permit administrators > (professors, > assistants) to hide the solutions for the lab exercises when students > have to solve them and after that to show the solutions. > > Using a wiki for labs has lots of advantages and this is why we > decided > to extend an existent syntax (textile). > > Can you please give me some tips for this task? > * Is it the right approach extending RedCloth? > * I browsed the source but couldn''t find the file I should alter (I am > Ruby newbie). > * How do you find the keywords? > > Example: > > #!hide_sol > ... > # Use the `grep'' command to output the lines containing smth in > file.txt > #!solution{ > cat file.txt | grep "smth" > } > ... > > and after the lab: > > #!show_sol > ... > # Use the `grep'' command to output the lines containing smth in > file.txt > #!solution{ > cat file.txt | grep "smth" > } > ... > > Thank you in advance, > Tibi > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards
Hi Jason and thank you for your response, On Fri, 2008-09-12 at 03:33 -0400, Jason Garber wrote:> Hi, Tibi. Sorry I haven''t responded in so long. Things are quite > busy at work right now.Good luck! ;)> > I suggest you don''t extend RedCloth but rather that you filter that > text before passing it to RedCloth. Just a couple regular > expressions in Ruby could handle it much better than RedCloth and at > very low expense.I tried but can''t find where in the source code is the part Instiki sends the wiki page to RedCloth parser. Can you give me some tips? :D Thanks, Tibi> > > On Sep 9, 2008, at 3:22 PM, Tibi Turbureanu wrote: > > > Hello everyone, > > > > I want to extend RedCloth so my Faculty may use Instiki with the > > modified RedCloth plugin, for lab exercises. > > > > I thought I might use the RedCloth parser and identify new keywords > > like > > #!show_sol, #!hide_sol, #solution to permit administrators > > (professors, > > assistants) to hide the solutions for the lab exercises when students > > have to solve them and after that to show the solutions. > > > > Using a wiki for labs has lots of advantages and this is why we > > decided > > to extend an existent syntax (textile). > > > > Can you please give me some tips for this task? > > * Is it the right approach extending RedCloth? > > * I browsed the source but couldn''t find the file I should alter (I am > > Ruby newbie). > > * How do you find the keywords? > > > > Example: > > > > #!hide_sol > > ... > > # Use the `grep'' command to output the lines containing smth in > > file.txt > > #!solution{ > > cat file.txt | grep "smth" > > } > > ... > > > > and after the lab: > > > > #!show_sol > > ... > > # Use the `grep'' command to output the lines containing smth in > > file.txt > > #!solution{ > > cat file.txt | grep "smth" > > } > > ... > > > > Thank you in advance, > > Tibi > > > > _______________________________________________ > > Redcloth-upwards mailing list > > Redcloth-upwards at rubyforge.org > > http://rubyforge.org/mailman/listinfo/redcloth-upwards > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2161 bytes Desc: not available URL: <http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080914/c135f711/attachment.bin>
On Sun, 2008-09-14 at 23:51 +0300, Tibi Turbureanu wrote:> Hi Jason and thank you for your response, > > On Fri, 2008-09-12 at 03:33 -0400, Jason Garber wrote: > > Hi, Tibi. Sorry I haven''t responded in so long. Things are quite > > busy at work right now. > > Good luck! ;) > > > > I suggest you don''t extend RedCloth but rather that you filter that > > text before passing it to RedCloth. Just a couple regular > > expressions in Ruby could handle it much better than RedCloth and at > > very low expense.If you did go down the route of extending Redcloth, you can look at the tests / reimplementing the formatters. I did have a page that explained how to do this, but damn server is down (friend''s server, I planned to move away from it tbh).> I tried but can''t find where in the source code is the part Instiki > sends the wiki page to RedCloth parser. Can you give me some tips? :Dgrep is your friend here. From the Instiki source, I suggest: grep -rn ''Redcloth'' . If there is .svn files about, you can make this: grep -rn ''Redcloth'' . | svn -v svn see as the pesky SVN files always get in the way.> Thanks, > Tibi > > > > > > On Sep 9, 2008, at 3:22 PM, Tibi Turbureanu wrote: > > > > > Hello everyone, > > > > > > I want to extend RedCloth so my Faculty may use Instiki with the > > > modified RedCloth plugin, for lab exercises. > > > > > > I thought I might use the RedCloth parser and identify new keywords > > > like > > > #!show_sol, #!hide_sol, #solution to permit administrators > > > (professors, > > > assistants) to hide the solutions for the lab exercises when students > > > have to solve them and after that to show the solutions. > > > > > > Using a wiki for labs has lots of advantages and this is why we > > > decided > > > to extend an existent syntax (textile). > > > > > > Can you please give me some tips for this task? > > > * Is it the right approach extending RedCloth? > > > * I browsed the source but couldn''t find the file I should alter (I am > > > Ruby newbie). > > > * How do you find the keywords? > > > > > > Example: > > > > > > #!hide_sol > > > ... > > > # Use the `grep'' command to output the lines containing smth in > > > file.txt > > > #!solution{ > > > cat file.txt | grep "smth" > > > } > > > ... > > > > > > and after the lab: > > > > > > #!show_sol > > > ... > > > # Use the `grep'' command to output the lines containing smth in > > > file.txt > > > #!solution{ > > > cat file.txt | grep "smth" > > > } > > > ... > > > > > > Thank you in advance, > > > Tibi > > > > > > _______________________________________________ > > > Redcloth-upwards mailing list > > > Redcloth-upwards at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/redcloth-upwards > > > > _______________________________________________ > > Redcloth-upwards mailing list > > Redcloth-upwards at rubyforge.org > > http://rubyforge.org/mailman/listinfo/redcloth-upwards > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards