« Return to Thread: pier

Re: pier

by Lukas Renggli-2 :: Rate this Message:

Reply to Author | View in Thread

> I used PRDocumentParser parse: '""hi all""',
> but this method returns PRDocument.
>
> But I want reneder this string in renederContentOn: method

   document := PRDocumentParser parse: '""hi all""'.

The parser returns a document, this is the root of an AST representing  
your input. It is independent from the actual output, but it can be  
easily transformed into about any other format.

For example plain text:

   PRTextWriter write: document --> 'hi all'

Back to wiki syntax:

   PRWikiWriter write: document --> '""hi all""'

Latex (you need a special plugin here):

   PRLatexWriter write: document --> '\textbf{hi all}'

And, of course, also to HTML (you need Seaside and Pier-Seaside here):

   PRViewRenderer new
     start: document
     in: aComponent
     on: html --> '<strong>hi all</strong>'

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

 « Return to Thread: pier

LightInTheBox - Buy quality products at wholesale price