Exporting Pillar docs (Pillar7)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Exporting Pillar docs (Pillar7)

Arturo Zambrano
Hi,
  can someone please tell me how to export a document using pillar7?

 For pillar5  the example used to be:
  1. configuration := PRPillarConfiguration new.
    configuration outputType: PRHTMLWriter.
    PRExportPhase executeOn: { document } with: configuration.
    

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Arturo Zambrano
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 <[hidden email]> wrote:
Hi,
  can someone please tell me how to export a document using pillar7?

 For pillar5  the example used to be:
  1. configuration := PRPillarConfiguration new.
    configuration outputType: PRHTMLWriter.
    PRExportPhase executeOn: { document } with: configuration.
    

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Stephane Ducasse-3
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.
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
<[hidden email]> 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 <[hidden email]>
> 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!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Guillermo Polito


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Arturo Zambrano
Thanks for your help.

I will use markdown as a preview, so th PR*Writer write:document is OK.
For the last phase I plan to use latex to generate a pdf following certain presentation rules.

I wonder if it is possible to use pillar 7 templates programmatically.
Is there some example I can follow?

Thanks again!



On Mon, Feb 19, 2018 at 6:42 AM, Guillermo Polito <[hidden email]> wrote:


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13


Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Offray Vladimir Luna Cárdenas-2

Hi Arturo,

It seems that you have a project with documentation is pretty important. I don't want to start a holly war pointing that there is alternatives to Pillar in Pharo, but maybe you should check Grafoscopio + Pandoc. We can write pretty complex documents using it, like the Grafoscopio User Manual [1], the Data Journalism Handbook[2] and Pasos para una Biblioteca Digital de Bogotá[3] (both in Spanish).

[1] http://mutabit.com/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Manual/manual.pdf
[2] http://mutabit.com/repos.fossil/mapeda/
[3] http://mutabit.com/repos.fossil/dataweek/doc/tip/Artefactos/BibliotecaDigitalBogota/intro.md

Cheers,

Offray


On 27/02/18 08:42, Arturo Zambrano wrote:
Thanks for your help.

I will use markdown as a preview, so th PR*Writer write:document is OK.
For the last phase I plan to use latex to generate a pdf following certain presentation rules.

I wonder if it is possible to use pillar 7 templates programmatically.
Is there some example I can follow?

Thanks again!



On Mon, Feb 19, 2018 at 6:42 AM, Guillermo Polito <[hidden email]> wrote:


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13



Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Stephane Ducasse-3
In reply to this post by Arturo Zambrano
In fact in Pillar 6/7 you can take  template or create your own the variables are mustache variables. 
So this basically means that you inject the latex generated by Pillar into the latex document 
template you want. 
Have a look at the template folder.

On Tue, Feb 27, 2018 at 2:42 PM, Arturo Zambrano <[hidden email]> wrote:
Thanks for your help.

I will use markdown as a preview, so th PR*Writer write:document is OK.
For the last phase I plan to use latex to generate a pdf following certain presentation rules.

I wonder if it is possible to use pillar 7 templates programmatically.
Is there some example I can follow?

Thanks again!



On Mon, Feb 19, 2018 at 6:42 AM, Guillermo Polito <[hidden email]> wrote:


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13



Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Arturo Zambrano
In reply to this post by Offray Vladimir Luna Cárdenas-2
Thanks Offray, I followed previous holly wars :P .
I understand the pros and cons. 
Is there any preview option in grafoscopio?
Or an external viewer is a must?

Thanks!

On Wed, Feb 28, 2018 at 2:27 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Hi Arturo,

It seems that you have a project with documentation is pretty important. I don't want to start a holly war pointing that there is alternatives to Pillar in Pharo, but maybe you should check Grafoscopio + Pandoc. We can write pretty complex documents using it, like the Grafoscopio User Manual [1], the Data Journalism Handbook[2] and Pasos para una Biblioteca Digital de Bogotá[3] (both in Spanish).

[1] http://mutabit.com/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Manual/manual.pdf
[2] http://mutabit.com/repos.fossil/mapeda/
[3] http://mutabit.com/repos.fossil/dataweek/doc/tip/Artefactos/BibliotecaDigitalBogota/intro.md

Cheers,

Offray


On 27/02/18 08:42, Arturo Zambrano wrote:
Thanks for your help.

I will use markdown as a preview, so th PR*Writer write:document is OK.
For the last phase I plan to use latex to generate a pdf following certain presentation rules.

I wonder if it is possible to use pillar 7 templates programmatically.
Is there some example I can follow?

Thanks again!



On Mon, Feb 19, 2018 at 6:42 AM, Guillermo Polito <[hidden email]> wrote:


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13




Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Arturo Zambrano
In reply to this post by Stephane Ducasse-3
Thanks Stef. I'm aware of templates and I saw how to use them when using pillar from command line.
I have doubts regarding how to it programatically, but I need to take a look that code before posting concrete questions.



On Thu, Mar 1, 2018 at 9:16 AM, Stephane Ducasse <[hidden email]> wrote:
In fact in Pillar 6/7 you can take  template or create your own the variables are mustache variables. 
So this basically means that you inject the latex generated by Pillar into the latex document 
template you want. 
Have a look at the template folder. 

On Tue, Feb 27, 2018 at 2:42 PM, Arturo Zambrano <[hidden email]> wrote:
Thanks for your help.

I will use markdown as a preview, so th PR*Writer write:document is OK.
For the last phase I plan to use latex to generate a pdf following certain presentation rules.

I wonder if it is possible to use pillar 7 templates programmatically.
Is there some example I can follow?

Thanks again!



On Mon, Feb 19, 2018 at 6:42 AM, Guillermo Polito <[hidden email]> wrote:


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13




Reply | Threaded
Open this post in threaded view
|

Re: Exporting Pillar docs (Pillar7)

Offray Vladimir Luna Cárdenas-2
In reply to this post by Arturo Zambrano

Hi Arturo,


On 08/03/18 21:15, Arturo Zambrano wrote:
Thanks Offray, I followed previous holly wars :P .
I understand the pros and cons.

:-) is inevitable to fight some of them from time to time, in a community with strong passions/opinions  about technology and tools, like this one. In my experience, good interaction with external tools for documentation, like Markdown and Pandoc has open a bridge with other people who is using them already or can make quicker use in the near future.

Is there any preview option in grafoscopio?
Or an external viewer is a must?


There are no previewers integrated in Grafoscopio, so you need to rely on external software. That being said, using the %metadata node you can define the Pandoc exportation command with all details and metadata: templates, font size, language, author, etc. So, any preview is on click away from Grafoscopio of being updated on the external viewer. In that we I did the Manual, and we did the Data Journalism Handbook and other booklets.

You could download Grafoscopio, see the Manual in the Help Menu and install Pandoc, to see by yourself how this interaction between Grafoscopio and the external viewer works once you have the %metadata node defines (see screenshot below). Notice that, if you want to recreate the Manual, you will need also to download the templates for it located at [1], and put in the same folder where the manual.ston file is located (maybe I should make this download automatic).

[1] http://mutabit.com/repos.fossil/grafoscopio/dir?ci=tip&name=Docs/En/Books/Manual

Let me know if this works for your use case.


Thanks!


Cheers,

Offray




On Wed, Feb 28, 2018 at 2:27 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Hi Arturo,

It seems that you have a project with documentation is pretty important. I don't want to start a holly war pointing that there is alternatives to Pillar in Pharo, but maybe you should check Grafoscopio + Pandoc. We can write pretty complex documents using it, like the Grafoscopio User Manual [1], the Data Journalism Handbook[2] and Pasos para una Biblioteca Digital de Bogotá[3] (both in Spanish).

[1] http://mutabit.com/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Manual/manual.pdf
[2] http://mutabit.com/repos.fossil/mapeda/
[3] http://mutabit.com/repos.fossil/dataweek/doc/tip/Artefactos/BibliotecaDigitalBogota/intro.md

Cheers,

Offray


On 27/02/18 08:42, Arturo Zambrano wrote:
Thanks for your help.

I will use markdown as a preview, so th PR*Writer write:document is OK.
For the last phase I plan to use latex to generate a pdf following certain presentation rules.

I wonder if it is possible to use pillar 7 templates programmatically.
Is there some example I can follow?

Thanks again!



On Mon, Feb 19, 2018 at 6:42 AM, Guillermo Polito <[hidden email]> wrote:


On Sun, Feb 18, 2018 at 9:01 PM, Stephane Ducasse <[hidden email]> 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
<[hidden email]> 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 <[hidden email]>
> 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


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13