From: Ian B. <ia...@co...> - 2004-05-17 15:52:52
|
I'm not sure about your specific questions, but you may want to look at Frank's PyDiddy port, which is pretty short and does Wiki formatting: http://cvs.sourceforge.net/viewcvs.py/webware-sandbox/Sandbox/fbar/pydiddy/ Sujit Marar wrote: > Hi > > Can anyone give code snippet > on wikiformating for text formatting , text fonts > and text faces in webware action class > and cheetah template > > Only simple text features are supported in > WikiFormating as shown above > > I have attached the part of source code > This is the EditAct(Action class for editing) > def wikiformatter(self,result=None): > # url of your wiki up to page name > wikibaseurl = "" > result = '' > for line in self.wikitext: > result += line > > > > # '' for emphasis, ''' for strong, ---- > for a horizontal rule > result = re.sub(r"'''(.*?)'''", > r"<strong>\1</strong>", result) > # result = re.sub(r"'''(.*?)'''", r"<strong > class="highlight">\1</strong>", result) > result = re.sub(r"''(.*?)''", > r"<em>\1</em>", result) > result = re.sub(r"''(.*?)''", > r"<heading>\1</heading>", result) > result = re.sub(r"''(.*?)''", > r"<sub\1</sub>", result) > result = re.sub(r"''(.*?)''", > r"<sup>\1</sup>", result) > result = re.sub(r"''(.*?)''", > r"<tt>\1</tt>", result) > result = re.sub(r"''(.*?)''", > r"<pre>\1</pre>", result) > result = re.sub(r"''(.*?)''", > r"<u>\1</u>", result) > result = re.sub(r"\n(-{4,})\n", "<hr>", > result) > > > # Convert two or more newlines into <p> > result = re.sub(r'\n{2,}', r'</p>\n<p>', > result) > > > > > def __init__(self, wikitext = ''): > self.wikitext = wikitext > > In the Webware Action There is edit action > > req = self.request() > title = req.field("title") > textField = req.field("textField") > text = (req.field("text") > > How to access there fields in Cheetah template > I want the wikitext to be converted to HtmlWhen the > user edited the text in wiki and presses the Submit > button and if needs to preview the wiki content > before saving and how the conversion be take place > Can anyone shows the code snippet in Webware and > Cheetah > > It is glad if anyone can post the code snippet for the > above queries > > > > > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! - Internet access at a great low price. > http://promo.yahoo.com/sbc/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Webware-discuss mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webware-discuss -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |