Skip to content

Commit 1201f36

Browse files
authored
Merge pull request #972 from pillar-markup/dev
Merge dev in P14
2 parents 325b919 + 41f720b commit 1201f36

File tree

202 files changed

+5395
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+5395
-963
lines changed

.github/scripts/preLoading.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#( 'Microdown' 'BeautifulComments' 'DocumentBrowser' ) do: [ :name |
33
(IceRepository repositoryNamed: name)
4-
ifNil: [ self inform: 'Project not found: ' , name ]
4+
ifNil: [ ('Project not found: ' , name) traceCr ]
55
ifNotNil: [ :found |
66
found
77
unload;

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ on:
77
push:
88
branches:
99
- dev
10-
- master
1110
pull_request:
1211
branches:
1312
- dev
14-
- master
1513
workflow_dispatch:
1614

1715
jobs:

.smalltalk.Release.ston

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SmalltalkCISpec {
33
#loading : [
44
SCIMetacelloLoadSpec {
55
#baseline : 'Microdown',
6-
#load : [ 'RichText', 'Tests' ],
6+
#load : [ 'RichText' ],
77
#onConflict : #useIncoming,
88
#onUpgrade : #useIncoming,
99
#ignoreImage : true,

README.md

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ Microdown is a smaller markdown but it is more extensible. It contains a nice bu
1212
Microdown is now the default markup for the Pillar document compilation chain.
1313

1414

15+
## Install
16+
17+
```Smalltalk
18+
19+
Smalltalk globals
20+
at: #BaselineOfMicrodown
21+
ifPresent: [ :c | c removeFromSystem ].
22+
23+
Metacello new
24+
baseline: 'Microdown';
25+
repository: 'github://pillar-markup/Microdown:v2.9.3/src';
26+
onConflict: [ :ex | ex useIncoming ];
27+
onUpgrade: [ :ex | ex useIncoming ];
28+
load: #('All').
29+
```
30+
31+
1532
## Why should you use Microdown?
1633

1734
Microdown is a smaller markdown but it is more extensible.
@@ -163,12 +180,13 @@ The markup is not interpreted.
163180
Codeblock does not support more than four backticks.
164181

165182

166-
## Development in Pharo 12!
183+
## Development in Pharo 13!
167184

168185
### Loading specific version
169186

170-
To load the latest stable version load the master. If you have trouble loading in the latest Pharo just execute the preloading.st script in the .github folder.
171-
This script will remove the existing Microdown package and clear the system.
187+
To load the latest stable version load the master. If you have trouble loading in the latest Pharo just execute the preloading.st script in the .github folder. This script will remove the existing Microdown package and clear the system.
188+
You can also execute the script provided below.
189+
172190

173191
```Smalltalk
174192
Metacello new
@@ -178,8 +196,8 @@ Metacello new
178196
```
179197

180198
The process is the following:
181-
- Development in dev
182-
- When stable dev -> in master
199+
- Development happens dev.
200+
- When stable dev -> in master.
183201
- When we can build books master is tagged.
184202
- Then there is the Pharo integration in dedicated branches.
185203

@@ -189,13 +207,7 @@ The process is the following:
189207
The following script loads all groups in the Baseline:
190208

191209
```Smalltalk
192-
#( 'Microdown' 'BeautifulComments' 'DocumentBrowser' ) do: [ :name |
193-
(IceRepository repositoryNamed: name)
194-
ifNil: [ self inform: 'Project not found: ' , name ]
195-
ifNotNil: [ :found |
196-
found
197-
unload;
198-
forget ] ].
210+
199211
200212
Smalltalk globals
201213
at: #BaselineOfMicrodown
@@ -207,14 +219,38 @@ Metacello new
207219
onConflict: [ :ex | ex useIncoming ];
208220
onUpgrade: [ :ex | ex useIncoming ];
209221
load: #('All').
210-
```
222+
```
223+
224+
In addition you may want to execute this before.
225+
```
226+
#( 'Microdown' ) do: [ :name |
227+
(IceRepository repositoryNamed: name)
228+
ifNil: [ self inform: 'Project not found: ' , name ]
229+
ifNotNil: [ :found |
230+
found
231+
unload;
232+
forget ] ].
233+
```
211234

212235
## History
213236

214-
We have two sources: Pharo in one hand and Pillar and both are not totally synchronized.
237+
We have two sources:
238+
- Pharo in one hand (a minimal version managed with the pharo* branches) and
239+
- Pillar (eg. all the tools and support for slides and books) and both are not totally synchronized.
240+
241+
Now we also maintain different versions between Pharo versions. Currently the situation is the following:
242+
243+
Working with Pharo 13:
244+
- v2.9.2 a little release to support Foliage v2.1.0 and two new release of Pillar (probably one for P13 and one for P13 dropping pillar format).
245+
- v2.9.1 provides a better integration with Pillar (the Microdown visitors were not used before even if they worked)
246+
v2.7.x
247+
- v2.7.2 merge pharo 13 changes / added gitbridge / OCompiler migration / cleaning syntax description / Ready for Pillar and Foliage
248+
- v2.7.1 LatexQuoteblock-should-not-use-verbatim
249+
- v2.7.0 Fix some errors and API/clients of the textualbuilder
215250

216-
Using Pharo 12: v2.5.x
217251

252+
Working with Pharo 12: v2.5.x
253+
- v2.5.6 - Change html visitor and test for annotated paragraph
218254
- v2.5.5 - add support for top-level header as slide definition
219255
- v2.5.4 - add backward compatible anchor in caption + tonel V3 format
220256
- v2.5.1 - add LaTeX math with reference support for Pharo 12 and Pillar development up to v10.0.0
@@ -223,7 +259,8 @@ Using Pharo 12: v2.5.x
223259

224260
Watch out v2.6.0 is older than v.2.5.4
225261

226-
### Pillar History
262+
### Extract of Pillar History
263+
227264
For Pharo 12
228265
- v10.0.0 but with some links problems due to new inline parser using MD v2.5.0
229266

@@ -235,7 +272,10 @@ For Pharo 10
235272
-v8.3.2 fixed baseline and updated readme
236273

237274

275+
276+
238277
## Implementation
278+
239279
The parser follows the design mentioned in [https://github.github.com/gfm](https://github.github.com/gfm), in particular the parsing strategy in Appendix A.
240280

241281
In short, the strategy is that at any point in time, we might have several children of the root which are ""open"". The deepest in open in the tree is called ""current"". All the parents of the current are open.

src/BaselineOfMicrodown/BaselineOfMicrodown.class.st

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@ BaselineOfMicrodown >> baseline: spec [
1919
xmlParserHtml: spec;
2020
mustache: spec;
2121
gitBridge: spec.
22-
" I disable this because against all my best effort, I cannot avoid the fucking pop up to raise
23-
even if I unload all the packages. I get the Microdown-RichTextComposer in conflict."
24-
22+
2523
spec preLoadDoIt: #'preload:package:'.
26-
27-
28-
"I disable this because in a postload
29-
(IceRepository repositoryNamed: 'microdown') is nil and I do not get why"
30-
24+
3125
spec postLoadDoIt: #'postload:package:'.
3226

3327
spec
@@ -43,6 +37,7 @@ BaselineOfMicrodown >> baseline: spec [
4337

4438
package: #'Microdown-RichTextComposer'
4539
with: [ spec requires: #( #Microdown ) ];
40+
4641
package: #'Microdown-RichTextComposer-Tests'
4742
with: [ spec requires: #( #'Microdown-RichTextComposer' ) ];
4843

@@ -65,12 +60,13 @@ BaselineOfMicrodown >> baseline: spec [
6560
with: [ spec requires: #( #'Microdown-HTMLExporter' 'Microdown-Tests' 'XMLParserHTML') ];
6661

6762
package: #'Microdown-LaTeXExporter'
68-
with: [ spec requires: #( #Microdown ) ];
63+
with: [ spec requires: #( #Microdown ) ];
6964
package: #'Microdown-LaTeXExporter-Tests'
7065
with: [ spec requires: #( #'Microdown-LaTeXExporter' #'Microdown-Tests') ];
71-
66+
7267
package: #'Microdown-BeamerExporter'
7368
with: [ spec requires: #( #'Microdown-LaTeXExporter' ) ];
69+
7470
package: #'Microdown-BeamerExporter-Tests'
7571
with: [ spec requires: #( #'Microdown-LaTeXExporter-Tests') ];
7672

@@ -83,22 +79,23 @@ BaselineOfMicrodown >> baseline: spec [
8379

8480
package: #'Microdown-ParentChildrenChecker' with: [
8581
spec requires: #( #'Microdown' ) ];
82+
8683
package: #'Microdown-BookTester' with: [
8784
spec requires: #( #'Microdown' ) ];
8885
package: #'Microdown-BookTester-Tests' with: [
8986
spec requires: #( #'Microdown-BookTester' ) ];
9087

9188
package: #'Microdown-Blog' with: [
92-
spec requires: #( #'Microdown' #'Mustache') ];
89+
spec requires: #( #'Microdown' #'Mustache' #'Microdown-HTMLExporter') ];
9390
package: #'Microdown-Blog-Tests' with: [
9491
spec requires: #( #'Microdown-Blog' 'GitBridge') ].
9592

96-
"I do not want group without tests for now"
9793
spec
98-
group: 'Core' with: #('Microdown');
94+
group: 'Core' with: #('Microdown' 'Microdown-Tests');
9995
group: 'ForPharo' with: #('Microdown' #'Microdown-BrowserExtensions');
100-
group: 'Tests' with: #('Core' 'Microdown-Tests');
10196
group: 'RichText' with: #('Core' 'Microdown-RichTextComposer' );
97+
group: 'Editor' with: #('RichText' #'Microdown-PrettyPrinter' #'Microdown-PrettyPrinter-Tests');
98+
group: 'LaTeX' with: #('Core' #'Microdown-LaTeXExporter' #'Microdown-LaTeXExporter-Tests');
10299
group: 'Extensions' with: #(
103100
#'Microdown-Evaluator'
104101
#'Microdown-Evaluator-Tests'
@@ -115,9 +112,15 @@ BaselineOfMicrodown >> baseline: spec [
115112
#'Microdown-BookTester-Tests'
116113
#'Microdown-Blog'
117114
#'Microdown-Blog-Tests'
118-
119115
);
120-
group: 'All' with: #('Core' #'Microdown-BrowserExtensions' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ]
116+
group: 'All' with: #('Core' #'Microdown-BrowserExtensions' 'Editor' 'LaTeX' 'Extensions' 'Microdown-Pharo-Tools' 'RichText')
117+
]
118+
119+
120+
121+
122+
123+
121124
]
122125

123126
{ #category : 'baselines' }
@@ -131,7 +134,7 @@ BaselineOfMicrodown >> mustache: spec [
131134

132135
spec baseline: 'Mustache' with: [
133136
spec
134-
repository: 'github://noha/mustache:v1.0/repository';
137+
repository: 'github://noha/mustache:v1.3/repository';
135138
loads: #( 'Core' 'Tests' ) ]
136139
]
137140

@@ -162,16 +165,21 @@ BaselineOfMicrodown >> preload: loader package: packageSpec [
162165
forget ] ]"
163166

164167
| packagesToUnload |
165-
"If we are building the Pharo image, we do not want to unload packages."
166-
SystemBuildInfo current isBuildFinished ifFalse: [ ^ self ].
168+
169+
self flag: 'This is necessary to not break the bootstrapping. Microdown makes a cleaning of classes and as Microdown is loaded in the image it can cause conflits.'.
170+
self flag: 'We do not access the class SystemBuildInfo directly because it is only present in Pharo 13 but Microdown works on different Pharo versions. We can simplifly this when Pharo 13 will be the minimal supported version.'.
171+
self class environment at: #SystemBuildInfo ifPresent: [ :info | info
172+
current isBuildFinished ifFalse: [ ^ self ]. ].
167173

168174
"If it is absent it's because we are in the Pharo bootstrap"
169175
self class environment at: #IceRepository ifPresent: [ :iceRepositoryClass |
170-
packagesToUnload := ((PackageOrganizer default packages select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ]) reject: [ :each |
171-
#( 'Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests' ) includes: each ].
176+
| packages |
177+
"The same here, not direct access to PackageOrganizer because it is only for Pharo 13."
178+
packages := self class environment allClasses collect: #package as: Set.
179+
packagesToUnload := ((packages select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ]) reject: [ :each |
180+
#( 'Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests' ) includes: each ].
172181

173-
"these two are not managed by the microdown repo but the documentation.
174-
I should rename them in the future to avoid confusion"
182+
"these two are not managed by the microdown repo but the documentation. We should rename them in the future to avoid confusion"
175183

176184
packagesToUnload do: [ :each | ((iceRepositoryClass repositoryNamed: 'Microdown') packageNamed: each) unload ] ]
177185
]

src/Microdown-Blog-Tests/MicBridge.class.st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ I am a bridge to access resources from Microdown clone
44
Class {
55
#name : 'MicBridge',
66
#superclass : 'GitBridge',
7-
#category : 'Microdown-Blog-Tests',
8-
#package : 'Microdown-Blog-Tests'
7+
#category : 'Microdown-Blog-Tests-Utils',
8+
#package : 'Microdown-Blog-Tests',
9+
#tag : 'Utils'
910
}
1011

1112
{ #category : 'accessing' }
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Class {
2+
#name : 'AddParagraphLabelPeriodVisitorTest',
3+
#superclass : 'BookSanitizerVisitorTest',
4+
#category : 'Microdown-BookSanitizer-Tests',
5+
#package : 'Microdown-BookSanitizer-Tests'
6+
}
7+
8+
{ #category : 'tests' }
9+
AddParagraphLabelPeriodVisitorTest >> testVisitParagraph [
10+
11+
| aParagraph aTextBlock aAddParagraphLabelPeriodVisitor |
12+
aAddParagraphLabelPeriodVisitor := AddParagraphLabelPeriodVisitor new.
13+
14+
aParagraph := MicParagraphBlock new.
15+
16+
"Stef note:
17+
A paragraph should be more like
18+
#### A Label
19+
llkjlkjlkjlk
20+
"
21+
22+
aTextBlock := MicTextBlock new.
23+
aTextBlock bodyString: '2. Analyse
24+
25+
Bonjour tout le monde1
26+
27+
Bonjour tout le monde2
28+
29+
3 Contact
30+
31+
Bonjour tout le monde3
32+
33+
4. ttttt
34+
35+
Bonjour tout le monde4
36+
37+
5. fpzfpe'.
38+
aParagraph children add: aTextBlock.
39+
40+
aAddParagraphLabelPeriodVisitor visitParagraph: aParagraph.
41+
42+
self assert: aParagraph children first bodyString equals: '2. Analyse
43+
44+
Bonjour tout le monde1
45+
46+
Bonjour tout le monde2
47+
48+
3. Contact
49+
50+
Bonjour tout le monde3
51+
52+
4. ttttt
53+
54+
Bonjour tout le monde4
55+
56+
5. fpzfpe'
57+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Class {
2+
#name : 'BookSanitizerVisitorTest',
3+
#superclass : 'TestCase',
4+
#category : 'Microdown-BookSanitizer-Tests',
5+
#package : 'Microdown-BookSanitizer-Tests'
6+
}

0 commit comments

Comments
 (0)