Skip to content

Commit 60370ad

Browse files
committed
regenerating configurationForPillar.
1 parent 132d9ae commit 60370ad

File tree

4 files changed

+331
-31
lines changed

4 files changed

+331
-31
lines changed

src/Pillar-Chrysal/ChrysalPillarishConfiguration.class.st

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Class {
1111
#package : 'Pillar-Chrysal'
1212
}
1313

14+
{ #category : 'backward compatibility' }
15+
ChrysalPillarishConfiguration >> convertValue: aValue [
16+
17+
^ aValue
18+
]
19+
1420
{ #category : 'accessing' }
1521
ChrysalPillarishConfiguration >> initialize [
1622
"This is a hack waiting for a better management of the printer for NodeTransformer."
@@ -28,13 +34,12 @@ ChrysalPillarishConfiguration >> levelConfigurationFor: aHeader [
2834
{ #category : 'post hooks' }
2935
ChrysalPillarishConfiguration >> postTreat [
3036

31-
(self propertyAt: #levels ifAbsent: [^ self ]) do: [
32-
:levelSpec |
37+
(self propertyAt: #levels ifAbsent: [^ self ]) do:
38+
[ :levelSpec |
3339
| instance |
34-
instance := (self printer printerSpecFor: levelSpec renderAs).
40+
instance := self printer printerSpecFor: levelSpec renderAs.
3541
instance fillFromAnother: levelSpec.
36-
self printer level: instance n: levelSpec level.
37-
]
42+
self printer level: instance n: levelSpec level ]
3843
]
3944

4045
{ #category : 'accessing' }

src/Pillar-Chrysal/ConfigurationForPillar.class.st

Lines changed: 173 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,127 @@ Class {
3434

3535
{ #category : 'description' }
3636
ConfigurationForPillar class >> chrysalDescriptions [
37+
"I'm a generated method. I'm just here to help remembering how the class was generated. I should only be executed in presence of the configurationBuilder contained in the Chrysal package. Indeed the item objects only exist at compile-time and STON will recreate them.
38+
Here is a sketch how the methods of the class can be regenerated.
39+
40+
```
41+
ChrysalConfigurationBuilder new
42+
configurationClass: ConfigurationForPillar2;
43+
withDescriptionItems: ConfigurationForPillar chrysalDescriptions
44+
```
45+
"
46+
^ STON fromString: '[
47+
PathConfigurationItem {
48+
#propertyName : #bibFile,
49+
#default : ''book.bib'',
50+
#explanation : ''Identify the file to be taken as input for the bibliography. This is the .bib file used to resolve the ${cite:ref=Key}$ annotation.''
51+
},
52+
StringConfigurationItem {
53+
#propertyName : #title,
54+
#default : ''my super cool book''
55+
},
56+
StringConfigurationItem {
57+
#propertyName : #attribution,
58+
#default : ''me, myself and I''
59+
},
60+
NumberConfigurationItem {
61+
#propertyName : #headingLevelOffset,
62+
#default : 0,
63+
#explanation : ''Indicate how to convert from the level of a heading to the level of heading in your exported document.\r\tFor example, a headingLevelOffset of 3 converts a 1st level heading to an <h4>in HTML''
64+
},
65+
StringConfigurationItem {
66+
#propertyName : #series,
67+
#default : ''Square Bracket Associate Collection''
68+
},
69+
StringConfigurationItem {
70+
#propertyName : #keywords,
71+
#default : ''Pharo''
72+
},
73+
PathConfigurationItem {
74+
#propertyName : #outputDirectory,
75+
#default : ''_result''
76+
},
77+
FolderConfigurationItem {
78+
#propertyName : #baseDirectory,
79+
#default : ''.''
80+
},
81+
FileConfigurationItem {
82+
#propertyName : #mainDocument,
83+
#default : ''book''
84+
},
85+
FileConfigurationItem {
86+
#propertyName : #inputFile,
87+
#default : ''index'',
88+
#explanation : ''The file that must be transformed. You can also specify an input file at the end of the command-line interface. Previously there was no default value''
89+
},
90+
StringConfigurationItem {
91+
#propertyName : #latexTemplate,
92+
#default : ''_support/templates/main.latex.mustache''
93+
},
94+
StringConfigurationItem {
95+
#propertyName : #latexChapterTemplate,
96+
#default : ''_support/templates/chapter.latex.mustache''
97+
},
98+
StringConfigurationItem {
99+
#propertyName : #htmlTemplate,
100+
#default : ''_support/templates/html.mustache''
101+
},
102+
StringConfigurationItem {
103+
#propertyName : #htmlChapterTemplate,
104+
#default : ''_support/templates/html.mustache''
105+
},
106+
NewLineConfigurationItem {
107+
#propertyName : #newLine,
108+
#default : #platform,
109+
#explanation : ''The string that separates lines in the exported document. This is often either LF or CR\\+LF but any string is possible. Values are #(#cr #lf #crlf #unix #mac #dos #platform)'',
110+
#defaultKey : #platform
111+
},
112+
StringConfigurationItem {
113+
#propertyName : #latexWriter,
114+
#default : #''miclatex:sbabook''
115+
},
116+
StringConfigurationItem {
117+
#propertyName : #htmlWriter,
118+
#default : #michtml
119+
},
120+
NumberConfigurationItem {
121+
#propertyName : #slideInTemplateForDeckJS,
122+
#default : 1,
123+
#explanation : ''Number of slides in Template: Indicate the number of slides created by the DeckJS template. This is important to create anchors.''
124+
},
125+
ListConfigurationItem {
126+
#propertyName : #levels,
127+
#default : #OrderedCollection,
128+
#element : #levelSpecification
129+
},
130+
PathConfigurationItem {
131+
#propertyName : #tocFile,
132+
#default : ''.'',
133+
#explanation : ''Identify the file to be taken as input for the root of the table of contents. When it is not specified, the table of contents will not be computed and displayed''
134+
},
135+
ListConfigurationItem {
136+
#propertyName : #onlyCheckers,
137+
#default : #OrderedCollection,
138+
#explanation : ''Identify the checker names that should only be considered. The list given by ignoredCheckers is not considered. Still checkers can be configured via checkerConfigurations field.'',
139+
#element : #value
140+
},
141+
ListConfigurationItem {
142+
#propertyName : #ignoredCheckers,
143+
#default : #OrderedCollection,
144+
#explanation : ''Identify the checker names that should be ignored when onlyCheckers is not used.'',
145+
#element : #value
146+
},
147+
ListConfigurationItem {
148+
#propertyName : #checkerConfigurations,
149+
#default : #OrderedCollection,
150+
#explanation : ''Specify some configurations for each of the checkers mentioned either in onlyCheckers or ignoredCheckers.'',
151+
#element : #value
152+
}
153+
]'
154+
]
155+
156+
{ #category : 'description' }
157+
ConfigurationForPillar class >> chrysalDescriptions2 [
37158
"I'm a generated method. I'm just here to help remembering how the class was generated. I should only be executed in presence of the configurationBuilder contained in the Chrysal package. Indeed the item objects only exist at compile-time and STON will recreate them."
38159
^ STON fromString: '[
39160
PathConfigurationItem {
@@ -163,15 +284,16 @@ ConfigurationForPillar >> bibFile: aValue [
163284
^ self propertyAt: #bibFile put: aValue
164285
]
165286

166-
{ #category : 'manually added for now' }
287+
{ #category : 'accessing' }
167288
ConfigurationForPillar >> checkerConfigurations [
168-
^ self propertyAt: #checkerConfigurations ifAbsent: [ #()]
289+
"generated code"
290+
^ self propertyAt: #checkerConfigurations ifAbsent: [ OrderedCollection new ]
169291
]
170292

171-
{ #category : 'manually added for now' }
172-
ConfigurationForPillar >> checkerConfigurations: aCol [
173-
174-
^ self propertyAt: #checkerConfigurations put: aCol
293+
{ #category : 'accessing' }
294+
ConfigurationForPillar >> checkerConfigurations: aValue [
295+
"generated code"
296+
^ self propertyAt: #checkerConfigurations put: aValue
175297
]
176298

177299
{ #category : 'conversion' }
@@ -192,6 +314,16 @@ ConfigurationForPillar >> convertBibFile: aValue [
192314
^ Path from: aValue
193315
]
194316

317+
{ #category : 'conversion' }
318+
ConfigurationForPillar >> convertCheckerConfigurations: aValue [
319+
"generated code"
320+
| elements |
321+
elements := OrderedCollection new.
322+
aValue do: [:v |
323+
elements add: (self convertValue: v ) ].
324+
^ elements
325+
]
326+
195327
{ #category : 'conversion' }
196328
ConfigurationForPillar >> convertHeadingLevelOffset: aValue [
197329
"generated code"
@@ -216,6 +348,16 @@ ConfigurationForPillar >> convertHtmlWriter: aValue [
216348
^ aValue
217349
]
218350

351+
{ #category : 'conversion' }
352+
ConfigurationForPillar >> convertIgnoredCheckers: aValue [
353+
"generated code"
354+
| elements |
355+
elements := OrderedCollection new.
356+
aValue do: [:v |
357+
elements add: (self convertValue: v ) ].
358+
^ elements
359+
]
360+
219361
{ #category : 'conversion' }
220362
ConfigurationForPillar >> convertInputFile: aValue [
221363
"generated code"
@@ -294,6 +436,16 @@ ConfigurationForPillar >> convertNewLine: aValue [
294436
(#dos -> Win32Platform new lineEnding)}) at: aValue
295437
]
296438

439+
{ #category : 'conversion' }
440+
ConfigurationForPillar >> convertOnlyCheckers: aValue [
441+
"generated code"
442+
| elements |
443+
elements := OrderedCollection new.
444+
aValue do: [:v |
445+
elements add: (self convertValue: v ) ].
446+
^ elements
447+
]
448+
297449
{ #category : 'conversion' }
298450
ConfigurationForPillar >> convertOutputDirectory: aValue [
299451
"generated code"
@@ -351,7 +503,7 @@ ConfigurationForPillar >> convertTocFile: aValue [
351503
{ #category : 'declared items' }
352504
ConfigurationForPillar >> declaredItems [
353505
"generated code"
354-
^ #( #bibFile #title #attribution #headingLevelOffset #series #keywords #outputDirectory #baseDirectory #mainDocument #inputFile #latexTemplate #latexChapterTemplate #htmlTemplate #htmlChapterTemplate #newLine #latexWriter #htmlWriter #slideInTemplateForDeckJS #levels #tocFile )
506+
^ #( #bibFile #title #attribution #headingLevelOffset #series #keywords #outputDirectory #baseDirectory #mainDocument #inputFile #latexTemplate #latexChapterTemplate #htmlTemplate #htmlChapterTemplate #newLine #latexWriter #htmlWriter #slideInTemplateForDeckJS #levels #tocFile #onlyCheckers #ignoredCheckers #checkerConfigurations )
355507
]
356508

357509
{ #category : 'accessing' }
@@ -413,15 +565,16 @@ ConfigurationForPillar >> htmlWriter: aValue [
413565
^ self propertyAt: #htmlWriter put: aValue
414566
]
415567

416-
{ #category : 'manually added for now' }
568+
{ #category : 'accessing' }
417569
ConfigurationForPillar >> ignoredCheckers [
418-
^ self propertyAt: #ignoredCheckers ifAbsent: [ #()]
570+
"generated code"
571+
^ self propertyAt: #ignoredCheckers ifAbsent: [ OrderedCollection new ]
419572
]
420573

421-
{ #category : 'manually added for now' }
422-
ConfigurationForPillar >> ignoredCheckers: aCol [
423-
424-
^ self propertyAt: #ignoredCheckers put: aCol
574+
{ #category : 'accessing' }
575+
ConfigurationForPillar >> ignoredCheckers: aValue [
576+
"generated code"
577+
^ self propertyAt: #ignoredCheckers put: aValue
425578
]
426579

427580
{ #category : 'accessing' }
@@ -538,16 +691,16 @@ ConfigurationForPillar >> newLine: aValue [
538691
^ self propertyAt: #newLine put: aValue
539692
]
540693

541-
{ #category : 'manually added for now' }
694+
{ #category : 'accessing' }
542695
ConfigurationForPillar >> onlyCheckers [
543-
544-
^ self propertyAt: #onlyCheckers
696+
"generated code"
697+
^ self propertyAt: #onlyCheckers ifAbsent: [ OrderedCollection new ]
545698
]
546699

547-
{ #category : 'manually added for now' }
548-
ConfigurationForPillar >> onlyCheckers: aCol [
549-
550-
^ self propertyAt: #onlyCheckers put: aCol
700+
{ #category : 'accessing' }
701+
ConfigurationForPillar >> onlyCheckers: aValue [
702+
"generated code"
703+
^ self propertyAt: #onlyCheckers put: aValue
551704
]
552705

553706
{ #category : 'accessing' }

src/Pillar-Chrysal/ConfigurationForPillarTest.class.st

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ConfigurationForPillarTest >> configurationDictionaryWithIgnored [
5454
"htmlWriter" : "html",
5555
"latexWriter" : "miclatex:sbabook",
5656
"bibFile" : "others.bib",
57+
"onlyCheckers" : [ "EnglishTypography" ],
5758
"ignoredCheckers" : [ "FrenchTypography" ],
5859
"checkerConfigurations" :
5960
[
@@ -81,11 +82,14 @@ ConfigurationForPillarTest >> configurationDictionaryWithIgnored [
8182
ConfigurationForPillarTest >> testCheckers [
8283

8384
| configuration |
84-
8585
configuration := ConfigurationForPillar newFromSTONDictionary: self configurationDictionaryWithIgnored.
8686
self
87-
assert: (configuration at: 'ignoredCheckers')
88-
equals: #('FrenchTypography')
87+
assert: configuration ignoredCheckers
88+
equals: #('FrenchTypography') asOrderedCollection .
89+
self
90+
assert: configuration onlyCheckers
91+
equals: #('EnglishTypography') asOrderedCollection.
92+
8993

9094

9195

@@ -97,11 +101,10 @@ ConfigurationForPillarTest >> testCheckers [
97101
ConfigurationForPillarTest >> testCheckersConfiguration [
98102

99103
| configuration |
100-
101104
configuration := ConfigurationForPillar newFromSTONDictionary: self configurationDictionaryWithIgnored.
102105
self
103-
assert: (configuration at: 'checkerConfigurations')
104-
equals: {'Vocabulary' -> #(#('sub-presenter' 'subpresenter') #('sub presenter' 'subpresenter') #('meta object' 'metaobject'))}
106+
assert: configuration checkerConfigurations
107+
equals: {'Vocabulary' -> #(#('sub-presenter' 'subpresenter') #('sub presenter' 'subpresenter') #('meta object' 'metaobject'))} asOrderedCollection
105108

106109

107110
]

0 commit comments

Comments
 (0)