Skip to content

Commit

Permalink
Remove the Pillar-MicrodownToPillarConverter because it is broken and…
Browse files Browse the repository at this point in the history
… no time to fix it now.
  • Loading branch information
Ducasse committed Mar 23, 2024
1 parent 5841f87 commit bf557bf
Show file tree
Hide file tree
Showing 36 changed files with 256 additions and 239 deletions.
4 changes: 3 additions & 1 deletion src/BaselineOfPillar/BaselineOfPillar.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ BaselineOfPillar >> baseline: spec [
petitParser2: spec.

spec
package: 'Pillar-MicrodownToPillarConverter' with: [ spec requires: #( 'Pillar-Core' 'Microdown' ) ];
"package: 'Pillar-MicrodownToPillarConverter' with: [ spec requires: #( 'Pillar-Core' 'Microdown' ) ];
This does not work anymnore and we should not need it.
Else we migrate by hand the code to Microdown visitors."
package: 'Pillar-ExporterMicrodown' with: [ spec requires: #( 'Microdown' 'Pillar-PetitPillar' 'Pillar-ExporterCore' ) ];
package: 'Pillar-Core';
package: 'Pillar-Tests-Core' with: [ spec requires: #( 'Pillar-Core' 'Pillar-ExporterText' 'Pillar-ExporterPillar' 'Pillar-PetitPillar' ) ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ I'm extending the microdown object model to support the generation of Pillar ele
My main method is `asPillar`.
"
Class {
#name : #ManifestPillarMicrodownToPillarConverter,
#superclass : #PackageManifest,
#category : #'Pillar-MicrodownToPillarConverter-Manifest'
#name : 'ManifestPillarMicrodownToPillarConverter',
#superclass : 'PackageManifest',
#category : 'Pillar-MicrodownToPillarConverter-Manifest',
#package : 'Pillar-MicrodownToPillarConverter',
#tag : 'Manifest'
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Extension { #name : #MicAbstractBlock }
Extension { #name : 'MicAbstractBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicAbstractBlock >> pillarFrom: aCollectionOfMicElements [

^ aCollectionOfMicElements collect: [ :e | e accept: MicMicrodownObjectToPillarObjectConverter new ]
]

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicAbstractBlock >> pillarFromString: aString [

^ MicInlineParser new pillarFrom: aString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicAnchorBlockTest }
Extension { #name : 'MicAnchorBlockTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicAnchorBlockTest >> testAnchorBlockAsPillar [
| source root pillar |
source := '@anchor'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicAnchorReferenceBlock }
Extension { #name : 'MicAnchorReferenceBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicAnchorReferenceBlock >> associatedPillarClass [
^ PRInternalLink
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicAnnotationBlock }
Extension { #name : 'MicAnnotationBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicAnnotationBlock >> associatedPillarClass [

^ PRAbstractAnnotation findClassAcceptingTag: self name ifNone: [ PRUndefinedAnnotation ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicBoldFormatBlock }
Extension { #name : 'MicBoldFormatBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicBoldFormatBlock >> associatedPillarClass [
^ PRBoldFormat
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicCodeBlockTest }
Extension { #name : 'MicCodeBlockTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicCodeBlockTest >> testSingleCodeBlockTwoLinesAsPillar [
| source root code textBody argument |
textBody := 'my fancy code
Expand Down
4 changes: 2 additions & 2 deletions src/Pillar-MicrodownToPillarConverter/MicElement.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicElement }
Extension { #name : 'MicElement' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicElement >> asPillar [

^ self accept: MicMicrodownObjectToPillarObjectConverter new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicEnvironmentBlockTest }
Extension { #name : 'MicEnvironmentBlockTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicEnvironmentBlockTest >> testEnvironmentBlockAsPillar [
| source root pillar |
source := '<!environment|name=aName
Expand All @@ -12,7 +12,7 @@ Hello this is a dull body.

]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicEnvironmentBlockTest >> testEnvironmentBlockWithParametersAsPillar [
| source root pillar |
source := '<!environment|toto=22&name=isAlreadyDefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicFigureBlock }
Extension { #name : 'MicFigureBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicFigureBlock >> associatedPillarClass [
^PRFigure
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicHeaderBlockTest }
Extension { #name : 'MicHeaderBlockTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicHeaderBlockTest >> testHeaderLevel4AsPillar [
| source root pillar |
source := '#### Level four'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicHorizontalLineBlockTest }
Extension { #name : 'MicHorizontalLineBlockTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicHorizontalLineBlockTest >> testHorizontalLineBlockAsPillar [
| source root pillar |
source := '***
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicInlineElement }
Extension { #name : 'MicInlineElement' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicInlineElement >> associatedPillarClass [
^ self subclassResponsibility
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicInlineParser }
Extension { #name : 'MicInlineParser' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicInlineParser >> pillarFrom: aString [

"return a collection of pillar nodes which can be used in setChildren: of the owner of aString"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
Extension { #name : #MicInlineParserTest }
Extension { #name : 'MicInlineParserTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicInlineParserTest >> testBasicTextAsPillar [
| res |
res := self splitter pillarFrom: 'abc'.
res := MicInlineParser new pillarFrom: 'abc'.
self assert: res first text equals: 'abc'.
self assert: res first class equals: PRText.
]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicInlineParserTest >> testBoldAndNestedItalicAsPillar [
| res |
res := self splitter pillarFrom: 'abc**x_y_z**cba'.
res := MicInlineParser new pillarFrom: 'abc**x_y_z**cba'.
self assert: res second class equals: PRBoldFormat.
self assert: res second children first text equals: 'x'.
self assert: res second children second class equals: PRItalicFormat.
self assert: res second children second children first text equals: 'y'.
self assert: res second children third text equals: 'z'
]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicInlineParserTest >> testBoldAsPillar [
| res |
res := self splitter pillarFrom: 'abc**xyz**cba'.
res := MicInlineParser new pillarFrom: 'abc**xyz**cba'.
self assert: res second children first text equals: 'xyz'.
self assert: res second class equals: PRBoldFormat.
]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicInlineParserTest >> testExternalLinkAsPillar [
| res |
res := self splitter pillarFrom: 'abc[alias](link)cba'.
res := MicInlineParser new pillarFrom: 'abc[alias](link)cba'.
self assert: res second children first text equals: 'alias'.
self assert: res second class equals: PRExternalLink.

]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicInlineParserTest >> testFigureAsPillar [
| res |
res := self splitter pillarFrom: 'abc![alias](http://www.pharo.org)cba'.
res := MicInlineParser new pillarFrom: 'abc![alias](http://www.pharo.org)cba'.
self assert: res second children first text equals: 'alias'.
self assert: res second class equals: PRFigure

]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicInlineParserTest >> testItalicAsPillar [
| res |
res := self splitter pillarFrom: 'abc_xyz_cba'.
res := MicInlineParser new pillarFrom: 'abc_xyz_cba'.
self assert: res second children first text equals: 'xyz'.
self assert: res second class equals: PRItalicFormat.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicItalicFormatBlock }
Extension { #name : 'MicItalicFormatBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicItalicFormatBlock >> associatedPillarClass [
^ PRItalicFormat
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicLinkBlock }
Extension { #name : 'MicLinkBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicLinkBlock >> associatedPillarClass [
^ PRExternalLink
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicMathBlockTest }
Extension { #name : 'MicMathBlockTest' }

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicMathBlockTest >> testMathBlockAsPillar [
| source root pillar |
source := '
Expand All @@ -14,7 +14,7 @@ root := parser parse: source.

]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicMathBlockTest >> testMathBlockAsPillarWithArgument [
| source root pillar |
source := '
Expand All @@ -30,7 +30,7 @@ V_i = C_0 - C_3

]

{ #category : #'*Pillar-MicrodownToPillarConverter-Tests' }
{ #category : '*Pillar-MicrodownToPillarConverter-Tests' }
MicMathBlockTest >> testMathBlockAsPillarWithArgumentWithFormatting [
| source root pillar |
source := '
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #MicMathInlineBlock }
Extension { #name : 'MicMathInlineBlock' }

{ #category : #'*Pillar-MicrodownToPillarConverter' }
{ #category : '*Pillar-MicrodownToPillarConverter' }
MicMathInlineBlock >> associatedPillarClass [
^ PRMathInTextAnnotation
]
Loading

0 comments on commit bf557bf

Please sign in to comment.