Posted by
CyrilFerlicot on
Apr 19, 2015; 3:44pm
URL: https://forum.world.st/Pillar-used-directly-from-Pharo-tp4820420p4820534.html
Hi again !
Ok so. To use pillar inside Pharo you have this:
PRCocoonConfiguration new
templateStream: PRHTMLWriter defaultTemplate;
configurations: Dictionary new;
inputFiles: {(FileSystem workingDirectory /
'test.pillar')};
outputType: PRHTMLWriter;
outputFile: 'test.html' asFileReference ;
export.
Here is a little exemple. You can remplace PRHTMLWriter by
PRLaTeXWriter, PRTextWriter, PRMarkdownWriter, PRPillarWriter etc...
The outputFile is the name of the file you want to be generate, the
file will be on the folder of the image.
If you want a special template you have to pass it to templateStream.
You can also have others option like:
- inputString : aString with the pillar text you want to export like:
'!test
*myLink>
http://test.html* !!Test 2
etc...'
- outputStream : if you don't want a file at the end but a stream.
etc...
You can find all these option inside the PRCocoonConfiguration class.
I hope that can help you, if you've others question fell free to ask !
On 19 April 2015 at 17:53, Cyril Ferlicot <
[hidden email]> wrote:
> Hi again !
>
> Ok so. To use pillar inside Pharo you have this:
>
> PRCocoonConfiguration new
> templateStream: PRHTMLWriter defaultTemplate;
> configurations: Dictionary new;
> inputFiles: {(FileSystem workingDirectory /
> 'test.pillar')};
> outputType: PRHTMLWriter;
> outputFile: 'test.html' asFileReference ;
> export.
>
> Here is a little exemple. You can remplace PRHTMLWriter by
> PRLaTeXWriter, PRTextWriter, PRMarkdownWriter, PRPillarWriter etc...
> The outputFile is the name of the file you want to be generate, the
> file will be on the folder of the image.
> If you want a special template you have to pass it to templateStream.
> You can also have others option like:
>
>
>
> On 18 April 2015 at 20:06, Cyril Ferlicot <
[hidden email]> wrote:
>> Hi !
>> You can use it from Pharo but it's a little complicated if you want to add a
>> configuration file (pillar.conf).
>> I can't explain now because I'm at a ceremony but when I'll have time I'll
>> add the list of the commandes !
>>
>> Le samedi 18 avril 2015, Jan Valášek <
[hidden email]> a écrit :
>>>
>>> Hi there,
>>>
>>> I'd like to ask you, whether is here a way to use pillar internally,
>>> directly from Pharo and how to use it properly. I have found some
>>> tutorials how to use it from linux/windows command prompt, however, I'd
>>> prefer to call it in my program in pharo.
>>>
>>>
>>>
>>> Something like this ->
>>> -----------------------
>>> header := pillarHeaderObject new. //creating pillar objects directly
>>> from my program
>>> header text:'Title of my page'.
>>> aPillarDocument add: header. //adding them to the whole document
>>> object
>>>
>>> and finally
>>>
>>> aPillarDocument exportToLatex. //export the document
>>> ----------------------
>>>
>>>
>>>
>>> or I can just write the text in the pillar notation to "myTextObject"
>>> and then call something like->
>>> -------
>>> pillarParseAndExportToLatex: myTextObject.
>>> -------
>>>
>>> Is here a way to do this?
>>>
>>> Thanks for your help :-)
>>> John.
>>>
>>
>>
>> --
>> Cheers
>> Cyril Ferlicot
>>
>
>
>
> --
> Cheers
> Cyril Ferlicot
--
Cheers
Cyril Ferlicot