Skip to content

Commit

Permalink
Fixes: #8073 no more glitches in baseline and package rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Dec 14, 2020
1 parent 8b7cf1b commit 149203c
Showing 1 changed file with 33 additions and 25 deletions.
58 changes: 33 additions & 25 deletions src/Microdown/RPackage.extension.st
Expand Up @@ -2,31 +2,39 @@ Extension { #name : #RPackage }

{ #category : #'*Microdown' }
RPackage >> buildMicroDownUsing: aBuilder withComment: aString [

"I'm on a package and the package is a baseline package."

self class environment
at: self name
ifPresent: [ :cls |
aBuilder
header: [ :b | b text: self name ] withLevel: 1;
horizontalLine;
text: 'A baseline is a kind of map to load project.';
newLine;
header: [ :b | b text: 'Description' ] withLevel: 3;
text: aString;
newLine;
header: [ :b | b text: 'Dependencies' ] withLevel: 3;
codeblockTag: 'pharo'
withBody:
(cls
sourceCodeAt: #baseline:
ifAbsent: [ 'No baseline! Houston we have a problem' ]) ]
ifAbsent: [ aBuilder
header: [ :b |
b
text: 'Package: ';
text: self name ]
withLevel: 1;
horizontalLine;
text: aString ]
ifPresent: [ :cls | "there is a class with the package name. "
(cls name beginsWith: 'BaselineOf')
ifTrue: [
aBuilder
header: [ :b | b text: self name ] withLevel: 1;
horizontalLine;
text: 'A baseline is a kind of map to load project.';
newLine;
header: [ :b | b text: 'Description' ] withLevel: 3;
text: aString;
newLine;
header: [ :b | b text: 'Dependencies' ] withLevel: 3;
codeblockTag: 'pharo'
withBody: (cls
sourceCodeAt: #baseline:
ifAbsent: [ 'No baseline! Houston we have a problem' ]).
^ self ]].

self buildPackageComment: aString using: aBuilder
]

{ #category : #'*Microdown' }
RPackage >> buildPackageComment: aString using: aBuilder [

^ aBuilder
header: [ :b |
b
text: 'Package: ';
text: self name ]
withLevel: 1;
horizontalLine;
text: aString
]

0 comments on commit 149203c

Please sign in to comment.