Is there a way to translate a Pier document to html? For example,
PRWikiWriter write: (PRDocumentParser parse: '!Hello World') translates into the original Pier document. Is there something like PRHtmlWriter that would translate the above into '<h1>Hello World</h1>'? Thanks, Brian. _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
> Is there a way to translate a Pier document to html? For example,
> > PRWikiWriter write: (PRDocumentParser parse: '!Hello World') > > translates into the original Pier document. Is there something like > PRHtmlWriter that would translate the above into '<h1>Hello World</ > h1>'? r := PRViewRenderer new. d := WAHtmlStreamDocument new. d stream: String new writeStream. r renderer: (WAStaticHtmlCanvas document: d). r start: (PRDocumentParser parse: '!Hello World'). d stream contents This only works as long as you don't have anchors and other interactions that require a full Seaside renderer. If you need a more sophisticated plain HTML renderer, then it is probably worth to write your own Visitor class. Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On 18/09/2007, Lukas Renggli <[hidden email]> wrote:
> > Is there a way to translate a Pier document to html? For example, > This only works as long as you don't have anchors and other > interactions that require a full Seaside renderer. If you need a more > sophisticated plain HTML renderer, then it is probably worth to write > your own Visitor class. Hi Brian, Last year ond of our students did precisely that as a project. Have a look at http://www.squeaksource.com/StaticPierGen.html -- Damien Pollet type less, do more [ | ] http://typo.cdlm.fasmz.org _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Thanks Lukas and Damien,
StaticPierGen looks like just the tool I need; however, am having trouble with this line in SPGStructureVisitor>>initialize: currentDirectory := Cwd / 'staticPier'. Cwd appears to be a global intended to be the current working directory, but FileDirectory doesn't have a #/ method. Any hints on what Cwd is? Thanks in advance, Brian. On Sep 18, 2007, at 2:34 AM, Damien Pollet wrote: > On 18/09/2007, Lukas Renggli <[hidden email]> wrote: >>> Is there a way to translate a Pier document to html? For example, >> This only works as long as you don't have anchors and other >> interactions that require a full Seaside renderer. If you need a more >> sophisticated plain HTML renderer, then it is probably worth to write >> your own Visitor class. > > Hi Brian, > > Last year ond of our students did precisely that as a project. Have > a look at > http://www.squeaksource.com/StaticPierGen.html > > -- > Damien Pollet > type less, do more [ | ] http://typo.cdlm.fasmz.org > > _______________________________________________ > SmallWiki, Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On 18/09/2007, Brian Murphy-Dye <[hidden email]> wrote:
> Cwd appears to be a global intended to be the current working > directory, but FileDirectory doesn't have a #/ method. Any hints on > what Cwd is? That's Rio, also available from SqueakSource. It's a library for files inspired from Ruby. > On Sep 18, 2007, at 2:34 AM, Damien Pollet wrote: > > > On 18/09/2007, Lukas Renggli <[hidden email]> wrote: > >>> Is there a way to translate a Pier document to html? For example, > >> This only works as long as you don't have anchors and other > >> interactions that require a full Seaside renderer. If you need a more > >> sophisticated plain HTML renderer, then it is probably worth to write > >> your own Visitor class. > > > > Hi Brian, > > > > Last year ond of our students did precisely that as a project. Have > > a look at > > http://www.squeaksource.com/StaticPierGen.html > > > > -- > > Damien Pollet > > type less, do more [ | ] http://typo.cdlm.fasmz.org > > > > > _______________________________________________ > > SmallWiki, Magritte, Pier and Related Tools ... > > https://www.iam.unibe.ch/mailman/listinfo/smallwiki > > > _______________________________________________ > SmallWiki, Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki > -- Damien Pollet type less, do more [ | ] http://typo.cdlm.fasmz.org _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Ah, that's kind of cool for converting a whole pier content to static
files, but my needs are more modest -- just converting one wiki page to an html string. Lukas' suggestion was pretty easy to get working. Also easily created a PRComment with markup of '//' to enable embedding comments into the wiki code. It's nice how easy it is to extend; will have find more time to experiment! Brian. On Sep 18, 2007, at 9:43 AM, Damien Pollet wrote: > On 18/09/2007, Brian Murphy-Dye <[hidden email]> wrote: >> Cwd appears to be a global intended to be the current working >> directory, but FileDirectory doesn't have a #/ method. Any hints on >> what Cwd is? > > That's Rio, also available from SqueakSource. > It's a library for files inspired from Ruby. > > >> On Sep 18, 2007, at 2:34 AM, Damien Pollet wrote: >> >>> On 18/09/2007, Lukas Renggli <[hidden email]> wrote: >>>>> Is there a way to translate a Pier document to html? For example, >>>> This only works as long as you don't have anchors and other >>>> interactions that require a full Seaside renderer. If you need a >>>> more >>>> sophisticated plain HTML renderer, then it is probably worth to >>>> write >>>> your own Visitor class. >>> >>> Hi Brian, >>> >>> Last year ond of our students did precisely that as a project. Have >>> a look at >>> http://www.squeaksource.com/StaticPierGen.html >>> >>> -- >>> Damien Pollet >>> type less, do more [ | ] http://typo.cdlm.fasmz.org >>> >> >>> _______________________________________________ >>> SmallWiki, Magritte, Pier and Related Tools ... >>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >> >> >> _______________________________________________ >> SmallWiki, Magritte, Pier and Related Tools ... >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >> > > > -- > Damien Pollet > type less, do more [ | ] http://typo.cdlm.fasmz.org > > _______________________________________________ > SmallWiki, Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki _______________________________________________ SmallWiki, Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Free forum by Nabble | Edit this page |