Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions src/Microdown-LaTeXExporter/MicLatexPathUpdateVisitor.class.st

This file was deleted.

125 changes: 120 additions & 5 deletions src/Microdown-Tests/MicMicrodownTextualBuilderTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,19 @@ MicMicrodownTextualBuilderTest >> testCell [
{ #category : 'tests - codeblock' }
MicMicrodownTextualBuilderTest >> testCodeBlock [

"```language2=Pharo&caption=`Color` is cool
"```
Hello
Pharo
```"

| mictext |
mictext := builder
codeblock: self exampleTextMultipleLines
firstLineAssociations: {
('language2' -> 'Pharo') };
codeblock: self exampleTextMultipleLines;
contents.
self
assert: mictext
equals:
'```language2=Pharo
'```
', self exampleTextMultipleLines,

'
Expand Down Expand Up @@ -156,6 +154,123 @@ MicMicrodownTextualBuilderTest >> testCodeBlockCaptionContainsMonospace [

]

{ #category : 'tests - codeblock' }
MicMicrodownTextualBuilderTest >> testCodeBlockFirstLineAssociations [

"```language2=Pharo&caption=`Color` is cool
Hello
Pharo
```"

| mictext |
mictext := builder
codeblock: self exampleTextMultipleLines
firstLineAssociations: {
('language2' -> 'Pharo'). 'caption' -> '`Color` is cool' };
contents.
self
assert: mictext
equals:
'```language2=Pharo&caption=`Color` is cool
', self exampleTextMultipleLines,

'
```
'

]

{ #category : 'tests - codeblock' }
MicMicrodownTextualBuilderTest >> testCodeblockFirstLineAssociationsWithCaption [
"This test verifies that code blocks with first-line associations and captions are correctly formatted."

self testCodeblockFirstLineAssociationsWithCaption01.
self setUp.
self testCodeblockFirstLineAssociationsWithCaption02.
]

{ #category : 'tests - codeblock' }
MicMicrodownTextualBuilderTest >> testCodeblockFirstLineAssociationsWithCaption01 [

"```language2=Pharo&aaa=bbb15
Hello
Pharo
```"

| mictext |
mictext := builder
codeblock: self exampleTextMultipleLines
firstLineAssociations: {
'language2' -> 'Pharo'. 'aaa' -> 'bbb15' }
withCaption: [ 'Killroy' ];
contents.
self
assert: mictext
equals:
'```language2=Pharo&aaa=bbb15
', self exampleTextMultipleLines,

'
```
'

]

{ #category : 'tests - codeblock' }
MicMicrodownTextualBuilderTest >> testCodeblockFirstLineAssociationsWithCaption02 [

"```language2=Pharo&aaa=bbb15
Hello
Pharo
```"

| mictext |
mictext := builder
codeblock: self exampleTextMultipleLines
firstLineAssociations: {
'language2' -> 'Pharo'. #caption -> 'bbb15' }
withCaption: [ builder raw: 'Kilroy' ];
contents.
self
assert: mictext
equals:
'```language2=Pharo&caption=Kilroy
', self exampleTextMultipleLines,

'
```
'

]

{ #category : 'tests - codeblock' }
MicMicrodownTextualBuilderTest >> testCodeblockParameters [

"```language2=Pharo&aaa=bbb15
Hello
Pharo
```"

| mictext orderedDic |
orderedDic := OrderedDictionary new.
orderedDic at: 'language2' put: 'Pharo'.
orderedDic at: 'aaa' put: 'bbb15'.
mictext := builder
codeblock: self exampleTextMultipleLines
parameters: orderedDic;
contents.
self
assert: mictext
equals:
'```language2=Pharo&aaa=bbb15
', self exampleTextMultipleLines,

'
```
'

]

{ #category : 'tests - slides' }
MicMicrodownTextualBuilderTest >> testColumns [

Expand Down
9 changes: 9 additions & 0 deletions src/Microdown/MicMicrodownTextualBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ MicMicrodownTextualBuilder >> codeblock: aString firstLineAssociations: aCol wit
self newLine.
]

{ #category : 'as yet unclassified' }
MicMicrodownTextualBuilder >> codeblock: aString parameters: anOrderedDictionary [
"Alternate API: Build first-line params from a dictionary (preserves order)."

| associations |
associations := anOrderedDictionary associations.
self codeblock: aString firstLineAssociations: associations
]

{ #category : 'element - code block' }
MicMicrodownTextualBuilder >> codeblockTag: aTag withBody: aString [
self flag: #fixme.
Expand Down
Loading