On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <stepharo.s...@gmail.com>
wrote:

> Hi arturo
>
> What you saw is the pipeline to produce book and others. Now I do not
> think that you need it.
> To export markdown you do not need the pillar configuration and the rest.
> Check the chapter 6 in the publishing a booklet with pillar document.
>
> You can just get your document using the Pillar parser.
>
> | wiki doc |
> wiki := '!My Document'.
> doc := PRPillarParser parse: wiki
>
> Or from a file:
>
>       PRPillarParser parse: (FileSystem workingDirectory / 'foo.pillar')
>
>           readStream
>
> You can also instantiate the document model, one node after the other,
> start- ing with PRDocument and adding sub-instances of PRDocumentItem:
>
>       | document title figure|
>
>       document := PRDocument new.
>
>       title := PRHeader new
>
>          level: 1;
>
>          add: (PRText content: 'foo');
>
>          yourself.
>
>       figure := PRFigure new
>
>          add: (PRText content: 'Alias');
>
> then to export in HTML you just ask the htmlWriter. So I think that
> this is the same for markdown.
>
> PRHTMLWriter write: document
>
>
> Now pay attention because we are currently rewriting the pipeline of
> document production in Pillar 70.
>

Yeh, but ideally the pipeline should only automatically orchestrate what
people should be still able to do programatically :)

So I think keeping

PRHTMLWriter write: document

and

PRHTMLWriter write: document toStream: ...

& family, is good.


> This is why this is not in master but in a specific branch.
>
> Stef
>
>
>
>
>
>
> On Sun, Feb 18, 2018 at 7:13 PM, Arturo Zambrano
> <arturo.zambr...@gmail.com> wrote:
> > Hi,
> > I figured it out (at least in part)
> >
> >       configuration := PRPillarConfiguration new.
> >       configuration outputType: PRMarkdownWriter.
> >       export:=PRExportPhase new .
> >       export executeOn:
> >   (PRCompilationContext withDocument: document withConfiguration:
> > configuration)
> >
> >
> > This code snipped generates a Json file which contains the markdown...
> how
> > do I generate just the markdown?
> >
> > TIA
> > Arturo
> >
> >
> > On Sun, Feb 18, 2018 at 2:16 PM, Arturo Zambrano <
> arturo.zambr...@gmail.com>
> > wrote:
> >>
> >> Hi,
> >>   can someone please tell me how to export a document using pillar7?
> >>
> >>  For pillar5  the example used to be:
> >>
> >> configuration := PRPillarConfiguration new.
> >> configuration outputType: PRHTMLWriter.
> >> PRExportPhase executeOn: { document } with: configuration.
> >>
> >>
> >> Thanks!
> >
> >
>
>


-- 



Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - *http://www.cnrs.fr
<http://www.cnrs.fr>*


*Web:* *http://guillep.github.io* <http://guillep.github.io>

*Phone: *+33 06 52 70 66 13

Reply via email to