Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2d7eeec
Proposing a simple workaround that add empty columns for short rows
Jan 2, 2025
fef9aac
Added tests on the table generated by MicRichTextTable
Jan 14, 2025
1e1784d
Add package tags as a semantic entity that we can attach actions to.
iglosiggio Jan 31, 2025
693a013
Remove one flaky and not that useful test
Ducasse Feb 20, 2025
9778911
Update README.md
Ducasse Feb 20, 2025
803ef9f
Add atKey:ifAbsent: to MicMetaDataBlock
matijakljajic Mar 5, 2025
0c451a8
Merge pull request #937 from matijakljajic/dev
Ducasse Mar 5, 2025
6af2313
Inline usage of asStringWithCr
guillep Mar 13, 2025
87b595d
Merge pull request #938 from guillep/cleanupasStringWithCr
Ducasse Mar 15, 2025
ac53cee
Add possible rawParagraph rendering and an Environment test
matijakljajic Mar 23, 2025
a4a947f
Merge pull request #939 from matijakljajic/dev
Ducasse Mar 24, 2025
7172d6b
Adding another test for nested environment
Ducasse Mar 24, 2025
ed6c676
Fix visitRawParagraph:
Ducasse Mar 24, 2025
149c593
Fixing ugly tests
Ducasse Mar 24, 2025
47fc376
Adding an important comment
Ducasse Mar 24, 2025
45907f6
Getting a first version of MicRawParagraph support for nested elements.
Ducasse Mar 24, 2025
6d16af4
Adding two more tests showing bugs but skipped for now.
Ducasse Mar 24, 2025
2a36b5a
now going over arguments
Ducasse Mar 25, 2025
150d5d8
Making progress with matija
Ducasse Mar 25, 2025
a384892
Still one test not working
Ducasse Mar 25, 2025
69581d1
Fixing the problem is <p>We
Ducasse Mar 26, 2025
4d89a17
Adding a new test illustrating the problem: now p is ignored.
Ducasse Mar 26, 2025
9236747
remov MicRawParagraphBlock2
Ducasse Mar 26, 2025
1e5a0e7
Change visitPargraph: not to emit <p> explicitly. This will only be f…
Ducasse Mar 26, 2025
5ca0c06
Fix visitRawParagraph so that all tests pass
matijakljajic Mar 28, 2025
1c9d022
Merge pull request #945 from matijakljajic/RawParagraphNestingSupport
Ducasse Mar 28, 2025
e3c3133
Adding at: API to metadataelement. should deprecated the other one.
Ducasse Mar 30, 2025
418e452
Merge pull request #946 from pillar-markup/RawParagraphNestingSupport
Ducasse May 2, 2025
820ed45
Adding a simple div class= xxx test
Ducasse May 2, 2025
0a621eb
Not accessing the class SystemBuildInfo directly
jordanmontt May 6, 2025
b28b6e0
Merge pull request #947 from jordanmontt/fix-baseline-post-loaf
jecisc May 6, 2025
f13dfd1
Not using PackageOrganizer directly
jordanmontt May 6, 2025
2fd222e
Merge pull request #948 from jordanmontt/fix-baseline-2
jecisc May 6, 2025
94694e1
Adding support for raw html handling.
Ducasse May 9, 2025
c6f46ec
Merge 2fd222e797392fee15088ebd436a9215e39b1766
Ducasse May 9, 2025
0687f61
Making minimal configuration explicit about the line ending.
Ducasse May 10, 2025
19c2b5e
Lousy way of supporting kind of text for every entities. This must be…
Ducasse May 27, 2025
06a9032
Now using latest version of mustache i.e. v1.3
Ducasse May 29, 2025
36dc33e
Add pillar dependent methods
guillep Jun 23, 2025
24cbd93
Merge pull request #950 from guillep/microhtml
guillep Jun 26, 2025
d659047
Add better test for rawBlock and move test about rawParagraph to the …
Ducasse Jul 19, 2025
dc1ec43
Merge pull request #929 from iglosiggio/browse-to-package-tag
Ducasse Aug 2, 2025
9cb2386
Make sure that microdown uses its own method to extract 1 from '1. b'
Ducasse Aug 2, 2025
f480ebb
Fixes: #604 removed unused shared pool subclasses.
Ducasse Aug 2, 2025
0403938
Move gitBridge to Microdown-Blog-Tests
Ducasse Aug 2, 2025
3d38643
Fixes: #952 table row ending in with no character after the last Tx …
Ducasse Aug 2, 2025
b5c9312
Merge pull request #927 from NicolasAnquetil/926-MicRichTextTable-dow…
Ducasse Aug 2, 2025
81abfa8
Fixes: #834 with bad parsing of empty metadata
Ducasse Aug 2, 2025
b866f66
Update README.md
Ducasse Aug 2, 2025
26d0316
Started to add printOn: to ease debugging
Ducasse Aug 7, 2025
f175de8
getting started. Commit so that we can test with Foliage
Ducasse Aug 7, 2025
00bd69e
Better parse:andCheck:
Ducasse Aug 8, 2025
a0e6179
Fixing paragraph with an extra new lines for now (instead of the <p> …
Ducasse Aug 8, 2025
361f0c3
adding comments and more tests
Ducasse Aug 8, 2025
ab63540
Adding log
Ducasse Aug 8, 2025
8c01937
Update README.md
Ducasse Aug 8, 2025
841ecb6
Update README.md
Ducasse Aug 8, 2025
508f090
Fix visitParagraph: to emit <p>. Half of the tests are fixed.
Ducasse Aug 11, 2025
5095e6c
All tests pass + new tests
Ducasse Aug 11, 2025
73b2b34
commenting a bit the codeblock evaluator waiting for github issues to…
Ducasse Aug 12, 2025
6a00886
Renamed MicBookTesterVisitorTest
Ducasse Aug 12, 2025
2b8f221
Change fileSystem: into rootDirectory: duh!
Ducasse Aug 12, 2025
a16e518
Merge 2b8f221f8967d97f428c6045c033d1ed1eb52296
Ducasse Aug 12, 2025
d0c9706
Just better parameter names - does not hurt!
Ducasse Aug 12, 2025
3f7097a
Return the reporter.
Ducasse Aug 12, 2025
81a217e
Fixing inspector extension :(
Ducasse Aug 15, 2025
e52a2a3
Adding a simple debugId into MicRootElement to help debugging.
Ducasse Aug 15, 2025
27d8545
Formatting code
Ducasse Aug 15, 2025
f342823
introduce better API to MicFileIncluder
Ducasse Aug 15, 2025
12ef258
Introduce a better API to latex writer to input all files before gene…
Ducasse Aug 15, 2025
c6db807
remove write: specialization since pillar already does it.
Ducasse Aug 15, 2025
52bcc01
Creating a new group.
Ducasse Aug 16, 2025
a1a8879
Adding explicitly group for editor
Ducasse Aug 16, 2025
3861121
working on the templated writer
Ducasse Aug 17, 2025
9c442bf
Merge a1a8879dd4213627ce7c0a3807327bae1846e771
Ducasse Aug 17, 2025
c9432a0
Fixing printString of Figure
Ducasse Aug 17, 2025
0d9aa2b
Added Editor to all
Ducasse Aug 20, 2025
cea9f1f
Trying again
Ducasse Aug 20, 2025
b98fcc1
Update README.md
Ducasse Aug 28, 2025
11f6c93
Frivolous commit just ot re launcht eh CI
jordanmontt Aug 29, 2025
b511feb
Merge branch 'Pharo14' into dev
jordanmontt Aug 29, 2025
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
65 changes: 49 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ Microdown is a smaller markdown but it is more extensible. It contains a nice bu
Microdown is now the default markup for the Pillar document compilation chain.


## Instal

```Smalltalk
Metacello new
baseline: 'Microdown';
repository: 'github://pillar-markup/Microdown:v2.9.3/src';
load.
```


## Why should you use Microdown?

Microdown is a smaller markdown but it is more extensible.
Expand Down Expand Up @@ -163,12 +173,13 @@ The markup is not interpreted.
Codeblock does not support more than four backticks.


## Development in Pharo 12!
## Development in Pharo 13!

### Loading specific version

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.
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.
You can also execute the script provided below.


```Smalltalk
Metacello new
Expand All @@ -178,8 +189,8 @@ Metacello new
```

The process is the following:
- Development in dev
- When stable dev -> in master
- Development happens dev.
- When stable dev -> in master.
- When we can build books master is tagged.
- Then there is the Pharo integration in dedicated branches.

Expand All @@ -189,13 +200,7 @@ The process is the following:
The following script loads all groups in the Baseline:

```Smalltalk
#( 'Microdown' 'BeautifulComments' 'DocumentBrowser' ) do: [ :name |
(IceRepository repositoryNamed: name)
ifNil: [ self inform: 'Project not found: ' , name ]
ifNotNil: [ :found |
found
unload;
forget ] ].


Smalltalk globals
at: #BaselineOfMicrodown
Expand All @@ -207,14 +212,38 @@ Metacello new
onConflict: [ :ex | ex useIncoming ];
onUpgrade: [ :ex | ex useIncoming ];
load: #('All').
```
```

In addition you may want to execute this before.
```
#( 'Microdown' ) do: [ :name |
(IceRepository repositoryNamed: name)
ifNil: [ self inform: 'Project not found: ' , name ]
ifNotNil: [ :found |
found
unload;
forget ] ].
```

## History

We have two sources: Pharo in one hand and Pillar and both are not totally synchronized.
We have two sources:
- Pharo in one hand (a minimal version managed with the pharo* branches) and
- Pillar (eg. all the tools and support for slides and books) and both are not totally synchronized.

Now we also maintain different versions between Pharo versions. Currently the situation is the following:

Working with Pharo 13:
- 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).
- v2.9.1 provides a better integration with Pillar (the Microdown visitors were not used before even if they worked)
v2.7.x
- v2.7.2 merge pharo 13 changes / added gitbridge / OCompiler migration / cleaning syntax description / Ready for Pillar and Foliage
- v2.7.1 LatexQuoteblock-should-not-use-verbatim
- v2.7.0 Fix some errors and API/clients of the textualbuilder

Using Pharo 12: v2.5.x

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

Watch out v2.6.0 is older than v.2.5.4

### Pillar History
### Extract of Pillar History

For Pharo 12
- v10.0.0 but with some links problems due to new inline parser using MD v2.5.0

Expand All @@ -235,7 +265,10 @@ For Pharo 10
-v8.3.2 fixed baseline and updated readme




## Implementation

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.

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.
Expand Down
51 changes: 29 additions & 22 deletions src/BaselineOfMicrodown/BaselineOfMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ BaselineOfMicrodown >> baseline: spec [
xmlParserHtml: spec;
mustache: spec;
gitBridge: 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:'.

spec
Expand All @@ -43,6 +37,7 @@ BaselineOfMicrodown >> baseline: spec [

package: #'Microdown-RichTextComposer'
with: [ spec requires: #( #Microdown ) ];

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

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

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

package: #'Microdown-BeamerExporter'
with: [ spec requires: #( #'Microdown-LaTeXExporter' ) ];

package: #'Microdown-BeamerExporter-Tests'
with: [ spec requires: #( #'Microdown-LaTeXExporter-Tests') ];

Expand All @@ -93,12 +89,12 @@ BaselineOfMicrodown >> baseline: spec [
package: #'Microdown-Blog-Tests' with: [
spec requires: #( #'Microdown-Blog' 'GitBridge') ].

"I do not want group without tests for now"
spec
group: 'Core' with: #('Microdown');
group: 'Core' with: #('Microdown' 'Microdown-Tests');
group: 'ForPharo' with: #('Microdown' #'Microdown-BrowserExtensions');
group: 'Tests' with: #('Core' 'Microdown-Tests');
group: 'RichText' with: #('Core' 'Microdown-RichTextComposer' );
group: 'Editor' with: #('RichText' #'Microdown-PrettyPrinter' #'Microdown-PrettyPrinter-Tests');
group: 'LaTeX' with: #('Core' #'Microdown-LaTeXExporter' #'Microdown-LaTeXExporter-Tests');
group: 'Extensions' with: #(
#'Microdown-Evaluator'
#'Microdown-Evaluator-Tests'
Expand All @@ -115,9 +111,15 @@ BaselineOfMicrodown >> baseline: spec [
#'Microdown-BookTester-Tests'
#'Microdown-Blog'
#'Microdown-Blog-Tests'

);
group: 'All' with: #('Core' #'Microdown-BrowserExtensions' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ]
group: 'All' with: #('Core' #'Microdown-BrowserExtensions' 'Editor' 'LaTeX' 'Extensions' 'Microdown-Pharo-Tools' 'RichText')
]






]

{ #category : 'baselines' }
Expand All @@ -131,7 +133,7 @@ BaselineOfMicrodown >> mustache: spec [

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

Expand Down Expand Up @@ -162,16 +164,21 @@ BaselineOfMicrodown >> preload: loader package: packageSpec [
forget ] ]"

| packagesToUnload |
"If we are building the Pharo image, we do not want to unload packages."
SystemBuildInfo current isBuildFinished ifFalse: [ ^ self ].

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.'.
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.'.
self class environment at: #SystemBuildInfo ifPresent: [ :info | info
current isBuildFinished ifFalse: [ ^ self ]. ].

"If it is absent it's because we are in the Pharo bootstrap"
self class environment at: #IceRepository ifPresent: [ :iceRepositoryClass |
packagesToUnload := ((PackageOrganizer default packages select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ]) reject: [ :each |
#( 'Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests' ) includes: each ].
| packages |
"The same here, not direct access to PackageOrganizer because it is only for Pharo 13."
packages := self class environment allClasses collect: #package as: Set.
packagesToUnload := ((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"
"these two are not managed by the microdown repo but the documentation. We should rename them in the future to avoid confusion"

packagesToUnload do: [ :each | ((iceRepositoryClass repositoryNamed: 'Microdown') packageNamed: each) unload ] ]
]
Expand Down
5 changes: 3 additions & 2 deletions src/Microdown-Blog-Tests/MicBridge.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ I am a bridge to access resources from Microdown clone
Class {
#name : 'MicBridge',
#superclass : 'GitBridge',
#category : 'Microdown-Blog-Tests',
#package : 'Microdown-Blog-Tests'
#category : 'Microdown-Blog-Tests-Utils',
#package : 'Microdown-Blog-Tests',
#tag : 'Utils'
}

{ #category : 'accessing' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Class {
#name : 'MicBookTesterVisitorTest',
#name : 'MicCodeBlockValitorTest',
#superclass : 'TestCase',
#category : 'Microdown-BookTester-Tests',
#package : 'Microdown-BookTester-Tests'
}

{ #category : 'utilities' }
MicBookTesterVisitorTest >> parseAndTest: docText [
MicCodeBlockValitorTest >> parseAndTest: docText [
| doc bTester |
doc := Microdown parse: docText.
bTester := MicCodeBlockValidator new.
Expand All @@ -15,7 +15,7 @@ MicBookTesterVisitorTest >> parseAndTest: docText [
]

{ #category : 'tests - valid book tests' }
MicBookTesterVisitorTest >> testExampleCodeblock [
MicCodeBlockValitorTest >> testExampleCodeblock [
| docText bTester |
docText := '```example=true
3 + 4
Expand All @@ -27,7 +27,7 @@ MicBookTesterVisitorTest >> testExampleCodeblock [
]

{ #category : 'tests - failing book tests' }
MicBookTesterVisitorTest >> testExampleCodeblockWithFailingTest [
MicCodeBlockValitorTest >> testExampleCodeblockWithFailingTest [
| docText bTester |
docText := '```example=true
3 + ''12''
Expand All @@ -40,7 +40,7 @@ MicBookTesterVisitorTest >> testExampleCodeblockWithFailingTest [
]

{ #category : 'tests - failing book tests' }
MicBookTesterVisitorTest >> testExampleCodeblockWithFalseTest [
MicCodeBlockValitorTest >> testExampleCodeblockWithFalseTest [

| docText bTester |
docText := '```example=true
Expand All @@ -54,7 +54,7 @@ MicBookTesterVisitorTest >> testExampleCodeblockWithFalseTest [
]

{ #category : 'tests - failing book tests' }
MicBookTesterVisitorTest >> testExampleCodeblockWithNoBrakets [
MicCodeBlockValitorTest >> testExampleCodeblockWithNoBrakets [

| docText bTester |
docText := '```example=true
Expand All @@ -68,7 +68,7 @@ MicBookTesterVisitorTest >> testExampleCodeblockWithNoBrakets [
]

{ #category : 'tests - strange codeblock' }
MicBookTesterVisitorTest >> testExampleCodeblockWithTwoBrackets [
MicCodeBlockValitorTest >> testExampleCodeblockWithTwoBrackets [
">> instead of > > > should not work so there is one failed test"

| docText bTester |
Expand All @@ -83,7 +83,7 @@ MicBookTesterVisitorTest >> testExampleCodeblockWithTwoBrackets [
]

{ #category : 'tests - strange codeblock' }
MicBookTesterVisitorTest >> testExampleEmptyCodeblockWithTwoBrackets [
MicCodeBlockValitorTest >> testExampleEmptyCodeblockWithTwoBrackets [

| docText bTester |
docText := '```example=true
Expand All @@ -99,7 +99,7 @@ MicBookTesterVisitorTest >> testExampleEmptyCodeblockWithTwoBrackets [
]

{ #category : 'tests - valid book tests' }
MicBookTesterVisitorTest >> testExpectedFailureForAFailure [
MicCodeBlockValitorTest >> testExpectedFailureForAFailure [
| docText bTester |
docText := '```example=true&expectedFailure=true
3 + 4
Expand All @@ -112,7 +112,7 @@ MicBookTesterVisitorTest >> testExpectedFailureForAFailure [
]

{ #category : 'tests - valid book tests' }
MicBookTesterVisitorTest >> testExpectedFailureForARaisedException [
MicCodeBlockValitorTest >> testExpectedFailureForARaisedException [
| docText bTester |
docText := '```example=true&expectedFailure=true
3 + ''a''
Expand All @@ -125,7 +125,7 @@ MicBookTesterVisitorTest >> testExpectedFailureForARaisedException [
]

{ #category : 'tests - valid book tests' }
MicBookTesterVisitorTest >> testExplanationIsExceptionCatchedInFailingTest [
MicCodeBlockValitorTest >> testExplanationIsExceptionCatchedInFailingTest [
| docText bTester |
docText := '```example=true
3 + ''12''
Expand All @@ -140,7 +140,7 @@ MicBookTesterVisitorTest >> testExplanationIsExceptionCatchedInFailingTest [
]

{ #category : 'tests - valid book tests' }
MicBookTesterVisitorTest >> testExplanationIsTestFailedWithoutException [
MicCodeBlockValitorTest >> testExplanationIsTestFailedWithoutException [

| docText bTester |
docText := '```example=true
Expand All @@ -155,7 +155,7 @@ MicBookTesterVisitorTest >> testExplanationIsTestFailedWithoutException [
]

{ #category : 'tests - valid book tests' }
MicBookTesterVisitorTest >> testExplanationIsTestPassed [
MicCodeBlockValitorTest >> testExplanationIsTestPassed [

| docText bTester |
docText := '```example=true
Expand All @@ -170,7 +170,7 @@ MicBookTesterVisitorTest >> testExplanationIsTestPassed [
]

{ #category : 'tests - no example' }
MicBookTesterVisitorTest >> testNoExampleCodeblock [
MicCodeBlockValitorTest >> testNoExampleCodeblock [
| docText bTester |
docText := '```
3 + 4
Expand All @@ -183,7 +183,7 @@ MicBookTesterVisitorTest >> testNoExampleCodeblock [
]

{ #category : 'tests - no example' }
MicBookTesterVisitorTest >> testThreeCodeBlocksWithTwoExamples [
MicCodeBlockValitorTest >> testThreeCodeBlocksWithTwoExamples [

| docText bTester |
docText :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Class {
#package : 'Microdown-BookTester-Tests'
}

{ #category : 'as yet unclassified' }
{ #category : 'helpers - anchors & references' }
MicReferenceCheckerTest >> anchorNames: checker [

^ checker results
Expand Down
Loading
Loading