trying to make the mooc working in P8
- added archetype mooc
pillar/build/pillar build pdf
FileDoesNotExistException: '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/MoocPharo80/_support/templates/beamer/presentation.template'
File>>openForWrite:
- Added a beamer directory in template
- added template in the config file to point to the template
Now failing because latexmk does not find the file pharoslides
- did
% add the PATH to retrieve cls and sty beamer styles files
\makeatletter
\providecommand*{\input@path}{}
\edef\input@path{{root/_support/beamer/}\input@path}% prepend
\makeatother
did not work
Now debugging
latexmk -pdflatex=lualatex -pdf -ps- -f -interaction=nonstopmode -outdir=/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/MoocPharo80/_result/pdf index.tex
Ok it works with
\edef\input@path{{_support/beamer/}\input@path}% prepend
Now the problem is that
file metadata are not used for feeling the template
PharoCoolFeatures.pillar
{ "title":"Pharo Features (part)", "slidesid":"Week 1", "subtitle":"" }
${slide:title=Outline}$
Produces a title that is not "Pharo Features.... but the title of the config file.
I look why metadata in a document are not used as avule for mustache. for each doc (for example slides) I imagine that the metadata dictionary (and it should not be a dictionary in fact but an environment supporting lookup) is not chained correctly with the one of the configuration.
In fact I should have
Config Dict
^
|
File Dict
^
|
Project
And I think that I have
Config Dict
^
|
Project
So now I have to identify a key that is not managed in the template and put a break point in the property environment that will represent the metadata
propertyAt: aKey put: aValue
"Adds or replaces the property ==aKey== with ==aValue==."
aKey = #slidesid ifTrue: [ self halt ].
^ self properties at: aKey put: aValue
Once I halt then I would like to know when this document object is used but
- if there is an access to it properties
- if there is an access to one of its key (because many be there is a keysAndValues do
=> having spying substitute for basic data structure would be cool
a variation that I already needed for enlumineur was dictionary with statistical data number of hits
Since we transform the document. - I would like to know if the document is the same (same if not may be this is the copy that forget to copy the properties)
- else I would like to know if a new dictionary is set (so I will do a halt in the setter).
So I will investigate the following hypotheses. Given to you to help in case of trying and writing paper/phd.
buildOn: aPRProject
| parsedDocument transformedDocument writtenFile |
parsedDocument := self parseInputFile: file.
“hypothese one: the File dictionary is ok ”
parsedDocument properties: (self metadataConfigurationForDocument: parsedDocument).
“hypothese two: the chain is not correclty set in metadataConfigurationForDocument:"
transformedDocument := self transformDocument: parsedDocument.
“hypothese three: transformDocument loses the data and a configuration is recreated in urgence"
writtenFile := self writeDocument: transformedDocument.
self postWriteTransform: writtenFile.
^ PRSuccess new.
metadataConfigurationForDocument: aDocument
"create an environment with the local document properties as children of the document properties."
| subConfiguration |
self halt.
subConfiguration := project configuration class newFromDictionary: aDocument properties.
subConfiguration parent: project configuration.
^ subConfiguration
In fact this is more vicious than that :)
Index.pillar
inclus Slide1.pillar
Slide1.pillar
a des meta donnees
et pillar pour le moment gere bien les meta data de index.pillar (a verifier - je vais produire seulement slide1.pillar pour voir). mais ne gere pas bien les metadonnees des inclusions qui doivent etre traites comme une pile car Slide2.pillar ne doit pas endommager Slide2.
visitInputFileAnnotation: anInputFileAnnotation
"I load the file and if the file exist I replace the node of the annotation by the content of the file."
| includedFile includedPillarAST cleanPillarAST |
includedFile := topFile parent resolve: anInputFileAnnotation path.
self validateInclusionOfFile: includedFile.
includedPillarAST := PRDocument parser parse: includedFile.
cleanPillarAST := (PRCleanAnnotationInParagraphTransformer new
configuration: self configuration;
start: includedPillarAST).
"Execute a file inclusion step recursively"
includedPillarAST := PRFileInclusion new
topFile: includedFile;
inProcessFiles: (inProcessFiles copyWith: topFile);
start: cleanPillarAST.
"If we include a file, we need to update all references to external files in it.
References that were before relative to the included document, should be now relative to the container document."
PRUpdateFileInclusionReference
start: includedPillarAST
with: (includedFile parent relativeTo: topFile parent) pillarPrintString.
self replace: includedPillarAST children.