Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahtathy committed Aug 6, 2024
1 parent c240c8d commit 2859b6f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 102 deletions.
96 changes: 5 additions & 91 deletions src/BaselineOfMicrodown/BaselineOfMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,9 @@ BaselineOfMicrodown >> baseline: spec [

<baseline>
spec for: #common do: [

self xmlParserHtml: spec.
self mustache: spec.
" I disable this because against all my best effort, I cannot avoid the fucking pop up to raise
even if I unload all the packages. I get the Microdown-RichTextComposer in conflict."

spec preLoadDoIt: #'preload:package:'.


"I disable this because in a postload
(IceRepository repositoryNamed: 'microdown') is nil and I do not get why"

spec postLoadDoIt: #'postload:package:'.

self xmlParserHtml: spec.

spec
package: #Microdown;
package: #'Microdown-Tests'
Expand Down Expand Up @@ -82,22 +71,10 @@ BaselineOfMicrodown >> baseline: spec [
package: #'Microdown-PrettyPrinter'
with: [ spec requires: #( #Microdown ) ];


package: #'Microdown-PrettyPrinter-Tests'
with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests') ];
with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests') ].

package: #'Microdown-ParentChildrenChecker' with: [
spec requires: #( #'Microdown' ) ];
package: #'Microdown-BookTester' with: [
spec requires: #( #'Microdown' ) ];
package: #'Microdown-BookTester-Tests' with: [
spec requires: #( #'Microdown-BookTester' ) ];

package: #'Microdown-Blog' with: [
spec requires: #( #'Microdown' #'Mustache') ];
package: #'Microdown-Blog-Tests' with: [
spec requires: #( #'Microdown-Blog' ) ].


"I do not want group without tests for now"
spec
group: 'Core' with: #('Microdown');
Expand All @@ -110,7 +87,6 @@ BaselineOfMicrodown >> baseline: spec [
#'Microdown-DocumentBrowser'
#'Microdown-DocumentBrowser-Tests'
"
#'Microdown-Evaluator'
#'Microdown-Evaluator-Tests'
#'Microdown-PrettyPrinter'
Expand All @@ -120,72 +96,10 @@ BaselineOfMicrodown >> baseline: spec [
#'Microdown-LaTeXExporter'
#'Microdown-LaTeXExporter-Tests'
#'Microdown-Transformer'
#'Microdown-Transformer-Tests'
#'Microdown-ParentChildrenChecker'
#'Microdown-BookTester'
#'Microdown-BookTester-Tests'
);
#'Microdown-Transformer-Tests');
group: 'All' with: #('Core' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ]
]

{ #category : 'baselines' }
BaselineOfMicrodown >> mustache: spec [

spec baseline: 'Mustache' with: [
spec
repository: 'github://noha/mustache:v1.0/repository';
loads: #( 'Core' 'Tests' ) ]
]

{ #category : 'baselines' }
BaselineOfMicrodown >> postload: loader package: packageSpec [

| p |
self class name, ' postload ' traceCr.

p := (IceRepository repositoryNamed: 'microdown').
p ifNil: [ p := (IceRepository repositoryNamed: 'Microdown') ].
[
(p ifNotNil: [ :p2 | (p2 packageNamed: 'BaselineOfMicrodown') reload ])
]
on: MCMergeOrLoadWarning
do: [ :ex | ex load ]



]

{ #category : 'baselines' }
BaselineOfMicrodown >> preload: loader package: packageSpec [
"Ignore pre and post loads if already executed"

" the prelosing GH script cannot work because
it will remove the baseline and repository itself :)
#( 'Microdown' ) do: [ :name |
(IceRepository repositoryNamed: name)
ifNil: [ self inform: 'Project not found: ' , name ]
ifNotNil: [ :found |
found
unload;
forget ] ]"

| packagesToUnload |
self class name, ' preload ' traceCr.
packagesToUnload := ((PackageOrganizer default packages
select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ])
reject: [ :each |
#('Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests') includes: each ].
"these two are not managed by the microdown repo but the documentation.
I should rename them in the future to avoid confusion"

packagesToUnload do:
[ :each |
((IceRepository repositoryNamed: 'Microdown') packageNamed: each) unload ].


]

{ #category : 'external projects' }
BaselineOfMicrodown >> xmlParserHtml: spec [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Class {
'factory',
'visitor',
'visitorClass',
'parser'
'parser',
'file'
],
#pools : [
'MicroSharedPool'
Expand Down Expand Up @@ -36,7 +37,8 @@ MicTextualMicrodownExporterTest >> setUp [
super setUp.
factory := MicMicrodownSnippetFactory new.
visitor := self visitorClass new.
parser := Microdown new
parser := Microdown new.
file := FileSystem memory / 'test.md'.
]

{ #category : 'tests-anchor' }
Expand Down Expand Up @@ -322,17 +324,17 @@ MicTextualMicrodownExporterTest >> testMetaData [

{ #category : 'tests - list' }
MicTextualMicrodownExporterTest >> testMetaDataIsWellExported [

| source newDocument |
source := '
{
"author" : "Inria"
}
'.
newDocument := parser parse: source.

| newDocument |

file ensureCreateFile.
newDocument := parser parse: factory metaDataSample.
visitor visit: newDocument.

self assert: (visitor contents includesSubstring: '"author" : "Inria"').
self assert: (visitor contents includesSubstring: '"title" : "The title"') .
file writeStreamDo: [ :stream | stream nextPutAll: visitor contents ].
file delete.




Expand Down

0 comments on commit 2859b6f

Please sign in to comment.