Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing method to render package comments #675

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/Microdown/BaselineOf.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #BaselineOf }
Extension { #name : 'BaselineOf' }

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
BaselineOf class >> buildMicroDownUsing: aBuilder withComment: aString [
aBuilder
header: [ aBuilder text: self name ] withLevel: 1;
Expand Down
14 changes: 7 additions & 7 deletions src/Microdown/Class.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Class }
Extension { #name : 'Class' }

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
Class >> addDocumentSectionExampleCodeTo: aBuilder [

| exampleCode |
Expand All @@ -13,7 +13,7 @@ Class >> addDocumentSectionExampleCodeTo: aBuilder [
aBuilder codeblock: exampleCode
]

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
Class >> addDocumentSectionTo: aBuilder label: label methods: methods [

methods ifEmpty: [ ^ self ].
Expand All @@ -26,7 +26,7 @@ Class >> addDocumentSectionTo: aBuilder label: label methods: methods [
aBuilder monospace: (each methodClass name, '>>#', each selector) ] ] ]
]

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

aBuilder
Expand All @@ -43,7 +43,7 @@ Class >> buildMicroDownUsing: aBuilder withComment: aString [
methods: (self class methods select: [ :each | each protocol = self documentExamplesProtocol ])
]

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
Class >> documentExampleCode [
| exampleMethod |

Expand All @@ -60,13 +60,13 @@ Class >> documentExampleCode [
trimmed
]

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
Class >> documentExampleCodeSelector [

^ 'example*'
]

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
Class >> documentExamplesProtocol [

^ #'*Examples'
Expand Down
6 changes: 3 additions & 3 deletions src/Microdown/FileReference.extension.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Extension { #name : #FileReference }
Extension { #name : 'FileReference' }

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
FileReference >> asMicResourceReference [
^ MicFileResourceReference fromFileRef: self
]

{ #category : #'*Microdown' }
{ #category : '*Microdown' }
FileReference >> resolveDocument: document [
^ self asMicResourceReference resolveDocument: document.
]
12 changes: 7 additions & 5 deletions src/Microdown/ManifestMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,19 @@ Such packages should be moved in the future to other location (probably pillar i
I was implemented by S. Ducasse, L. Dargaud and G. Polito. It is based on the work on markdown parsing of K. Osterbye.
"
Class {
#name : #ManifestMicrodown,
#superclass : #PackageManifest,
#category : #'Microdown-Manifest'
#name : 'ManifestMicrodown',
#superclass : 'PackageManifest',
#category : 'Microdown-Manifest',
#package : 'Microdown',
#tag : 'Manifest'
}

{ #category : #'code-critics' }
{ #category : 'code-critics' }
ManifestMicrodown class >> ruleAnySatisfyRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'MicFileResourceReference class' #hostOf: #true)) #'2022-01-15T12:11:48.574879+01:00') )
]

{ #category : #'code-critics' }
{ #category : 'code-critics' }
ManifestMicrodown class >> ruleUtilityMethodsRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#MicElement #resolveFrom: #false)) #'2022-04-27T08:53:19.440198+02:00') )
]
36 changes: 19 additions & 17 deletions src/Microdown/MicAbsoluteResourceReference.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,58 @@ A reference will then be resolved and produces a resource.
Common for all absolute references is that they store their reference in a uri (ZnUrl).
"
Class {
#name : #MicAbsoluteResourceReference,
#superclass : #MicResourceReference,
#name : 'MicAbsoluteResourceReference',
#superclass : 'MicResourceReference',
#instVars : [
'uri'
],
#category : #'Microdown-Core'
#category : 'Microdown-Core',
#package : 'Microdown',
#tag : 'Core'
}

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> binaryReadStream [
"return the binaryStream I refer to"
self subclassResponsibility.
]

{ #category : #testing }
{ #category : 'testing' }
MicAbsoluteResourceReference >> canSave [
"return true if I implement contents: "
^ false
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> contents [
"return the contents I refer to"
self subclassResponsibility.
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> contents: aString [
"Some of my subclasses can be written to. By default you cannot, and I then give an error"
MicResourceReferenceError signal: self printString, ' can not be given new contents'
]

{ #category : #testing }
{ #category : 'testing' }
MicAbsoluteResourceReference >> isMicrodownResourceFileReference [
^ false
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> loadChildren [
"return a collection of absolute child references"
^#()
]

{ #category : #loading }
{ #category : 'loading' }
MicAbsoluteResourceReference >> loadImage [
"Throws UnrecognizedImageFormatError in case Pharo does not understand this image type (for exampel svg is not supported)"
^ ImageReadWriter formFromStream: self binaryReadStream
]

{ #category : #loading }
{ #category : 'loading' }
MicAbsoluteResourceReference >> loadMicrodown [
"I am an absolute reference, so I can load completely"
| doc|
Expand All @@ -63,13 +65,13 @@ MicAbsoluteResourceReference >> loadMicrodown [
^ doc
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> path [
"return the path part of my uri"
^ '/', uri path
]

{ #category : #printing }
{ #category : 'printing' }
MicAbsoluteResourceReference >> printOn: aStream [
super printOn: aStream.
aStream
Expand All @@ -78,26 +80,26 @@ MicAbsoluteResourceReference >> printOn: aStream [
nextPutAll: ')'
]

{ #category : #visiting }
{ #category : 'visiting' }
MicAbsoluteResourceReference >> resolveDocument: document [
MicZincPathResolver
resolve: document
withBase: self.
^ document
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> uri [

^ uri
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> uri: aZnUrl [
uri := aZnUrl
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbsoluteResourceReference >> uriString [
^ uri printString
]
20 changes: 11 additions & 9 deletions src/Microdown/MicAbstractAnnotatedBlock.class.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Class {
#name : #MicAbstractAnnotatedBlock,
#superclass : #MicAbstractBlock,
#name : 'MicAbstractAnnotatedBlock',
#superclass : 'MicAbstractBlock',
#instVars : [
'label',
'isClosed',
'body'
],
#category : #'Microdown-Model'
#category : 'Microdown-Model',
#package : 'Microdown',
#tag : 'Model'
}

{ #category : #public }
{ #category : 'public' }
MicAbstractAnnotatedBlock >> addLineAndReturnNextNode: line [
"line is assumed to be of the form '!!label some text'"

Expand All @@ -26,32 +28,32 @@ MicAbstractAnnotatedBlock >> addLineAndReturnNextNode: line [
ifNotNil: [ body := body , String cr , line ]
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbstractAnnotatedBlock >> body [
^ body
]

{ #category : #testing }
{ #category : 'testing' }
MicAbstractAnnotatedBlock >> canConsumeLine: line [
"return if this block can consume line"

"it can be dangerous but let us try"
^ line isNotEmpty
]

{ #category : #initialization }
{ #category : 'initialization' }
MicAbstractAnnotatedBlock >> initialize [

super initialize.
isClosed := false.
]

{ #category : #accessing }
{ #category : 'accessing' }
MicAbstractAnnotatedBlock >> label [
^ label
]

{ #category : #testing }
{ #category : 'testing' }
MicAbstractAnnotatedBlock >> lineMarkup [

^ self subclassResponsibility
Expand Down
Loading
Loading