Re: [Pharo-users] Pillar question: PRCitationTransformer

2016-08-21 Thread Yann Dubois
Hi stef,

You can not have a citation annotation on a writer because the annotation
is transformed before to a PRCitation object. So you need to overwrite
visitCitation.

PRCitationTransformer is called in the phase mechanism. He is added in the
transform pipeline. PRCitationTransformer will be rename to
PRCitationAnnotationTransformer because this class change the citation
annotations and not the citations.

Le 22 août 2016 07:36, "stepharo"  a écrit :

Hi

I'm trying to extend Pillar to get new $publications:...$ structure and it
looks like Pillar is getting more and more complex. And the comments do not
really help because they are short and written for someone already
understanding it. :(

To try to understand I tried to

! Youpi

${cite:ref=Duca18rmod}$

!! Others

but I get

{"content":"!Youpi\n\n\n\n!!Others"}

./pillar export --to=pillar Example.pillar


May be I cannot export to pillar a citation. I have no idea.


I tried to add

PRPillarWriter >> visitCitationAnnotation: aCitation
"We invoke visitAnnotation: to make sure that the rest of the document
is visited."

self halt.
super visitCitationAnnotation: aCitation

Did not stop!

So I put an halt into

PRVisitor >> visitCitationAnnotation: aCitationAnnotation

self halt.
self createNewCitationWith: aCitationAnnotation.
self replace: (OrderedCollection with: tmpCitation) .
super visitCitationAnnotation: aCitationAnnotation

and it stopped.


I tried to understand who is calling

PRCitationTransformer

No luck. I'm sure that there is a magic registration mechanism but I failed
to find it.

Looking at tests (BTW Tests are not documentation or class comments, there
are tests).

It looks like I need a configuration.

 (self actualClass
executeOn:
(PRCompilationContext withDocument: anInput withConfiguration:
aConfig))
input

And then I fall on executeOn: implementors. LLPhase and
PRNodeTransformer.

and I have no idea how a Phase relates to a visitor.

To bad, after all the efforts on Pillar it looks like getting too complex.

So do not think that we can decently ask students to work on improving
Pillar anymore

because they will just get lost and disgusted from Pharo. :(

Sad news isn't.

I hope that I will not have to switch back to LaTeX or markdown (shit).

Stef


[Pharo-users] Pillar question: PRCitationTransformer

2016-08-21 Thread stepharo

Hi

I'm trying to extend Pillar to get new $publications:...$ structure and 
it looks like Pillar is getting more and more complex. And the comments 
do not really help because they are short and written for someone 
already understanding it. :(


To try to understand I tried to

! Youpi

${cite:ref=Duca18rmod}$

!! Others

but I get

{"content":"!Youpi\n\n\n\n!!Others"}

./pillar export --to=pillar Example.pillar


May be I cannot export to pillar a citation. I have no idea.


I tried to add

PRPillarWriter >> visitCitationAnnotation: aCitation
"We invoke visitAnnotation: to make sure that the rest of the 
document is visited."


self halt.
super visitCitationAnnotation: aCitation

Did not stop!

So I put an halt into

PRVisitor >> visitCitationAnnotation: aCitationAnnotation

self halt.
self createNewCitationWith: aCitationAnnotation.
self replace: (OrderedCollection with: tmpCitation) .
super visitCitationAnnotation: aCitationAnnotation

and it stopped.


I tried to understand who is calling

PRCitationTransformer

No luck. I'm sure that there is a magic registration mechanism but I 
failed to find it.


Looking at tests (BTW Tests are not documentation or class comments, 
there are tests).


It looks like I need a configuration.

 (self actualClass
executeOn:
(PRCompilationContext withDocument: anInput 
withConfiguration: aConfig))

input

And then I fall on executeOn: implementors. LLPhase and 
PRNodeTransformer.


and I have no idea how a Phase relates to a visitor.

To bad, after all the efforts on Pillar it looks like getting too complex.

So do not think that we can decently ask students to work on improving 
Pillar anymore


because they will just get lost and disgusted from Pharo. :(

Sad news isn't.

I hope that I will not have to switch back to LaTeX or markdown (shit).

Stef