@@ -44,8 +44,19 @@ MicTemplatedWriterTest >> addTemplateFiles [
4444 writeStreamDo: [ :s | s << self paragraphContents ].
4545 fileSystem / MicTemplatedWriter environmentTemplateFileName
4646 writeStreamDo: [ :s | s << self environmentContents ].
47+
48+ " Pay attention here this is the note label that determines the template name"
49+ fileSystem / ' important.mustache'
50+ writeStreamDo: [ :s | s << self annotatedParagraphContents ].
4751
52+ fileSystem / MicTemplatedWriter defaultAnnotatedParagraphTemplateFileName
53+ writeStreamDo: [ :s | s << self annotatedParagraphContents ].
54+ ]
4855
56+ { #category : ' running' }
57+ MicTemplatedWriterTest >> annotatedParagraphContents [
58+
59+ ^ ' <b>{{{label}}}</b>{{{contents}}}'
4960]
5061
5162{ #category : ' helpers' }
@@ -111,6 +122,12 @@ MicTemplatedWriterTest >> createTemplateFileAt: aPath withContents: contents [
111122 templateFileReference writeStreamDo: [ :stream | stream nextPutAll: contents ].
112123]
113124
125+ { #category : ' running' }
126+ MicTemplatedWriterTest >> defaultAnnotatedParagraph [
127+
128+ ^ ' <b>{{{label}}}</b>{{{contents}}}'
129+ ]
130+
114131{ #category : ' running' }
115132MicTemplatedWriterTest >> environmentContents [
116133 " Ideally we should be able to have template for each of the different environment based on their names."
@@ -203,6 +220,25 @@ MicTemplatedWriterTest >> setUp [
203220 self addTemplateFiles.
204221]
205222
223+ { #category : ' new tests' }
224+ MicTemplatedWriterTest >> testAnnotatedParagraphImportant [
225+
226+ self
227+ assertTemplate: ' important.mustache'
228+ writesValue: ' <b>important</b>this is important'
229+ forNode: (Microdown parse: ' !!important this is important' ) children first
230+ ]
231+
232+ { #category : ' new tests' }
233+ MicTemplatedWriterTest >> testAnnotatedParagraphUnsupportedIsThenDefault [
234+
235+ self skip. " To be investigated."
236+ self
237+ assertTemplate: ' important.mustache'
238+ writesValue: ' <b>Tintin</b>this is important'
239+ forNode: (Microdown parse: ' !!Tintin this is important' ) children first
240+ ]
241+
206242{ #category : ' tests-setup' }
207243MicTemplatedWriterTest >> testDirectory [
208244
@@ -218,9 +254,9 @@ MicTemplatedWriterTest >> testDirectory [
218254MicTemplatedWriterTest >> testWriteAnchorUsesDefaultIfNotSpecificIsDefinedTemplate [
219255
220256 self
221- assertTemplate: MicTemplatedWriter defaultAnnotatedParagraphTemplateFileName
222- writesValue: ' annotated paragraph '
223- forNode: (PRAnnotatedParagraph withAll: #() annotation: ' todo ' )
257+ assertTemplate: ' important.mustache '
258+ writesValue: ' <b>important</b>this is important '
259+ forNode: (Microdown parse: ' !!important this is important ' ) children first
224260]
225261
226262{ #category : ' new tests' }
0 commit comments