Skip to content

Commit

Permalink
Merge 8566ab1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Aug 7, 2024
2 parents 80face0 + 8566ab1 commit 66c3bb4
Show file tree
Hide file tree
Showing 21 changed files with 112 additions and 148 deletions.
52 changes: 31 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Microdown is now the default markup for the Pillar document compilation chain.

Microdown is a smaller markdown but it is more extensible.
It is used to produce books, slides, websites, doc.
It can be read on github but also on pharo itself using the DocumentationBrowser
It can be read on GitHub but also on Pharo itself using the DocumentationBrowser

It supports
- Header
Expand All @@ -31,7 +31,7 @@ But also
- Anchor
- Annotated paragraph
- Math with arguments
- and more intra block elements such as extensible markups, raw, math, and references.
- and more intra-block elements such as extensible markups, raw, math, and references.


![Microdown within the Pharo IDE.](screen.png)
Expand All @@ -42,7 +42,7 @@ But also
```
# Header
@anchor
% This is line comment
% This is a line comment
```language=Pharo&caption=Beautiful&label=Fig1
code
Expand All @@ -69,21 +69,21 @@ The headers can be from 1 to 6.
```
### Header Level3
```
There is not support for other forms of declaration.
There is no support for other forms of declaration.
### Anchors
In microdown we can define anchors and reference to them (see References).
In Microdown we can define anchors and reference to them (see References).
There are three ways to create anchors:
- `@anchorlabel` will create an anchor to the preceeding element.
- Figures, mathematical environments, environment can specify label as arguments (`anchor`)
- `@anchorlabel` will create an anchor to the preceding element.
- Figures, mathematical environments, and environment can specify labels as arguments (`anchor`)
- Code block can specify label as argument (argument named `anchor`)
### Various
- % comments
- *** horizontal line
- File meta data is plain JSON
- File metadata is plain JSON
```
{
Expand All @@ -96,7 +96,7 @@ There are three ways to create anchors:
```
### Math support
- `$$` mathematical environment with label for easy referencing.
- `$$` mathematical environment with a label for easy referencing.
```
$$ %label=refToTheGreatEquation
Expand All @@ -108,13 +108,13 @@ $$
```
'abc$ V_i = C_0 - C_3 $def'.
```
will generate LaTeX equivalent and can be referenced using `*@refToTheGreatEquation@`*
will generate a LaTeX equivalent and can be referenced using `*@refToTheGreatEquation@`*
### Codeblock
Microdown offer the same code block that markdown but arguments can be specified and the annotation should be named. The first line after the \`\`\` can be `language=pharo&label=code1&caption=this is my great piece of code`
Microdown offers the same code block that markdown but arguments can be specified and the annotation should be named. The first line after the \`\`\` can be `language=pharo&label=code1&caption=this is my great piece of code`
The following code is not able to display it because markdown quote block are strange and interpret nested block. So we cannot use quoteblock for quoting!
The following code is not able to display it because markdown quote blocks are strange and interpret nested blocks. So we cannot use quoteblock for quoting!
```
```language=pharo&anchor=code1&caption=this is my great piece of code
Expand Down Expand Up @@ -163,11 +163,11 @@ The markup is not interpreted.
Codeblock does not support more than four backticks.
## Development in Pharo12!
## Development in Pharo 12!
### Loading specific version
To load the latest stable version load the master. If you have trouble loading in latest Pharo just execute the preloading.st script in the .github folder.
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.
```Smalltalk
Expand All @@ -184,24 +184,34 @@ The process is the following:
- Then there is the Pharo integration in dedicated branches.
### Loading latest development version
### Loading the latest development version
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 ] ].
Metacello new
baseline: 'Microdown';
repository: 'github://pillar-markup/Microdown:dev/src';
onConflict: [ :ex | ex useIncoming ];
onUpgrade: [ :ex | ex useIncoming ];
load.
load: #('All').
```
## History
We have two sources: Pharo in one hand and Pillar and both are not totally synchronised.
We have two sources: Pharo in one hand and Pillar and both are not totally synchronized.
Using Pharo 12: v2.5.x
- v2.5.5 - add support for top level header as slide definition
- 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 @@ -222,9 +232,9 @@ For Pharo 10
## 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.
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 a number of children of the root which are ""open"". The deepest in open in the tree is called ""current"". All the parents of current are open.
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.
When a new line is read we do the following:
Expand All @@ -235,4 +245,4 @@ When a new line is read we do the following:
4. The root node is not closed until input is exhausted
The other packages in this repository are the extensions made to produce Pillar model.
Such packages should be moved in the future to other location (probably pillar itself).
Such packages should be moved in the future to other locations (probably pillar itself).
8 changes: 7 additions & 1 deletion src/BaselineOfMicrodown/BaselineOfMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ BaselineOfMicrodown >> baseline: spec [
package: #Microdown;
package: #'Microdown-Tests'
with: [ spec requires: #( #Microdown ) ];

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

package: #'Microdown-Pharo-Tools'
with: [ spec requires: #( #Microdown ) ];
Expand Down Expand Up @@ -101,6 +104,7 @@ BaselineOfMicrodown >> baseline: spec [
"I do not want group without tests for now"
spec
group: 'Core' with: #('Microdown');
group: 'ForPharo' with: #('Microdown' #'Microdown-BrowserExtensions');
group: 'Tests' with: #('Core' 'Microdown-Tests');
group: 'RichText' with: #('Core' 'Microdown-RichTextComposer' );
group: 'Extensions' with: #(
Expand All @@ -124,9 +128,11 @@ BaselineOfMicrodown >> baseline: spec [
#'Microdown-ParentChildrenChecker'
#'Microdown-BookTester'
#'Microdown-BookTester-Tests'
#'Microdown-Blog'
#'Microdown-Blog-Tests'
);
group: 'All' with: #('Core' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ]
group: 'All' with: #('Core' #'Microdown-BrowserExtensions' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ]
]

{ #category : 'baselines' }
Expand Down
5 changes: 1 addition & 4 deletions src/Microdown-Blog-Tests/MicBlogCreatorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ MicBlogCreatorTest >> testCopySourceDirectoryInTarget [
MicBlogCreatorTest >> testCreateAllHtmlFile [

| allFile |
self skip.
blog createAllHtmlFile.

allFile := (fileSystem / 'html') allFiles.
Expand All @@ -128,14 +127,13 @@ MicBlogCreatorTest >> testCreateAllHtmlFile [
MicBlogCreatorTest >> testCreateFromTo [

| allFile |
self skip.
MicBlogCreator
createFrom: fileSystem / 'source'
to: fileSystem / 'html'.

allFile := (fileSystem / 'html') allFiles.

self assert: allFile size equals: 8
self assert: allFile size equals: 10
]

{ #category : 'tests' }
Expand Down Expand Up @@ -192,7 +190,6 @@ MicBlogCreatorTest >> testCreateHtmlSummarize [
{ #category : 'tests' }
MicBlogCreatorTest >> testDownloadCSS [

self skip.
blog cssFrameworkName: 'Axist'.
blog downloadCSS.

Expand Down
34 changes: 17 additions & 17 deletions src/Microdown-Blog-Tests/MicFileTestResources.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Class {
#package : 'Microdown-Blog-Tests'
}

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> dumperInput1 [

| root |
Expand All @@ -19,7 +19,7 @@ MicFileTestResources >> dumperInput1 [
^ root
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> dumperInput1WithRootPath [

| root |
Expand All @@ -34,7 +34,7 @@ MicFileTestResources >> dumperInput1WithRootPath [
^ root
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> dumperInput2 [

| root |
Expand All @@ -48,7 +48,7 @@ MicFileTestResources >> dumperInput2 [
^ root
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> dumperInput2WithRootPath [

| root |
Expand All @@ -63,7 +63,7 @@ MicFileTestResources >> dumperInput2WithRootPath [
^ root
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> dumperInput3 [

| root |
Expand All @@ -77,7 +77,7 @@ MicFileTestResources >> dumperInput3 [
^ root
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> dumperInput3WithRootPath [

| root |
Expand All @@ -92,13 +92,13 @@ MicFileTestResources >> dumperInput3WithRootPath [
^ root
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> fileSystem [

^ FileSystem memory
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExample1 [

| file |
Expand All @@ -118,7 +118,7 @@ Amazing debugging experience: The Pharo environment includes a debugger unlike a
^ file asFileReference
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExample2 [

| file |
Expand All @@ -137,7 +137,7 @@ Pharo is a pure _object-oriented programming language_ in the tradition of Small
^ file
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExample3 [

| file |
Expand All @@ -160,7 +160,7 @@ When you participate to the mooc you get access to the quizz and the credit vali
^ file
]

{ #category : 'running' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExampleEmpty [

| file |
Expand Down Expand Up @@ -252,7 +252,7 @@ this is a code blu blu
^ file asFileReference
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExampleWithoutMetadata1 [

| file |
Expand All @@ -269,7 +269,7 @@ Amazing debugging experience: The Pharo environment includes a debugger unlike a
^ file asFileReference
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExampleWithoutMetadata2 [

| file |
Expand All @@ -285,7 +285,7 @@ Pharo is a pure _object-oriented programming language_ in the tradition of Small
^ file
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> generateFilesystemExampleWithoutMetadata3 [

| file |
Expand All @@ -305,19 +305,19 @@ When you participate to the mooc you get access to the quizz and the credit vali
^ file
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> genericEmptyRootPath [

^ ''
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> genericNonEmptyRootPath [

^ 'https://test/'
]

{ #category : 'as yet unclassified' }
{ #category : 'fixture' }
MicFileTestResources >> workingDirectory [

^ self fileSystem workingDirectory
Expand Down
Loading

0 comments on commit 66c3bb4

Please sign in to comment.