From 4149d581145c3cc6715dfd30054fcb408fc34596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Sun, 11 Feb 2024 20:52:31 +0100 Subject: [PATCH 1/5] Fixing also Package --- src/Microdown/BaselineOf.extension.st | 4 +- src/Microdown/Class.extension.st | 14 +- src/Microdown/FileReference.extension.st | 6 +- src/Microdown/ManifestMicrodown.class.st | 12 +- .../MicAbsoluteResourceReference.class.st | 36 ++--- .../MicAbstractAnnotatedBlock.class.st | 20 +-- src/Microdown/MicAbstractBlock.class.st | 58 ++++---- src/Microdown/MicAbstractBlock.extension.st | 4 +- src/Microdown/MicAbstractCodeBlock.class.st | 16 ++- src/Microdown/MicAbstractDelimiter.class.st | 58 ++++---- ...icAbstractMicrodownTextualBuilder.class.st | 60 ++++---- src/Microdown/MicAnchorBlock.class.st | 22 +-- src/Microdown/MicAnchorLinker.class.st | 10 +- .../MicAnchorReferenceBlock.class.st | 24 ++-- ...MicAnchorReferenceCloserDelimiter.class.st | 18 +-- ...MicAnchorReferenceOpenerDelimiter.class.st | 18 +-- src/Microdown/MicAnnotatedBlock.class.st | 18 +-- src/Microdown/MicAnnotationBlock.class.st | 34 ++--- .../MicAnnotationCloserDelimiter.class.st | 18 +-- .../MicAnnotationOpenerDelimiter.class.st | 18 +-- src/Microdown/MicArgumentList.class.st | 46 +++--- src/Microdown/MicBoldDelimiter.class.st | 18 +-- src/Microdown/MicBoldFormatBlock.class.st | 16 ++- src/Microdown/MicCitationBlock.class.st | 14 +- src/Microdown/MicCodeBlock.class.st | 32 +++-- src/Microdown/MicColumnBlock.class.st | 16 ++- src/Microdown/MicColumnsBlock.class.st | 12 +- src/Microdown/MicCommentBlock.class.st | 12 +- .../MicContinuousMarkedBlock.class.st | 22 +-- src/Microdown/MicDocumentListBlock.class.st | 22 +-- src/Microdown/MicElement.class.st | 44 +++--- src/Microdown/MicEnvironmentBlock.class.st | 36 ++--- src/Microdown/MicFigureBlock.class.st | 36 ++--- .../MicFigureNameOpenerDelimiter.class.st | 22 +-- .../MicFileResourceReference.class.st | 36 ++--- src/Microdown/MicFootnoteBlock.class.st | 14 +- src/Microdown/MicFormatBlock.class.st | 24 ++-- .../MicHTTPResourceReference.class.st | 28 ++-- src/Microdown/MicHeaderBlock.class.st | 26 ++-- src/Microdown/MicHorizontalLineBlock.class.st | 10 +- src/Microdown/MicInlineBlockWithUrl.class.st | 54 +++---- src/Microdown/MicInlineElement.class.st | 60 ++++---- src/Microdown/MicInlineParser.class.st | 96 +++++++------ src/Microdown/MicInputfileBlock.class.st | 28 ++-- src/Microdown/MicItalicDelimiter.class.st | 18 +-- src/Microdown/MicItalicFormatBlock.class.st | 16 ++- src/Microdown/MicLinkBlock.class.st | 20 +-- .../MicLinkNameCloserDelimiter.class.st | 16 ++- src/Microdown/MicLinkNameDelimiter.class.st | 16 ++- .../MicLinkNameOpenerDelimiter.class.st | 16 ++- src/Microdown/MicListBlock.class.st | 22 +-- src/Microdown/MicListItemBlock.class.st | 30 ++-- src/Microdown/MicMathBlock.class.st | 16 ++- src/Microdown/MicMathDelimiter.class.st | 18 +-- src/Microdown/MicMathInlineBlock.class.st | 20 +-- src/Microdown/MicMetaDataBlock.class.st | 26 ++-- src/Microdown/MicMicrodownSharedPool.class.st | 10 +- .../MicMicrodownTextualBuilder.class.st | 136 +++++++++--------- .../MicMinimalConfiguration.class.st | 24 ++-- src/Microdown/MicMonospaceDelimiter.class.st | 18 +-- .../MicMonospaceFormatBlock.class.st | 20 +-- src/Microdown/MicOrderedListBlock.class.st | 18 +-- src/Microdown/MicOutputStream.class.st | 50 +++---- src/Microdown/MicParagraphBlock.class.st | 30 ++-- src/Microdown/MicParsingError.class.st | 12 +- src/Microdown/MicPharoEvaluatorBlock.class.st | 16 ++- .../MicPharoImageResourceReference.class.st | 20 +-- src/Microdown/MicPharoScriptBlock.class.st | 14 +- src/Microdown/MicQuoteBlock.class.st | 14 +- src/Microdown/MicRawBlock.class.st | 20 +-- src/Microdown/MicRawCloserDelimiter.class.st | 18 +-- src/Microdown/MicRawOpenerDelimiter.class.st | 18 +-- .../MicRelativeResourceReference.class.st | 20 +-- src/Microdown/MicResourceReference.class.st | 20 +-- .../MicResourceReferenceError.class.st | 8 +- src/Microdown/MicRootBlock.class.st | 18 +-- .../MicSameStartStopMarkupBlock.class.st | 24 ++-- src/Microdown/MicScriptBlock.class.st | 12 +- src/Microdown/MicSingleLineBlock.class.st | 12 +- src/Microdown/MicSlideBlock.class.st | 18 +-- src/Microdown/MicSourceBlock.class.st | 16 ++- .../MicStartStopMarkupBlock.class.st | 38 ++--- src/Microdown/MicStrikeDelimiter.class.st | 18 +-- src/Microdown/MicStrikeFormatBlock.class.st | 16 ++- src/Microdown/MicTableBlock.class.st | 28 ++-- src/Microdown/MicTextBlock.class.st | 14 +- src/Microdown/MicURLCloserDelimiter.class.st | 20 +-- src/Microdown/MicURLOpenerDelimiter.class.st | 20 +-- src/Microdown/MicUnknownResourceUri.class.st | 12 +- src/Microdown/MicUnorderedListBlock.class.st | 12 +- src/Microdown/MicZincPathResolver.class.st | 22 +-- src/Microdown/MicroSharedPool.class.st | 8 +- src/Microdown/Microdown.class.st | 42 +++--- src/Microdown/MicrodownParser.class.st | 44 +++--- src/Microdown/MicrodownVisitor.class.st | 100 ++++++------- src/Microdown/OrderedDictionary.extension.st | 4 +- src/Microdown/Package.extension.st | 32 +++++ src/Microdown/RGBehavior.extension.st | 4 +- src/Microdown/RGPackage.extension.st | 4 +- src/Microdown/RPackage.extension.st | 4 +- .../SequenceableCollection.extension.st | 4 +- src/Microdown/String.extension.st | 10 +- src/Microdown/TestCase.extension.st | 4 +- src/Microdown/Text.extension.st | 4 +- src/Microdown/ZnUrl.extension.st | 6 +- src/Microdown/package.st | 2 +- 106 files changed, 1349 insertions(+), 1135 deletions(-) create mode 100644 src/Microdown/Package.extension.st diff --git a/src/Microdown/BaselineOf.extension.st b/src/Microdown/BaselineOf.extension.st index c75aa4b0..2213f4de 100644 --- a/src/Microdown/BaselineOf.extension.st +++ b/src/Microdown/BaselineOf.extension.st @@ -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; diff --git a/src/Microdown/Class.extension.st b/src/Microdown/Class.extension.st index 3343f437..ddfd451d 100644 --- a/src/Microdown/Class.extension.st +++ b/src/Microdown/Class.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Class } +Extension { #name : 'Class' } -{ #category : #'*Microdown' } +{ #category : '*Microdown' } Class >> addDocumentSectionExampleCodeTo: aBuilder [ | exampleCode | @@ -13,7 +13,7 @@ Class >> addDocumentSectionExampleCodeTo: aBuilder [ aBuilder codeblock: exampleCode ] -{ #category : #'*Microdown' } +{ #category : '*Microdown' } Class >> addDocumentSectionTo: aBuilder label: label methods: methods [ methods ifEmpty: [ ^ self ]. @@ -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 @@ -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 | @@ -60,13 +60,13 @@ Class >> documentExampleCode [ trimmed ] -{ #category : #'*Microdown' } +{ #category : '*Microdown' } Class >> documentExampleCodeSelector [ ^ 'example*' ] -{ #category : #'*Microdown' } +{ #category : '*Microdown' } Class >> documentExamplesProtocol [ ^ #'*Examples' diff --git a/src/Microdown/FileReference.extension.st b/src/Microdown/FileReference.extension.st index 4e76f3c7..e6c4ac90 100644 --- a/src/Microdown/FileReference.extension.st +++ b/src/Microdown/FileReference.extension.st @@ -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. ] diff --git a/src/Microdown/ManifestMicrodown.class.st b/src/Microdown/ManifestMicrodown.class.st index 3e38e8c7..e83f9f6d 100644 --- a/src/Microdown/ManifestMicrodown.class.st +++ b/src/Microdown/ManifestMicrodown.class.st @@ -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') ) ] diff --git a/src/Microdown/MicAbsoluteResourceReference.class.st b/src/Microdown/MicAbsoluteResourceReference.class.st index 49ded109..fe7a9a11 100644 --- a/src/Microdown/MicAbsoluteResourceReference.class.st +++ b/src/Microdown/MicAbsoluteResourceReference.class.st @@ -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| @@ -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 @@ -78,7 +80,7 @@ MicAbsoluteResourceReference >> printOn: aStream [ nextPutAll: ')' ] -{ #category : #visiting } +{ #category : 'visiting' } MicAbsoluteResourceReference >> resolveDocument: document [ MicZincPathResolver resolve: document @@ -86,18 +88,18 @@ MicAbsoluteResourceReference >> resolveDocument: document [ ^ 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 ] diff --git a/src/Microdown/MicAbstractAnnotatedBlock.class.st b/src/Microdown/MicAbstractAnnotatedBlock.class.st index 0f9f9a70..5ce4d72a 100644 --- a/src/Microdown/MicAbstractAnnotatedBlock.class.st +++ b/src/Microdown/MicAbstractAnnotatedBlock.class.st @@ -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'" @@ -26,12 +28,12 @@ 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" @@ -39,19 +41,19 @@ MicAbstractAnnotatedBlock >> canConsumeLine: line [ ^ 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 diff --git a/src/Microdown/MicAbstractBlock.class.st b/src/Microdown/MicAbstractBlock.class.st index 68917447..143694fd 100644 --- a/src/Microdown/MicAbstractBlock.class.st +++ b/src/Microdown/MicAbstractBlock.class.st @@ -7,28 +7,30 @@ I have a set of children, and an uplink to my parent. See the comment of `MicroDownParser` for an overview of the algorithm used in building such parse tree. " Class { - #name : #MicAbstractBlock, - #superclass : #MicElement, + #name : 'MicAbstractBlock', + #superclass : 'MicElement', #instVars : [ 'children', 'parser' ], - #category : #'Microdown-Model' + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #public } +{ #category : 'public' } MicAbstractBlock class >> alternateBlockClassFor: line [ "This hook supports extensions of environments. we get > addChild: childBlock [ children add: childBlock ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> addLineAndReturnNextNode: line [ "add line to this node. Notice, the action is allowed to create new nodes in the block tree. @@ -38,86 +40,86 @@ MicAbstractBlock >> addLineAndReturnNextNode: line [ ^ self ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> blockExtensionStarterClassFrom: line [ "return the class of a block which can start with line, or nil if none" ^ nil ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> blockStarterClassFrom: line [ "return the class of a block which can start with line, or nil if none" ^ (self parser blockStarterClassFrom: line) ifNotNil: [ :c | c alternateBlockClassFor: line ] ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> canConsumeLine: line [ "return if this block can consume line" ^ self subclassResponsibility ] -{ #category : #adding } +{ #category : 'adding' } MicAbstractBlock >> children [ ^children ] -{ #category : #adding } +{ #category : 'adding' } MicAbstractBlock >> children: aCollection [ children := aCollection ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> closeMe [ "I'm hook for closing elements. By default do nothing." ^ self ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> computeNestedLevel [ ^ 0 ] -{ #category : #properties } +{ #category : 'properties' } MicAbstractBlock >> hasProperty: aKey [ "Test if the property aKey is present." ^ self properties notNil and: [ self properties includesKey: aKey ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractBlock >> indent [ ^ parent indent ] -{ #category : #initialization } +{ #category : 'initialization' } MicAbstractBlock >> initialize [ super initialize. children := OrderedCollection new. ] -{ #category : #'*Microdown-DocumentBrowser' } +{ #category : '*Microdown-DocumentBrowser' } MicAbstractBlock >> isRootSection [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractBlock >> listItemBlockClass [ ^ MicListItemBlock ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> nestedLevel [ "Return the nesting level of main blocks. Basically only list increases this." ^ 0 ] -{ #category : #public } +{ #category : 'public' } MicAbstractBlock >> newBlockFor: line parent: parentBlock [ | newBlockClass | newBlockClass := self blockStarterClassFrom: line. @@ -128,44 +130,44 @@ MicAbstractBlock >> newBlockFor: line parent: parentBlock [ addLineAndReturnNextNode: line ] -{ #category : #private } +{ #category : 'private' } MicAbstractBlock >> parser [ ^ parser ] -{ #category : #private } +{ #category : 'private' } MicAbstractBlock >> parserClass [ ^ MicrodownParser ] -{ #category : #replacement } +{ #category : 'replacement' } MicAbstractBlock >> replace: aBlock by: anotherBlock [ children replaceAll: aBlock with: anotherBlock ] -{ #category : #replacement } +{ #category : 'replacement' } MicAbstractBlock >> replace: aBlock byCollection: aCollection [ children := children copyReplaceAll: {aBlock} with: aCollection ] -{ #category : #replacement } +{ #category : 'replacement' } MicAbstractBlock >> replaceBy: anotherBlock [ self parent replace: self by: anotherBlock ] -{ #category : #replacement } +{ #category : 'replacement' } MicAbstractBlock >> replaceByAll: aCollection [ self parent replace: self byCollection: aCollection ] -{ #category : #private } +{ #category : 'private' } MicAbstractBlock >> setParser: aParser [ parser := aParser ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractBlock >> text [ | text | self flag: #todo. diff --git a/src/Microdown/MicAbstractBlock.extension.st b/src/Microdown/MicAbstractBlock.extension.st index 8103ef23..d1da7125 100644 --- a/src/Microdown/MicAbstractBlock.extension.st +++ b/src/Microdown/MicAbstractBlock.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicAbstractBlock } +Extension { #name : 'MicAbstractBlock' } -{ #category : #'*Microdown-DocumentBrowser' } +{ #category : '*Microdown-DocumentBrowser' } MicAbstractBlock >> isRootSection [ ^ false ] diff --git a/src/Microdown/MicAbstractCodeBlock.class.st b/src/Microdown/MicAbstractCodeBlock.class.st index 1c08b322..e18ef8f0 100644 --- a/src/Microdown/MicAbstractCodeBlock.class.st +++ b/src/Microdown/MicAbstractCodeBlock.class.st @@ -2,12 +2,14 @@ I am common class for two extension blocks which at the moment shares the same syntax. " Class { - #name : #MicAbstractCodeBlock, - #superclass : #MicSameStartStopMarkupBlock, - #category : #'Microdown-Model' + #name : 'MicAbstractCodeBlock', + #superclass : 'MicSameStartStopMarkupBlock', + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #public } +{ #category : 'public' } MicAbstractCodeBlock class >> alternateBlockClassFor: line [ "If there is one subclass with the corresponding tag, returns it, else resturn the current class." @@ -20,17 +22,17 @@ MicAbstractCodeBlock class >> alternateBlockClassFor: line [ ^ MicScriptBlock allSubclasses detect: [ :each | each tag = tag ] ifNone: [ MicCodeBlock ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractCodeBlock class >> defaultLanguage [ ^ 'Pharo' ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractCodeBlock >> language [ ^ arguments at: #language ] -{ #category : #utilities } +{ #category : 'utilities' } MicAbstractCodeBlock >> lineStartMarkup [ "a code block is delimited by ``` " diff --git a/src/Microdown/MicAbstractDelimiter.class.st b/src/Microdown/MicAbstractDelimiter.class.st index a011d0f0..732f1c4b 100644 --- a/src/Microdown/MicAbstractDelimiter.class.st +++ b/src/Microdown/MicAbstractDelimiter.class.st @@ -15,132 +15,134 @@ My index refers to the index character in global string which is parsed. Always instantiate me with my constructor ""index:"" to precise it. " Class { - #name : #MicAbstractDelimiter, - #superclass : #Object, + #name : 'MicAbstractDelimiter', + #superclass : 'Object', #instVars : [ 'index' ], #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Parser' + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> allActive [ ^ self allSubclasses select: [ :subclass | subclass isActive ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> associatedInlineBlock [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> associatedTypes [ ^ { self type } ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> index: anIndex [ ^ self new index: anIndex; yourself ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter class >> isActive [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter class >> isBoth [ ^ self isCloser and: self isOpener ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> isCloser [ ^ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter class >> isCloserOnly [ ^ self isCloser and: self isOpener not ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> isOpener [ ^ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter class >> isOpenerOnly [ ^ self isCloser not and: [ self isOpener ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> markup [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> size [ ^ self markup size ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter class >> type [ ^ self subclassResponsibility ] -{ #category : #dispatching } +{ #category : 'dispatching' } MicAbstractDelimiter >> addInlineBlock: anIndex to: inlineParser [ inlineParser addRegularInlineBlock: anIndex ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter >> associatedInlineBlock [ ^ self class associatedInlineBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter >> endIndex [ ^ self index - 1 ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter >> index [ ^ index ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter >> index: anInteger [ index := anInteger ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter >> isActive [ ^ self class isActive ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter >> isCloser [ ^ self class isCloser ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter >> isOpener [ ^ self class isOpener ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractDelimiter >> markup [ ^ self class markup ] -{ #category : #printing } +{ #category : 'printing' } MicAbstractDelimiter >> printOn: aStream [ | name | name := self class name. @@ -149,12 +151,12 @@ MicAbstractDelimiter >> printOn: aStream [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter >> size [ ^ self class size ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractDelimiter >> type [ ^ self class type ] diff --git a/src/Microdown/MicAbstractMicrodownTextualBuilder.class.st b/src/Microdown/MicAbstractMicrodownTextualBuilder.class.st index b4257d3a..23dadc25 100644 --- a/src/Microdown/MicAbstractMicrodownTextualBuilder.class.st +++ b/src/Microdown/MicAbstractMicrodownTextualBuilder.class.st @@ -3,8 +3,8 @@ I'm a copy of Pillar textual canvas. I should be fusioned in my subclass. We should revisit the API because parsing lines is a not really good design. " Class { - #name : #MicAbstractMicrodownTextualBuilder, - #superclass : #Object, + #name : 'MicAbstractMicrodownTextualBuilder', + #superclass : 'Object', #instVars : [ 'stream', 'lastIsNewLine', @@ -13,33 +13,35 @@ Class { #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Parser' + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicAbstractMicrodownTextualBuilder class >> on: aStream [ ^ self new setStream: aStream; yourself ] -{ #category : #formatting } +{ #category : 'formatting' } MicAbstractMicrodownTextualBuilder >> bold: aText [ self writeText: aText surroundBy: BoldMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAbstractMicrodownTextualBuilder >> contents [ ^ stream contents ] -{ #category : #initialization } +{ #category : 'initialization' } MicAbstractMicrodownTextualBuilder >> flush [ stream flush ] -{ #category : #initialization } +{ #category : 'initialization' } MicAbstractMicrodownTextualBuilder >> initialize [ super initialize. stream := (String new: 1000) writeStream. @@ -47,86 +49,86 @@ MicAbstractMicrodownTextualBuilder >> initialize [ lastIsNewLine := true ] -{ #category : #formatting } +{ #category : 'formatting' } MicAbstractMicrodownTextualBuilder >> italic: aText [ self writeText: aText surroundBy: ItalicMarkup ] -{ #category : #testing } +{ #category : 'testing' } MicAbstractMicrodownTextualBuilder >> lastIsNewLine [ ^ lastIsNewLine ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicAbstractMicrodownTextualBuilder >> line: aString [ self nextPutAll: aString; newLine ] -{ #category : #formatting } +{ #category : 'formatting' } MicAbstractMicrodownTextualBuilder >> monospace: aText [ self writeText: aText surroundBy: MonospaceMarkup ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicAbstractMicrodownTextualBuilder >> newLine [ self raw: newLineCharacterString. lastIsNewLine := true ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicAbstractMicrodownTextualBuilder >> nextPut: aCharacter [ stream nextPut: aCharacter. lastIsNewLine := false ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicAbstractMicrodownTextualBuilder >> nextPutAll: aString [ aString do: [ :char | self nextPut: char ] ] -{ #category : #'writing low-level' } +{ #category : 'writing low-level' } MicAbstractMicrodownTextualBuilder >> potentialNewLine [ lastIsNewLine ifFalse: [ self newLine ] ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicAbstractMicrodownTextualBuilder >> raw: aString [ stream << aString ] -{ #category : #initialization } +{ #category : 'initialization' } MicAbstractMicrodownTextualBuilder >> setNewLineCharacterString: aLine [ newLineCharacterString := aLine ] -{ #category : #initialization } +{ #category : 'initialization' } MicAbstractMicrodownTextualBuilder >> setStream: aStream [ stream := aStream ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicAbstractMicrodownTextualBuilder >> space [ stream space ] -{ #category : #formatting } +{ #category : 'formatting' } MicAbstractMicrodownTextualBuilder >> strike: aText [ self writeText: aText surroundBy: StrikeMarkup ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> text: aText [ self raw: aText ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeDuring: aBlock surroundBy: anOpenerMarkup and: aCloserMarkup [ self raw: anOpenerMarkup. @@ -134,7 +136,7 @@ MicAbstractMicrodownTextualBuilder >> writeDuring: aBlock surroundBy: anOpenerMa self raw: aCloserMarkup ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeLinkDuring: aBlockClosure destination: aString [ self @@ -143,7 +145,7 @@ MicAbstractMicrodownTextualBuilder >> writeLinkDuring: aBlockClosure destination title: nil ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeLinkDuring: aBlockClosure destination: aDestination title: aTitle [ self raw: '['. @@ -162,13 +164,13 @@ MicAbstractMicrodownTextualBuilder >> writeLinkDuring: aBlockClosure destination ] ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeNewLine [ self raw: String cr ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeText: aText beginsWith: aMarkup [ self raw: aMarkup; @@ -176,12 +178,12 @@ MicAbstractMicrodownTextualBuilder >> writeText: aText beginsWith: aMarkup [ raw: aText ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeText: aText surroundBy: aMarkup [ self writeText: aText surroundBy: aMarkup and: aMarkup ] -{ #category : #writing } +{ #category : 'writing' } MicAbstractMicrodownTextualBuilder >> writeText: aText surroundBy: anOpenerMarkup and: aCloserMarkup [ self raw: anOpenerMarkup; diff --git a/src/Microdown/MicAnchorBlock.class.st b/src/Microdown/MicAnchorBlock.class.st index 6766741c..fc68b98f 100644 --- a/src/Microdown/MicAnchorBlock.class.st +++ b/src/Microdown/MicAnchorBlock.class.st @@ -7,21 +7,23 @@ I'm block that represents an anchor to a section. This way text can refer to the ``` " Class { - #name : #MicAnchorBlock, - #superclass : #MicSingleLineBlock, + #name : 'MicAnchorBlock', + #superclass : 'MicSingleLineBlock', #instVars : [ 'label', 'target' ], - #category : #'Microdown-Model' + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #visiting } +{ #category : 'visiting' } MicAnchorBlock >> accept: aVisitor [ ^ aVisitor visitAnchor: self ] -{ #category : #public } +{ #category : 'public' } MicAnchorBlock >> addLineAndReturnNextNode: line [ "# bla @myanchor @@ -30,28 +32,28 @@ MicAnchorBlock >> addLineAndReturnNextNode: line [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } MicAnchorBlock >> hasLabel [ label ifNil: [ ^ false ]. ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorBlock >> label [ ^ label ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorBlock >> label: anObject [ label := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorBlock >> target [ ^ target ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorBlock >> target: aMicHeaderBlock [ target := aMicHeaderBlock ] diff --git a/src/Microdown/MicAnchorLinker.class.st b/src/Microdown/MicAnchorLinker.class.st index cd1e6796..f3a43f38 100644 --- a/src/Microdown/MicAnchorLinker.class.st +++ b/src/Microdown/MicAnchorLinker.class.st @@ -11,12 +11,14 @@ I'm usually invoked in a post parsing phase, so transparent to the user. " Class { - #name : #MicAnchorLinker, - #superclass : #MicrodownVisitor, - #category : #'Microdown-Visitor' + #name : 'MicAnchorLinker', + #superclass : 'MicrodownVisitor', + #category : 'Microdown-Visitor', + #package : 'Microdown', + #tag : 'Visitor' } -{ #category : #visiting } +{ #category : 'visiting' } MicAnchorLinker >> visitHeader: aHeader [ | siblings position potentialAnchor | diff --git a/src/Microdown/MicAnchorReferenceBlock.class.st b/src/Microdown/MicAnchorReferenceBlock.class.st index 2cdca417..e23d36f1 100644 --- a/src/Microdown/MicAnchorReferenceBlock.class.st +++ b/src/Microdown/MicAnchorReferenceBlock.class.st @@ -7,53 +7,55 @@ See *@fig1@* " Class { - #name : #MicAnchorReferenceBlock, - #superclass : #MicInlineElement, + #name : 'MicAnchorReferenceBlock', + #superclass : 'MicInlineElement', #instVars : [ 'reference' ], - #category : #'Microdown-ModelInline' + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #testing } +{ #category : 'testing' } MicAnchorReferenceBlock class >> isEvaluated [ ^ false ] -{ #category : #visiting } +{ #category : 'visiting' } MicAnchorReferenceBlock >> accept: aVisitor [ ^ aVisitor visitAnchorReference: self ] -{ #category : #visiting } +{ #category : 'visiting' } MicAnchorReferenceBlock >> closingDelimiter [ ^ AnchorReferenceCloserMarkup ] -{ #category : #initialization } +{ #category : 'initialization' } MicAnchorReferenceBlock >> kind [ ^ #anchorReference ] -{ #category : #visiting } +{ #category : 'visiting' } MicAnchorReferenceBlock >> openingDelimiter [ ^ AnchorReferenceOpenerMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceBlock >> reference [ ^ reference ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceBlock >> reference: aReference [ reference := aReference ] -{ #category : #visiting } +{ #category : 'visiting' } MicAnchorReferenceBlock >> referenceAsHTML [ | ref | self flag: #todo. diff --git a/src/Microdown/MicAnchorReferenceCloserDelimiter.class.st b/src/Microdown/MicAnchorReferenceCloserDelimiter.class.st index c6f3a332..60b82e33 100644 --- a/src/Microdown/MicAnchorReferenceCloserDelimiter.class.st +++ b/src/Microdown/MicAnchorReferenceCloserDelimiter.class.st @@ -6,32 +6,34 @@ See *@fig1@* ``` " Class { - #name : #MicAnchorReferenceCloserDelimiter, - #superclass : #MicAbstractDelimiter, - #category : #'Microdown-Parser' + #name : 'MicAnchorReferenceCloserDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceCloserDelimiter class >> associatedInlineBlock [ ^ MicAnchorReferenceBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceCloserDelimiter class >> isCloser [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceCloserDelimiter class >> isOpener [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceCloserDelimiter class >> markup [ ^ AnchorReferenceCloserMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceCloserDelimiter class >> type [ ^ #anchorReference ] diff --git a/src/Microdown/MicAnchorReferenceOpenerDelimiter.class.st b/src/Microdown/MicAnchorReferenceOpenerDelimiter.class.st index 1dff8e36..2d37e203 100644 --- a/src/Microdown/MicAnchorReferenceOpenerDelimiter.class.st +++ b/src/Microdown/MicAnchorReferenceOpenerDelimiter.class.st @@ -6,32 +6,34 @@ See *@fig1@* ``` " Class { - #name : #MicAnchorReferenceOpenerDelimiter, - #superclass : #MicAbstractDelimiter, - #category : #'Microdown-Parser' + #name : 'MicAnchorReferenceOpenerDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceOpenerDelimiter class >> associatedInlineBlock [ ^ MicAnchorReferenceBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceOpenerDelimiter class >> isCloser [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceOpenerDelimiter class >> isOpener [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceOpenerDelimiter class >> markup [ ^ AnchorReferenceOpenerMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnchorReferenceOpenerDelimiter class >> type [ ^ #anchorReference ] diff --git a/src/Microdown/MicAnnotatedBlock.class.st b/src/Microdown/MicAnnotatedBlock.class.st index 47f55cd2..557d34ac 100644 --- a/src/Microdown/MicAnnotatedBlock.class.st +++ b/src/Microdown/MicAnnotatedBlock.class.st @@ -12,35 +12,37 @@ See [https://github.com/pillar-markup/MicroDown/issues/54](https://github.com/pi " Class { - #name : #MicAnnotatedBlock, - #superclass : #MicAbstractAnnotatedBlock, - #category : #'Microdown-Model' + #name : 'MicAnnotatedBlock', + #superclass : 'MicAbstractAnnotatedBlock', + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #visiting } +{ #category : 'visiting' } MicAnnotatedBlock >> accept: aVisitor [ ^ aVisitor visitAnnotated: self ] -{ #category : #'parse support' } +{ #category : 'parse support' } MicAnnotatedBlock >> closeMe [ super closeMe. body := self inlineParse: body ] -{ #category : #testing } +{ #category : 'testing' } MicAnnotatedBlock >> lineMarkup [ ^ AnnotatedParagraphMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotatedBlock >> text [ ^ String streamContents: [ :s | self textElements do: [ :each | s nextPutAll: each substring ] ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotatedBlock >> textElements [ ^ self body diff --git a/src/Microdown/MicAnnotationBlock.class.st b/src/Microdown/MicAnnotationBlock.class.st index 9d892fec..8eb68838 100644 --- a/src/Microdown/MicAnnotationBlock.class.st +++ b/src/Microdown/MicAnnotationBlock.class.st @@ -12,15 +12,17 @@ MicroDownParser parse: '{!citation|name=Duca99a!}' ``` " Class { - #name : #MicAnnotationBlock, - #superclass : #MicInlineElement, + #name : 'MicAnnotationBlock', + #superclass : 'MicInlineElement', #instVars : [ 'arguments' ], - #category : #'Microdown-ModelInline' + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #documentation } +{ #category : 'documentation' } MicAnnotationBlock class >> addDocumentDefinedAnnotations: aBuilder [ | currentDefinedTags | currentDefinedTags := self allSubclasses collect: [ :subclass | subclass tag -> subclass name]. @@ -38,14 +40,14 @@ MicAnnotationBlock class >> addDocumentDefinedAnnotations: aBuilder [ ] ] -{ #category : #documentation } +{ #category : 'documentation' } MicAnnotationBlock class >> buildMicroDownUsing: aBuilder withComment: aString [ super buildMicroDownUsing: aBuilder withComment: aString. self addDocumentDefinedAnnotations: aBuilder ] -{ #category : #constructor } +{ #category : 'constructor' } MicAnnotationBlock class >> from: aStartInteger to: anEndInteger withSubstring: aString withChildren: aChildren [ | splitter tag extensionClass | @@ -68,56 +70,56 @@ MicAnnotationBlock class >> from: aStartInteger to: anEndInteger withSubstring: yourself ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock class >> tag [ ^ #empty ] -{ #category : #visiting } +{ #category : 'visiting' } MicAnnotationBlock >> accept: aVisitor [ ^ aVisitor visitAnnotation: self ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> arguments [ ^ arguments ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> arguments: anArguments [ arguments := anArguments ] -{ #category : #visiting } +{ #category : 'visiting' } MicAnnotationBlock >> closeMe [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> closingDelimiter [ ^ AnnotationCloserMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> kind [ ^ #annotation ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> name [ ^ arguments defaultValue ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> openingDelimiter [ ^ AnnotationOpenerMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationBlock >> printOn: aStream [ aStream nextPutAll: self openingDelimiter. diff --git a/src/Microdown/MicAnnotationCloserDelimiter.class.st b/src/Microdown/MicAnnotationCloserDelimiter.class.st index d535b42d..739dc685 100644 --- a/src/Microdown/MicAnnotationCloserDelimiter.class.st +++ b/src/Microdown/MicAnnotationCloserDelimiter.class.st @@ -6,33 +6,35 @@ See *@fig1* ``` " Class { - #name : #MicAnnotationCloserDelimiter, - #superclass : #MicAbstractDelimiter, - #category : #'Microdown-Parser' + #name : 'MicAnnotationCloserDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationCloserDelimiter class >> associatedInlineBlock [ ^ MicAnnotationBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationCloserDelimiter class >> isCloser [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationCloserDelimiter class >> isOpener [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationCloserDelimiter class >> markup [ ^ AnnotationCloserMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationCloserDelimiter class >> type [ ^ #annotation ] diff --git a/src/Microdown/MicAnnotationOpenerDelimiter.class.st b/src/Microdown/MicAnnotationOpenerDelimiter.class.st index 73ad5381..a54acd33 100644 --- a/src/Microdown/MicAnnotationOpenerDelimiter.class.st +++ b/src/Microdown/MicAnnotationOpenerDelimiter.class.st @@ -1,31 +1,33 @@ Class { - #name : #MicAnnotationOpenerDelimiter, - #superclass : #MicAbstractDelimiter, - #category : #'Microdown-Parser' + #name : 'MicAnnotationOpenerDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationOpenerDelimiter class >> associatedInlineBlock [ ^ MicAnnotationBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationOpenerDelimiter class >> isCloser [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationOpenerDelimiter class >> isOpener [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationOpenerDelimiter class >> markup [ ^ AnnotationOpenerMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicAnnotationOpenerDelimiter class >> type [ ^ #annotation ] diff --git a/src/Microdown/MicArgumentList.class.st b/src/Microdown/MicArgumentList.class.st index 7f94a8f8..e996e96d 100644 --- a/src/Microdown/MicArgumentList.class.st +++ b/src/Microdown/MicArgumentList.class.st @@ -9,23 +9,25 @@ My syntax is of the following form: - `value|key=arg[&key=arg]*` defaultArg->value, and arguments. " Class { - #name : #MicArgumentList, - #superclass : #OrderedDictionary, + #name : 'MicArgumentList', + #superclass : 'OrderedDictionary', #instVars : [ 'defaultArg', 'initialValue' ], - #category : #'Microdown-Parser' + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicArgumentList class >> split: aString [ ^ self new from: aString; yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicArgumentList class >> split: aString defaultArg: defArg [ ^ self new defaultArg: defArg; @@ -33,7 +35,7 @@ MicArgumentList class >> split: aString defaultArg: defArg [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicArgumentList class >> split: aString defaultArg: defArg defaultValue: defValue [ ^ self new defaultArg: defArg; @@ -43,34 +45,34 @@ MicArgumentList class >> split: aString defaultArg: defArg defaultValue: defValu yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicArgumentList class >> withStream: aStream [ ^ self split: aStream contents. ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicArgumentList class >> withString: aString [ ^ self split: aString ] -{ #category : #accessing } +{ #category : 'accessing' } MicArgumentList >> defaultArg [ ^ defaultArg ifNil: [ defaultArg := #defaultArg ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicArgumentList >> defaultArg: anObject [ defaultArg := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicArgumentList >> defaultValue [ ^ self at: defaultArg ifAbsent: [ initialValue ] ] -{ #category : #initialization } +{ #category : 'initialization' } MicArgumentList >> from: fullString [ "I am the 'parser' of the argument splitter" | barSplit | @@ -84,33 +86,33 @@ MicArgumentList >> from: fullString [ ] -{ #category : #testing } +{ #category : 'testing' } MicArgumentList >> hasNonDefaultArguments [ "has changed #defaultArg or has other keys" ^ self hasNonDefaultValue or: [ (self keys copyWithout: self defaultArg ) notEmpty ] ] -{ #category : #testing } +{ #category : 'testing' } MicArgumentList >> hasNonDefaultValue [ "return true if the default arg was given a value" ^ self defaultValue notNil and: [ self defaultValue ~= initialValue ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicArgumentList >> initialValue: anObject [ initialValue := anObject ] -{ #category : #copying } +{ #category : 'copying' } MicArgumentList >> justTheArguments [ ^ self copy removeKey: defaultArg ifAbsent: [ ]; yourself ] -{ #category : #printing } +{ #category : 'printing' } MicArgumentList >> printOn: aStream [ |argKeys| self hasNonDefaultValue @@ -122,12 +124,12 @@ MicArgumentList >> printOn: aStream [ aStream nextPutAll: ((argKeys collect: [:k| k,'=',(self at:k)]) joinUsing: '&') ] -{ #category : #printing } +{ #category : 'printing' } MicArgumentList >> printString [ ^ String streamContents: [ :stream | self printOn: stream ] ] -{ #category : #parsing } +{ #category : 'parsing' } MicArgumentList >> setDefaultAndArguments: barSplit [ "barSplit is two strings, first assumed to be just a value, second to be arguments" |value| @@ -136,7 +138,7 @@ MicArgumentList >> setDefaultAndArguments: barSplit [ self setNoDefaultButArguments: barSplit second ] -{ #category : #parsing } +{ #category : 'parsing' } MicArgumentList >> setDefaultNoArguments: fullString [ "fullstring is just a name (containing no arguments) It is interpreted as both a name, and as an argument with no value" @@ -145,7 +147,7 @@ MicArgumentList >> setDefaultNoArguments: fullString [ self at: self defaultArg put: value ] -{ #category : #parsing } +{ #category : 'parsing' } MicArgumentList >> setNoDefaultButArguments: string [ "string is assumed to be on the form key=value&key=value" | pairs | @@ -156,7 +158,7 @@ MicArgumentList >> setNoDefaultButArguments: string [ ] -{ #category : #copying } +{ #category : 'copying' } MicArgumentList >> withoutDefaultValue [ "remove the defaultArg if no new value was assigned to it" ^ self hasNonDefaultValue diff --git a/src/Microdown/MicBoldDelimiter.class.st b/src/Microdown/MicBoldDelimiter.class.st index ba227ed9..61248abd 100644 --- a/src/Microdown/MicBoldDelimiter.class.st +++ b/src/Microdown/MicBoldDelimiter.class.st @@ -2,32 +2,34 @@ I am the delimiter for bold/strong format. " Class { - #name : #MicBoldDelimiter, - #superclass : #MicAbstractDelimiter, - #category : #'Microdown-Parser' + #name : 'MicBoldDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicBoldDelimiter class >> associatedInlineBlock [ ^ MicBoldFormatBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicBoldDelimiter class >> isCloser [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicBoldDelimiter class >> isOpener [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicBoldDelimiter class >> markup [ ^ BoldMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicBoldDelimiter class >> type [ ^ #bold ] diff --git a/src/Microdown/MicBoldFormatBlock.class.st b/src/Microdown/MicBoldFormatBlock.class.st index b11c9339..d9a7e25a 100644 --- a/src/Microdown/MicBoldFormatBlock.class.st +++ b/src/Microdown/MicBoldFormatBlock.class.st @@ -2,28 +2,30 @@ I represent a bold text section. I'm delimited using `**` as in `**bold**` to obtain **bold**. " Class { - #name : #MicBoldFormatBlock, - #superclass : #MicFormatBlock, - #category : #'Microdown-ModelInline' + #name : 'MicBoldFormatBlock', + #superclass : 'MicFormatBlock', + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #utilities } +{ #category : 'utilities' } MicBoldFormatBlock >> accept: aVisitor [ ^ aVisitor visitBold: self ] -{ #category : #utilities } +{ #category : 'utilities' } MicBoldFormatBlock >> closingDelimiter [ ^ BoldMarkup ] -{ #category : #utilities } +{ #category : 'utilities' } MicBoldFormatBlock >> kind [ ^ #bold ] -{ #category : #utilities } +{ #category : 'utilities' } MicBoldFormatBlock >> openingDelimiter [ ^ BoldMarkup diff --git a/src/Microdown/MicCitationBlock.class.st b/src/Microdown/MicCitationBlock.class.st index 90640f6d..e17e9fb3 100644 --- a/src/Microdown/MicCitationBlock.class.st +++ b/src/Microdown/MicCitationBlock.class.st @@ -8,23 +8,25 @@ this is a text with a {!citation|ref=Duca99a!} " Class { - #name : #MicCitationBlock, - #superclass : #MicAnnotationBlock, - #category : #'Microdown-Extensions' + #name : 'MicCitationBlock', + #superclass : 'MicAnnotationBlock', + #category : 'Microdown-Extensions', + #package : 'Microdown', + #tag : 'Extensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicCitationBlock class >> tag [ ^ #citation ] -{ #category : #visiting } +{ #category : 'visiting' } MicCitationBlock >> accept: aVisitor [ aVisitor visitCitation: self ] -{ #category : #accessing } +{ #category : 'accessing' } MicCitationBlock >> ref [ ^ arguments at: 'ref' ifAbsent: [ '' ] ] diff --git a/src/Microdown/MicCodeBlock.class.st b/src/Microdown/MicCodeBlock.class.st index 4ae50072..b4a65e0c 100644 --- a/src/Microdown/MicCodeBlock.class.st +++ b/src/Microdown/MicCodeBlock.class.st @@ -36,17 +36,19 @@ The current implementation stores lines in a single text and this is a bad idea Second if we want to treat lines separatedly we have to reparse it. Now we do not need it so this is good but this is just by chance! " Class { - #name : #MicCodeBlock, - #superclass : #MicAbstractCodeBlock, - #category : #'Microdown-Model' + #name : 'MicCodeBlock', + #superclass : 'MicAbstractCodeBlock', + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #visiting } +{ #category : 'visiting' } MicCodeBlock >> accept: aVisitor [ ^ aVisitor visitCode: self ] -{ #category : #public } +{ #category : 'public' } MicCodeBlock >> closeMe [ "adjust prefix tabs based on first line I am allowing the codeblock itself to be indented in the input, see motivation in Microdown issue: 543" @@ -59,12 +61,12 @@ MicCodeBlock >> closeMe [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicCodeBlock >> code [ ^ self body ] -{ #category : #handle } +{ #category : 'handle' } MicCodeBlock >> extractFirstLineFrom: aLine [ "language=Pharo&label=fig1&caption=La vie est belle" "The first tag is language. @@ -79,50 +81,50 @@ MicCodeBlock >> extractFirstLineFrom: aLine [ ^ lineWithoutMarkup ] -{ #category : #testing } +{ #category : 'testing' } MicCodeBlock >> hasBody [ ^ body isNotEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } MicCodeBlock >> hasLabel [ ^ arguments includesKey: #label ] -{ #category : #testing } +{ #category : 'testing' } MicCodeBlock >> hasNonDefaultArguments [ ^ arguments hasNonDefaultArguments ] -{ #category : #accessing } +{ #category : 'accessing' } MicCodeBlock >> hasNonDefaultLanguage [ "is the language defined explicitly" ^ arguments hasNonDefaultValue ] -{ #category : #initialization } +{ #category : 'initialization' } MicCodeBlock >> initialize [ super initialize. arguments := OrderedDictionary new. ] -{ #category : #accessing } +{ #category : 'accessing' } MicCodeBlock >> label [ "precondition: receiver hasLabel" ^ arguments at: #label ] -{ #category : #accessing } +{ #category : 'accessing' } MicCodeBlock >> label: aString [ self arguments at: #label put: aString ] -{ #category : #accessing } +{ #category : 'accessing' } MicCodeBlock >> size [ "precondition: receiver hasLabel" diff --git a/src/Microdown/MicColumnBlock.class.st b/src/Microdown/MicColumnBlock.class.st index fadd6bfd..364d87fc 100644 --- a/src/Microdown/MicColumnBlock.class.st +++ b/src/Microdown/MicColumnBlock.class.st @@ -12,27 +12,29 @@ I'm a bloc element that represents a column. I have one optional argument that i ``` " Class { - #name : #MicColumnBlock, - #superclass : #MicEnvironmentBlock, - #category : #'Microdown-Extensions' + #name : 'MicColumnBlock', + #superclass : 'MicEnvironmentBlock', + #category : 'Microdown-Extensions', + #package : 'Microdown', + #tag : 'Extensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicColumnBlock class >> tag [ ^ #column ] -{ #category : #accessing } +{ #category : 'accessing' } MicColumnBlock >> accept: aVisitor [ ^ aVisitor visitColumn: self ] -{ #category : #accessing } +{ #category : 'accessing' } MicColumnBlock >> width [ ^ arguments at: #width ] -{ #category : #accessing } +{ #category : 'accessing' } MicColumnBlock >> width: anObject [ arguments at: #width put: anObject ] diff --git a/src/Microdown/MicColumnsBlock.class.st b/src/Microdown/MicColumnsBlock.class.st index c409da7f..dde952fd 100644 --- a/src/Microdown/MicColumnsBlock.class.st +++ b/src/Microdown/MicColumnsBlock.class.st @@ -33,17 +33,19 @@ Note that a column can have also a width. ``` " Class { - #name : #MicColumnsBlock, - #superclass : #MicEnvironmentBlock, - #category : #'Microdown-Extensions' + #name : 'MicColumnsBlock', + #superclass : 'MicEnvironmentBlock', + #category : 'Microdown-Extensions', + #package : 'Microdown', + #tag : 'Extensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicColumnsBlock class >> tag [ ^ #columns ] -{ #category : #visiting } +{ #category : 'visiting' } MicColumnsBlock >> accept: aVisitor [ ^ aVisitor visitColumns: self ] diff --git a/src/Microdown/MicCommentBlock.class.st b/src/Microdown/MicCommentBlock.class.st index 2a172481..7f051091 100644 --- a/src/Microdown/MicCommentBlock.class.st +++ b/src/Microdown/MicCommentBlock.class.st @@ -6,17 +6,19 @@ Each line to be commented should start with %. I should be a subclass of SingleLineBlock and not continuousMarkedBlock. " Class { - #name : #MicCommentBlock, - #superclass : #MicContinuousMarkedBlock, - #category : #'Microdown-Model' + #name : 'MicCommentBlock', + #superclass : 'MicContinuousMarkedBlock', + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #visiting } +{ #category : 'visiting' } MicCommentBlock >> accept: aVisitor [ ^ aVisitor visitComment: self ] -{ #category : #markups } +{ #category : 'markups' } MicCommentBlock >> lineMarkup [ ^ CommentedLineMarkup diff --git a/src/Microdown/MicContinuousMarkedBlock.class.st b/src/Microdown/MicContinuousMarkedBlock.class.st index 892e8010..15259e33 100644 --- a/src/Microdown/MicContinuousMarkedBlock.class.st +++ b/src/Microdown/MicContinuousMarkedBlock.class.st @@ -30,15 +30,17 @@ produces " Class { - #name : #MicContinuousMarkedBlock, - #superclass : #MicAbstractBlock, + #name : 'MicContinuousMarkedBlock', + #superclass : 'MicAbstractBlock', #instVars : [ 'text' ], - #category : #'Microdown-Model' + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #actions } +{ #category : 'actions' } MicContinuousMarkedBlock >> addLineAndReturnNextNode: line [ "line is assumed to be of the form 'chararacters some text' e.g., '> some text' the prefix spaces after $> are removed" @@ -50,14 +52,14 @@ MicContinuousMarkedBlock >> addLineAndReturnNextNode: line [ ifNotNil: [ text , String cr , treatedLine ] ] -{ #category : #testing } +{ #category : 'testing' } MicContinuousMarkedBlock >> canConsumeLine: line [ "return if this block can consume line i.e., it starts with sensible characters, e.g., > " ^ self doesLineStartWithMarkup: line ] -{ #category : #testing } +{ #category : 'testing' } MicContinuousMarkedBlock >> doesLineStartWithMarkup: line [ "return if the line starts with a markup" @@ -65,23 +67,23 @@ MicContinuousMarkedBlock >> doesLineStartWithMarkup: line [ ] -{ #category : #actions } +{ #category : 'actions' } MicContinuousMarkedBlock >> extractLine: line [ ^ (line copyFrom: self lineMarkup size + 1 to: line size) trim ] -{ #category : #markups } +{ #category : 'markups' } MicContinuousMarkedBlock >> lineMarkup [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } MicContinuousMarkedBlock >> text [ ^ text ] -{ #category : #accessing } +{ #category : 'accessing' } MicContinuousMarkedBlock >> text: aString [ text := aString ] diff --git a/src/Microdown/MicDocumentListBlock.class.st b/src/Microdown/MicDocumentListBlock.class.st index c56dbf8d..6874482b 100644 --- a/src/Microdown/MicDocumentListBlock.class.st +++ b/src/Microdown/MicDocumentListBlock.class.st @@ -1,39 +1,41 @@ Class { - #name : #MicDocumentListBlock, - #superclass : #MicAnnotationBlock, - #category : #'Microdown-Extensions' + #name : 'MicDocumentListBlock', + #superclass : 'MicAnnotationBlock', + #category : 'Microdown-Extensions', + #package : 'Microdown', + #tag : 'Extensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentListBlock class >> tag [ ^ #documentlist ] -{ #category : #visiting } +{ #category : 'visiting' } MicDocumentListBlock >> accept: aVisitor [ "^ aVisitor visitDocListAnnotation: self" ] -{ #category : #visiting } +{ #category : 'visiting' } MicDocumentListBlock >> limit [ ^ self arguments at: #limit ifAbsent: [ '3' ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicDocumentListBlock >> path [ ^ self arguments at: #path ] -{ #category : #visiting } +{ #category : 'visiting' } MicDocumentListBlock >> sort [ ^ self arguments at: #sort ifAbsent: [ '' ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicDocumentListBlock >> summaryMaxSize [ ^ self arguments at: #summaryMaxSize @@ -41,7 +43,7 @@ MicDocumentListBlock >> summaryMaxSize [ ifAbsent: [ 500 ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicDocumentListBlock >> templates [ ^ self arguments at: #templates ifAbsent: [ #() ] diff --git a/src/Microdown/MicElement.class.st b/src/Microdown/MicElement.class.st index 0c2c2440..78d11f90 100644 --- a/src/Microdown/MicElement.class.st +++ b/src/Microdown/MicElement.class.st @@ -1,6 +1,6 @@ Class { - #name : #MicElement, - #superclass : #Object, + #name : 'MicElement', + #superclass : 'Object', #instVars : [ 'parent', 'properties' @@ -8,10 +8,12 @@ Class { #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Model' + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #documentation } +{ #category : 'documentation' } MicElement class >> buildMicroDownUsing: aBuilder withComment: aComment [ | visitSelector visitors | super buildMicroDownUsing: aBuilder withComment: aComment. @@ -33,18 +35,18 @@ MicElement class >> buildMicroDownUsing: aBuilder withComment: aComment [ visitors do: [:class | aBuilder item: [ aBuilder monospace: (class name, '>>#', visitSelector ) ]]]] ] -{ #category : #utilities } +{ #category : 'utilities' } MicElement class >> extensionClassFor: tag [ "I am a utility method used in extension blocks to find the right subclass to instantiate" ^ self allSubclasses detect: [ :each | each tag = tag ] ifNone: [ self ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicElement >> accept: aVisitor [ self subclassResponsibility ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> hasProperty: aKey [ "Answer whether there is a property named aKey." @@ -52,7 +54,7 @@ MicElement >> hasProperty: aKey [ ^ properties includesKey: aKey ] -{ #category : #public } +{ #category : 'public' } MicElement >> inlineParse: aString [ | inlineParser inlinedChildren | @@ -64,48 +66,48 @@ MicElement >> inlineParse: aString [ ] -{ #category : #private } +{ #category : 'private' } MicElement >> inlineParserClass [ ^ MicInlineParser ] -{ #category : #private } +{ #category : 'private' } MicElement >> newInlineParser [ ^ self inlineParserClass new ] -{ #category : #accessing } +{ #category : 'accessing' } MicElement >> parent [ ^ parent ] -{ #category : #accessing } +{ #category : 'accessing' } MicElement >> parent: aBlock [ parent := aBlock. aBlock addChild: self ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> properties [ ^ properties ifNil: [ properties := Dictionary new ] ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> propertiesCopy [ self properties ifNil: [ ^ nil ]. ^ self properties collect: [ :each | each copy ] ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> propertyAt: aKey [ "Answer the property value associated with aKey." ^ self propertyAt: aKey ifAbsent: [ MicPropertyError signal: 'Property not found' ] ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> propertyAt: aKey ifAbsent: aBlock [ "Answer the property value associated with aKey or, if aKey isn't found, answer the result of evaluating aBlock." @@ -114,28 +116,28 @@ MicElement >> propertyAt: aKey ifAbsent: aBlock [ ifFalse: [ self properties at: aKey ifAbsent: aBlock ] ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> propertyAt: aKey ifAbsentPut: aBlock [ "Answer the property associated with aKey or, if aKey isn't found store the result of evaluating aBlock as new value." ^ self propertyAt: aKey ifAbsent: [ self propertyAt: aKey put: aBlock value ] ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> propertyAt: aKey put: anObject [ "Set the property at aKey to be anObject. If aKey is not found, create a new entry for aKey and set is value to anObject. Answer anObject." ^ self properties at: aKey put: anObject ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> removeProperty: aKey [ "Remove the property with aKey. Answer the property or raise an error if aKey isn't found." ^ self removeProperty: aKey ifAbsent: [ MicPropertyError signal: 'Property not found' ] ] -{ #category : #properties } +{ #category : 'properties' } MicElement >> removeProperty: aKey ifAbsent: aBlock [ "Remove the property with aKey. Answer the value or, if aKey isn't found, answer the result of evaluating aBlock." @@ -146,7 +148,7 @@ MicElement >> removeProperty: aKey ifAbsent: aBlock [ ^ answer ] -{ #category : #public } +{ #category : 'public' } MicElement >> resolveFrom: aBase [ Microdown resolveDocument: self withBase: aBase ] diff --git a/src/Microdown/MicEnvironmentBlock.class.st b/src/Microdown/MicEnvironmentBlock.class.st index 5bf861f2..1cb64811 100644 --- a/src/Microdown/MicEnvironmentBlock.class.st +++ b/src/Microdown/MicEnvironmentBlock.class.st @@ -43,15 +43,17 @@ This is important to support better column in the future: " Class { - #name : #MicEnvironmentBlock, - #superclass : #MicStartStopMarkupBlock, + #name : 'MicEnvironmentBlock', + #superclass : 'MicStartStopMarkupBlock', #instVars : [ 'arguments' ], - #category : #'Microdown-Model' + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #documentation } +{ #category : 'documentation' } MicEnvironmentBlock class >> addDocumentDefinedEnvironments: aBuilder [ | currentDefinedTags | currentDefinedTags := self allSubclasses collect: [ :subclass | subclass tag -> subclass name]. @@ -68,7 +70,7 @@ MicEnvironmentBlock class >> addDocumentDefinedEnvironments: aBuilder [ ] ] -{ #category : #public } +{ #category : 'public' } MicEnvironmentBlock class >> alternateBlockClassFor: line [ "If there is one subclass with the corresponding tag, returns it, else resturn the current class." @@ -81,19 +83,19 @@ MicEnvironmentBlock class >> alternateBlockClassFor: line [ ^ self extensionClassFor: tag ] -{ #category : #documentation } +{ #category : 'documentation' } MicEnvironmentBlock class >> buildMicroDownUsing: aBuilder withComment: aString [ super buildMicroDownUsing: aBuilder withComment: aString. self addDocumentDefinedEnvironments: aBuilder ] -{ #category : #visiting } +{ #category : 'visiting' } MicEnvironmentBlock >> accept: aVisitor [ ^ aVisitor visitEnvironment: self ] -{ #category : #handle } +{ #category : 'handle' } MicEnvironmentBlock >> addLineAndReturnNextNode: line [ "add line to this node. Notice, the action is allowed to create new nodes in the block tree. @@ -111,25 +113,25 @@ MicEnvironmentBlock >> addLineAndReturnNextNode: line [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } MicEnvironmentBlock >> arguments [ ^ arguments ] -{ #category : #'parse support' } +{ #category : 'parse support' } MicEnvironmentBlock >> body [ ^ String streamContents: [:s | self bodyElements do: [ :each | s nextPutAll: each substring ] ] ] -{ #category : #'parse support' } +{ #category : 'parse support' } MicEnvironmentBlock >> bodyElements [ ^ children ] -{ #category : #'parse support' } +{ #category : 'parse support' } MicEnvironmentBlock >> bodyFromLine: line [ | newBlock | @@ -138,7 +140,7 @@ MicEnvironmentBlock >> bodyFromLine: line [ ^ newBlock ] -{ #category : #'parse support' } +{ #category : 'parse support' } MicEnvironmentBlock >> closeMe [ "this is a temporary solution because normally the parser should populate body with MicBlocks. @@ -153,12 +155,12 @@ MicEnvironmentBlock >> closeMe [ defaultValue: ''. ] -{ #category : #accessing } +{ #category : 'accessing' } MicEnvironmentBlock >> environmentName [ ^ arguments at: #environmentName ] -{ #category : #accessing } +{ #category : 'accessing' } MicEnvironmentBlock >> extractFirstLineFrom: aLine [ "we got foo bar or > extractFirstLineFrom: aLine [ ifFalse: [ firstLine ] ] -{ #category : #markups } +{ #category : 'markups' } MicEnvironmentBlock >> lineStartMarkup [ ^ EnvironmentOpeningBlockMarkup ] -{ #category : #markups } +{ #category : 'markups' } MicEnvironmentBlock >> lineStopMarkup [ ^ EnvironmentClosingBlockMarkup diff --git a/src/Microdown/MicFigureBlock.class.st b/src/Microdown/MicFigureBlock.class.st index 0367817e..c6e499b4 100644 --- a/src/Microdown/MicFigureBlock.class.st +++ b/src/Microdown/MicFigureBlock.class.st @@ -11,34 +11,36 @@ I have a resources, i.e. an object referencing either a file (in relative or abs What is important to see is that there is a space between the url arguments and microdown arguments. " Class { - #name : #MicFigureBlock, - #superclass : #MicInlineBlockWithUrl, - #category : #'Microdown-ModelInline' + #name : 'MicFigureBlock', + #superclass : 'MicInlineBlockWithUrl', + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #converting } +{ #category : 'converting' } MicFigureBlock >> accept: aVisitor [ ^ aVisitor visitFigure: self ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureBlock >> alt [ ^ self arguments at: #alt ifAbsent: [''] ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureBlock >> alt: aString [ self arguments at: #alt put: aString ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureBlock >> anchor [ ^ self arguments at: #anchor ifAbsent: [ nil ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicFigureBlock >> closeMe [ "the link url - ![alt text](url) - url is allowed to have title in quotes (url ""title"") " @@ -53,7 +55,7 @@ MicFigureBlock >> closeMe [ self children: captionElements ] -{ #category : #'to be removed' } +{ #category : 'to be removed' } MicFigureBlock >> figurePath [ "this is a hack waiting for the resolution of resource references" "when we have file://figures/foo.png we want to have figures/foo.png " @@ -65,50 +67,50 @@ MicFigureBlock >> figurePath [ ] -{ #category : #printing } +{ #category : 'printing' } MicFigureBlock >> fullName [ ^ reference fullName ] -{ #category : #testing } +{ #category : 'testing' } MicFigureBlock >> hasAnchor [ ^ self anchor isNotNil ] -{ #category : #testing } +{ #category : 'testing' } MicFigureBlock >> hasCaption [ ^ captionElements notNil ] -{ #category : #testing } +{ #category : 'testing' } MicFigureBlock >> hasChildren [ ^ self children notEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureBlock >> kind [ self flag: #todo. "remove me" ^ #figure ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureBlock >> openingDelimiter [ ^ FigureNameOpenerMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureBlock >> originUrl [ ^ self properties at: #originUrl ifAbsent: [ url ] ] -{ #category : #printing } +{ #category : 'printing' } MicFigureBlock >> printOn: aStream [ aStream nextPut: $!; nextPut: $[; diff --git a/src/Microdown/MicFigureNameOpenerDelimiter.class.st b/src/Microdown/MicFigureNameOpenerDelimiter.class.st index 8dca9a40..bd3bb3f1 100644 --- a/src/Microdown/MicFigureNameOpenerDelimiter.class.st +++ b/src/Microdown/MicFigureNameOpenerDelimiter.class.st @@ -2,17 +2,19 @@ I am the opener delimiter for figure name. " Class { - #name : #MicFigureNameOpenerDelimiter, - #superclass : #MicAbstractDelimiter, - #category : #'Microdown-Parser' + #name : 'MicFigureNameOpenerDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicFigureNameOpenerDelimiter class >> associatedInlineBlock [ ^ MicFigureBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureNameOpenerDelimiter class >> associatedTypes [ ^ { @@ -21,27 +23,27 @@ MicFigureNameOpenerDelimiter class >> associatedTypes [ } ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureNameOpenerDelimiter class >> isCloser [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureNameOpenerDelimiter class >> isOpener [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureNameOpenerDelimiter class >> markup [ ^ FigureNameOpenerMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicFigureNameOpenerDelimiter class >> type [ ^ #figure ] -{ #category : #dispatching } +{ #category : 'dispatching' } MicFigureNameOpenerDelimiter >> addInlineBlock: anIndex to: inlineParser [ inlineParser linkOrFigureProcess: anIndex diff --git a/src/Microdown/MicFileResourceReference.class.st b/src/Microdown/MicFileResourceReference.class.st index 791fcac6..35b44f03 100644 --- a/src/Microdown/MicFileResourceReference.class.st +++ b/src/Microdown/MicFileResourceReference.class.st @@ -17,15 +17,17 @@ You can get an instance of me from a pharo `FileReference` using `MicFileResourc The test class `MicFileResourceTest` has two tests `testLoadImage` and `testLoadMicrodown` which show how to use me. " Class { - #name : #MicFileResourceReference, - #superclass : #MicAbsoluteResourceReference, + #name : 'MicFileResourceReference', + #superclass : 'MicAbsoluteResourceReference', #instVars : [ 'filesystem' ], - #category : #'Microdown-Core' + #category : 'Microdown-Core', + #package : 'Microdown', + #tag : 'Core' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicFileResourceReference class >> fromFileRef: aFileReference [ "return an instance of me which references aFileReference" | znUrl | @@ -37,12 +39,12 @@ MicFileResourceReference class >> fromFileRef: aFileReference [ filesystem: aFileReference fileSystem ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicFileResourceReference class >> handlesUriScheme: scheme [ ^ scheme = 'file' ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> binaryReadStream [ [^ self fileReference binaryReadStream] on: FileDoesNotExistException @@ -50,13 +52,13 @@ MicFileResourceReference >> binaryReadStream [ error resignalAs: (MicResourceReferenceError new messageText: 'Microdown file not found') ] ] -{ #category : #testing } +{ #category : 'testing' } MicFileResourceReference >> canSave [ "return true if I implement contents: " ^true ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> contents [ [^ self fileReference isDirectory ifTrue: [''] ifFalse: [self fileReference contents] ] on: FileDoesNotExistException @@ -64,7 +66,7 @@ MicFileResourceReference >> contents [ error resignalAs: (MicResourceReferenceError new messageText: 'Microdown file not found') ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> contents: aString [ "write the contents of a string to my file" |fileRef| @@ -73,44 +75,44 @@ MicFileResourceReference >> contents: aString [ self fileReference writeStreamDo: [ :stream | stream nextPutAll: aString ]. ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> fileReference [ ^ self filesystem referenceTo: self path ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> filesystem [ ^ filesystem ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> filesystem: anObject [ filesystem := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> fullName [ ^ self path ] -{ #category : #initialization } +{ #category : 'initialization' } MicFileResourceReference >> initialize [ super initialize. filesystem := FileSystem disk. ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> isDirectory [ ^ self fileReference isDirectory ] -{ #category : #testing } +{ #category : 'testing' } MicFileResourceReference >> isMicrodownResourceFileReference [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicFileResourceReference >> loadChildren [ "return a collection of MifResourceReferences if I am a directory, empty if I am not a directory" self isDirectory ifFalse: [ ^ #() ]. diff --git a/src/Microdown/MicFootnoteBlock.class.st b/src/Microdown/MicFootnoteBlock.class.st index 037c454b..77d9ba96 100644 --- a/src/Microdown/MicFootnoteBlock.class.st +++ b/src/Microdown/MicFootnoteBlock.class.st @@ -4,23 +4,25 @@ I'm an inline element that represents a footnote as in LaTeX for example. The bi this is a text with a `{!footnote|note=Here is a nice footenote.!}` " Class { - #name : #MicFootnoteBlock, - #superclass : #MicAnnotationBlock, - #category : #'Microdown-Extensions' + #name : 'MicFootnoteBlock', + #superclass : 'MicAnnotationBlock', + #category : 'Microdown-Extensions', + #package : 'Microdown', + #tag : 'Extensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicFootnoteBlock class >> tag [ ^ #footnote ] -{ #category : #visiting } +{ #category : 'visiting' } MicFootnoteBlock >> accept: aVisitor [ aVisitor visitFootnote: self ] -{ #category : #accessing } +{ #category : 'accessing' } MicFootnoteBlock >> note [ arguments ifNotEmpty: [ ^ arguments at: #note ifAbsent: [ '' ] ] diff --git a/src/Microdown/MicFormatBlock.class.st b/src/Microdown/MicFormatBlock.class.st index 9276f465..d73a6f3f 100644 --- a/src/Microdown/MicFormatBlock.class.st +++ b/src/Microdown/MicFormatBlock.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicFormatBlock, - #superclass : #MicInlineElement, - #category : #'Microdown-ModelInline' + #name : 'MicFormatBlock', + #superclass : 'MicInlineElement', + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #visiting } +{ #category : 'visiting' } MicFormatBlock >> closeMe [ | text | @@ -18,7 +20,7 @@ MicFormatBlock >> closeMe [ self children: { text } ] ] -{ #category : #printing } +{ #category : 'printing' } MicFormatBlock >> printOn: aStream [ self printWithoutConventions: aStream. @@ -28,33 +30,33 @@ MicFormatBlock >> printOn: aStream [ aStream nextPut: $) ] -{ #category : #accessing } +{ #category : 'accessing' } MicFormatBlock >> text [ ^ String streamContents: [:st | self wrappedElements do: [ :each | st nextPutAll: each text ]] ] -{ #category : #accessing } +{ #category : 'accessing' } MicFormatBlock >> textElement [ ^ children first ] -{ #category : #accessing } +{ #category : 'accessing' } MicFormatBlock >> textElement: aMicTextBlock [ children := { aMicTextBlock } ] -{ #category : #accessing } +{ #category : 'accessing' } MicFormatBlock >> textElements [ ^ children ] -{ #category : #accessing } +{ #category : 'accessing' } MicFormatBlock >> textElements: aCollection [ children := aCollection ] -{ #category : #accessing } +{ #category : 'accessing' } MicFormatBlock >> wrappedElements [ ^ children ] diff --git a/src/Microdown/MicHTTPResourceReference.class.st b/src/Microdown/MicHTTPResourceReference.class.st index b09aa2a0..c53383bc 100644 --- a/src/Microdown/MicHTTPResourceReference.class.st +++ b/src/Microdown/MicHTTPResourceReference.class.st @@ -4,15 +4,17 @@ I am a http reference encapsulating a http uri (`http//host/path/to/some/file.md " Class { - #name : #MicHTTPResourceReference, - #superclass : #MicAbsoluteResourceReference, + #name : 'MicHTTPResourceReference', + #superclass : 'MicAbsoluteResourceReference', #classVars : [ 'ResourcesCache' ], - #category : #'Microdown-Core' + #category : 'Microdown-Core', + #package : 'Microdown', + #tag : 'Core' } -{ #category : #private } +{ #category : 'private' } MicHTTPResourceReference class >> bytesForUrl: url [ "I do the offline and isCachingResources logic In particular notice that #getBytesByHttp: throws an @@ -27,7 +29,7 @@ MicHTTPResourceReference class >> bytesForUrl: url [ ifFalse: [ ^ self getBytesByHttp: url ] ] -{ #category : #private } +{ #category : 'private' } MicHTTPResourceReference class >> getBytesByHttp: uri [ | client | [(client := ZnEasy client) @@ -41,12 +43,12 @@ MicHTTPResourceReference class >> getBytesByHttp: uri [ error resignalAs: (MicResourceReferenceError new messageText: 'Could not access ', uri printString) ]. ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicHTTPResourceReference class >> handlesUriScheme: scheme [ ^ scheme beginsWith: 'http' ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } MicHTTPResourceReference class >> initialize [ "self initialize" @@ -54,36 +56,36 @@ MicHTTPResourceReference class >> initialize [ self resetResourcesCache ] -{ #category : #testing } +{ #category : 'testing' } MicHTTPResourceReference class >> isCachingResources [ ^ Microdown isCachingResources ] -{ #category : #testing } +{ #category : 'testing' } MicHTTPResourceReference class >> offline [ ^ Microdown offline ] -{ #category : #testing } +{ #category : 'testing' } MicHTTPResourceReference class >> resetResourcesCache [ ResourcesCache := nil ] -{ #category : #testing } +{ #category : 'testing' } MicHTTPResourceReference class >> resourcesCache [ ResourcesCache ifNil: [ ResourcesCache := LRUCache new ]. ^ ResourcesCache ] -{ #category : #streams } +{ #category : 'streams' } MicHTTPResourceReference >> binaryReadStream [ ^ (self class bytesForUrl: self uri) readStream ] -{ #category : #accessing } +{ #category : 'accessing' } MicHTTPResourceReference >> contents [ ^ (self class bytesForUrl: self uri) utf8Decoded. ] diff --git a/src/Microdown/MicHeaderBlock.class.st b/src/Microdown/MicHeaderBlock.class.st index fcb7ee1e..a009a017 100644 --- a/src/Microdown/MicHeaderBlock.class.st +++ b/src/Microdown/MicHeaderBlock.class.st @@ -23,20 +23,22 @@ produces " Class { - #name : #MicHeaderBlock, - #superclass : #MicSingleLineBlock, + #name : 'MicHeaderBlock', + #superclass : 'MicSingleLineBlock', #instVars : [ 'level' ], - #category : #'Microdown-Model' + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #visiting } +{ #category : 'visiting' } MicHeaderBlock >> accept: aVisitor [ ^ aVisitor visitHeader: self ] -{ #category : #public } +{ #category : 'public' } MicHeaderBlock >> addLineAndReturnNextNode: line [ "Line is on the form '#### my heading at forth level'" self level: ('(#+)' asRegex @@ -46,19 +48,19 @@ MicHeaderBlock >> addLineAndReturnNextNode: line [ ^ self ] -{ #category : #'parse support' } +{ #category : 'parse support' } MicHeaderBlock >> closeMe [ super closeMe. children := self inlineParse: children ] -{ #category : #accessing } +{ #category : 'accessing' } MicHeaderBlock >> formattedCode [ ^super formattedCode , '[ ', self level printString, '/', self header, ' ]' ] -{ #category : #accessing } +{ #category : 'accessing' } MicHeaderBlock >> header [ ^ String streamContents: [ :s | children do: [ :e | s nextPutAll: e substring ] ] @@ -66,26 +68,26 @@ MicHeaderBlock >> header [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicHeaderBlock >> headerElements [ ^ self children ] -{ #category : #accessing } +{ #category : 'accessing' } MicHeaderBlock >> headerElements: aCollection [ children := aCollection ] -{ #category : #accessing } +{ #category : 'accessing' } MicHeaderBlock >> level [ ^ level ] -{ #category : #accessing } +{ #category : 'accessing' } MicHeaderBlock >> level: anInteger [ "(anInteger between: 1 and: 6) ifFalse: [ MicParsingError signal: 'header levels must be between 1 and 6' ]." level := anInteger beBetween: 1 and: 6 diff --git a/src/Microdown/MicHorizontalLineBlock.class.st b/src/Microdown/MicHorizontalLineBlock.class.st index bc9fb2d7..77b54353 100644 --- a/src/Microdown/MicHorizontalLineBlock.class.st +++ b/src/Microdown/MicHorizontalLineBlock.class.st @@ -4,12 +4,14 @@ I'm an horizontal line. I'm expressed by using a new line with `***` *** the rest of the line is ignored. " Class { - #name : #MicHorizontalLineBlock, - #superclass : #MicSingleLineBlock, - #category : #'Microdown-Model' + #name : 'MicHorizontalLineBlock', + #superclass : 'MicSingleLineBlock', + #category : 'Microdown-Model', + #package : 'Microdown', + #tag : 'Model' } -{ #category : #visiting } +{ #category : 'visiting' } MicHorizontalLineBlock >> accept: aVisitor [ ^ aVisitor visitHorizontalLine: self ] diff --git a/src/Microdown/MicInlineBlockWithUrl.class.st b/src/Microdown/MicInlineBlockWithUrl.class.st index 1da51a92..d7ab7bf2 100644 --- a/src/Microdown/MicInlineBlockWithUrl.class.st +++ b/src/Microdown/MicInlineBlockWithUrl.class.st @@ -8,8 +8,8 @@ My subclasses manage figures and links. ![Pharologo](https://files.pharo.org/media/logo/logo.png) " Class { - #name : #MicInlineBlockWithUrl, - #superclass : #MicInlineElement, + #name : 'MicInlineBlockWithUrl', + #superclass : 'MicInlineElement', #instVars : [ 'url', 'parser', @@ -17,10 +17,12 @@ Class { 'arguments', 'reference' ], - #category : #'Microdown-ModelInline' + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #private } +{ #category : 'private' } MicInlineBlockWithUrl class >> fileStringWithoutHostFile: aString [ | localFileIndicator | localFileIndicator := 'file://'. @@ -29,7 +31,7 @@ MicInlineBlockWithUrl class >> fileStringWithoutHostFile: aString [ ifFalse: [ aString ] ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicInlineBlockWithUrl class >> from: aStartInteger to: anEndInteger withKind: aKind withSubstring: aString withChildren: aChildren withURL: aURL [ ^ self new start: aStartInteger; @@ -42,7 +44,7 @@ MicInlineBlockWithUrl class >> from: aStartInteger to: anEndInteger withKind: aK yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicInlineBlockWithUrl class >> from: aStartInteger to: anEndInteger withKind: aKind withSubstring: aString withChildren: aChildren withURL: aURL withParser: aParser [ ^ self new start: aStartInteger; @@ -56,18 +58,18 @@ MicInlineBlockWithUrl class >> from: aStartInteger to: anEndInteger withKind: aK yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicInlineBlockWithUrl class >> from: aStartInteger to: anEndInteger withKind: aKind withSubstring: aString withURL: aURL [ ^ (self from: aStartInteger to: anEndInteger withKind: aKind withSubstring: aString withChildren: Array empty withURL: aURL) ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> argumentAt: aKey [ ^ self arguments at: aKey ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> argumentAt: aKey ifPresent: aBlock [ "Lookup the given key in the receiver. If it is present, answer the value of evaluating the given block with the value associated with the key. Otherwise, answer self." @@ -76,73 +78,73 @@ MicInlineBlockWithUrl >> argumentAt: aKey ifPresent: aBlock [ ifPresent: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> argumentAt: aKey put: anObject [ self arguments at: aKey put: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> arguments [ ^ arguments ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> arguments: aDictionary [ arguments := aDictionary ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> caption [ ^ String streamContents: [:st | self captionElements do: [ :each | st nextPutAll: each text ] ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicInlineBlockWithUrl >> captionElements [ ^ captionElements ifNil: [ OrderedCollection new ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicInlineBlockWithUrl >> captionElements: aCollection [ captionElements := aCollection ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> closingDelimiter [ ^ URLCloserMarkup ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> fileStringWithoutHostFile [ ^ self class fileStringWithoutHostFile: url asString ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> hasArguments [ "Answer if the receiver contain at least 1 argument" ^ arguments notEmpty ] -{ #category : #initialization } +{ #category : 'initialization' } MicInlineBlockWithUrl >> initialize [ super initialize. arguments := OrderedDictionary new ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> parser [ ^ parser ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> parser: aParser [ parser := aParser ] -{ #category : #printing } +{ #category : 'printing' } MicInlineBlockWithUrl >> printOn: aStream [ | contents | contents := children @@ -157,24 +159,24 @@ MicInlineBlockWithUrl >> printOn: aStream [ aStream nextPut: $) ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> reference [ ^ reference ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> reference: anObject [ reference := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> url [ ^ url ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineBlockWithUrl >> url: anURL [ url := anURL diff --git a/src/Microdown/MicInlineElement.class.st b/src/Microdown/MicInlineElement.class.st index 860b0fd1..d7e21678 100644 --- a/src/Microdown/MicInlineElement.class.st +++ b/src/Microdown/MicInlineElement.class.st @@ -10,23 +10,25 @@ I am characterized by: " Class { - #name : #MicInlineElement, - #superclass : #MicElement, + #name : 'MicInlineElement', + #superclass : 'MicElement', #instVars : [ 'start', 'end', 'children', 'substring' ], - #category : #'Microdown-ModelInline' + #category : 'Microdown-ModelInline', + #package : 'Microdown', + #tag : 'ModelInline' } -{ #category : #constructor } +{ #category : 'constructor' } MicInlineElement class >> from: aStartInteger to: anEndInteger withSubstring: aString [ ^ self from: aStartInteger to: anEndInteger withSubstring: aString withChildren: Array new ] -{ #category : #constructor } +{ #category : 'constructor' } MicInlineElement class >> from: aStartInteger to: anEndInteger withSubstring: aString withChildren: aChildren [ ^ self new start: aStartInteger; @@ -38,54 +40,54 @@ MicInlineElement class >> from: aStartInteger to: anEndInteger withSubstring: aS yourself. ] -{ #category : #testing } +{ #category : 'testing' } MicInlineElement class >> isEvaluated [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> children [ ^ children ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> children: anArray [ children := anArray ] -{ #category : #printing } +{ #category : 'printing' } MicInlineElement >> childrenPrintOn [ ^ (children asString allButFirst: 9) allButLast ] -{ #category : #operations } +{ #category : 'operations' } MicInlineElement >> cleanSubstring [ "remove all \ left by the MicInlineParser - and replace \\ with single \" self substring: (MicInlineParser escapeDecode: self substring ) ] -{ #category : #visiting } +{ #category : 'visiting' } MicInlineElement >> closeMe [ "Hook to perform post creation action. The name is the same as for blocks." ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> end [ ^ end ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> end: anInteger [ end := anInteger ] -{ #category : #operations } +{ #category : 'operations' } MicInlineElement >> escapeCharacter [ ^ '\' ] -{ #category : #initialization } +{ #category : 'initialization' } MicInlineElement >> initialize [ super initialize. @@ -93,40 +95,40 @@ MicInlineElement >> initialize [ ] -{ #category : #testing } +{ #category : 'testing' } MicInlineElement >> isOnlyChild [ ^ children isEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> kind [ "we are deprecating the state" ^ self error ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> literal [ ^ substring copyFrom: start to: end. ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> openingDelimiter [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> openingDelimiterSize [ ^ self openingDelimiter size ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> parent: aParent [ parent := aParent ] -{ #category : #printing } +{ #category : 'printing' } MicInlineElement >> print: aString surroundedOn: aStream [ aStream @@ -136,7 +138,7 @@ MicInlineElement >> print: aString surroundedOn: aStream [ ] -{ #category : #printing } +{ #category : 'printing' } MicInlineElement >> printOn: aStream [ | contents | @@ -152,7 +154,7 @@ MicInlineElement >> printOn: aStream [ ] -{ #category : #printing } +{ #category : 'printing' } MicInlineElement >> printWithoutConventions: aStream [ "Remove Mic and Block from the class." @@ -160,27 +162,27 @@ MicInlineElement >> printWithoutConventions: aStream [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> start [ ^ start ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> start: anInteger [ start := anInteger ] -{ #category : #obsolete } +{ #category : 'obsolete' } MicInlineElement >> substring [ ^ substring ] -{ #category : #obsolete } +{ #category : 'obsolete' } MicInlineElement >> substring: aSubString [ substring := aSubString ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineElement >> text [ ^ substring ] diff --git a/src/Microdown/MicInlineParser.class.st b/src/Microdown/MicInlineParser.class.st index eae9baf3..b7de16d7 100644 --- a/src/Microdown/MicInlineParser.class.st +++ b/src/Microdown/MicInlineParser.class.st @@ -2,8 +2,8 @@ I'm a parser of block text. I'm responsible to generate text, annotation, format, link, url kind of objects. " Class { - #name : #MicInlineParser, - #superclass : #Object, + #name : 'MicInlineParser', + #superclass : 'Object', #instVars : [ 'openersStack', 'result', @@ -27,16 +27,18 @@ Class { #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Parser' + #category : 'Microdown-Parser', + #package : 'Microdown', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicInlineParser class >> abstractDelimiterClass [ ^ MicAbstractDelimiter ] -{ #category : #accessing } +{ #category : 'accessing' } MicInlineParser class >> allDelimiters [ AllDelimiters ifNil: [ @@ -49,7 +51,7 @@ MicInlineParser class >> allDelimiters [ ^ AllDelimiters ] -{ #category : #'escape character' } +{ #category : 'escape character' } MicInlineParser class >> escapeDecode: aString [ "I convert all encoded chars back to their original (without the leading escape character)" "My sister method escapeEncode encodes into the format I decode from" @@ -68,7 +70,7 @@ MicInlineParser class >> escapeDecode: aString [ ] -{ #category : #'escape character' } +{ #category : 'escape character' } MicInlineParser class >> escapeEncode: aString [ "I convert all escaped characters (eg '\`' or '\\') into special characters which are not used in Microdown" "My sister method escapeDecode reverts back" @@ -86,7 +88,7 @@ MicInlineParser class >> escapeEncode: aString [ ] -{ #category : #'escape character' } +{ #category : 'escape character' } MicInlineParser class >> escapeReescape: aString except: keep [ "I convert all encoded back to escaped chars, except the characters in keep" "My sister method escapeEncode encodes into the format I decode from" @@ -106,20 +108,20 @@ MicInlineParser class >> escapeReescape: aString except: keep [ ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } MicInlineParser class >> initialize [ @@ -398,14 +400,14 @@ MicHTMLVisitor >> visitMath: anObject [ ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> visitMetaData: aMetaData [ self metaDataFromAssociations: aMetaData body. super visitMetaData: aMetaData. ] -{ #category : #'visiting - inline elements' } +{ #category : 'visiting - inline elements' } MicHTMLVisitor >> visitMonospace: aMonospace [ canvas tag @@ -413,7 +415,7 @@ MicHTMLVisitor >> visitMonospace: aMonospace [ with: [ super visitMonospace: aMonospace ] ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicHTMLVisitor >> visitOrderedList: anOrderedList [ canvas newLine. @@ -424,7 +426,7 @@ MicHTMLVisitor >> visitOrderedList: anOrderedList [ super visitOrderedList: anOrderedList ] ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicHTMLVisitor >> visitOrderedListItem: anOrderedListItem [ "will not work with we have text decorators such as bold, italic, monospace" @@ -435,7 +437,7 @@ MicHTMLVisitor >> visitOrderedListItem: anOrderedListItem [ ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> visitParagraph: aParagraph [ canvas newLine. @@ -444,7 +446,7 @@ MicHTMLVisitor >> visitParagraph: aParagraph [ with: [ super visitParagraph: aParagraph ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> visitQuote: aQuote [ "If the quote text size exceeds a minimum threshold, use blockquote which is appropriate for long quotations" @@ -457,7 +459,7 @@ MicHTMLVisitor >> visitQuote: aQuote [ with: [ super visitQuote: aQuote ] ] -{ #category : #'visiting - inline elements' } +{ #category : 'visiting - inline elements' } MicHTMLVisitor >> visitStrike: aStrike [ canvas tag @@ -465,7 +467,7 @@ MicHTMLVisitor >> visitStrike: aStrike [ with: [ super visitStrike: aStrike ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> visitTable: aTable [ canvas newLine. @@ -476,20 +478,20 @@ MicHTMLVisitor >> visitTable: aTable [ self visitTableRows: aTable ] ] -{ #category : #writing } +{ #category : 'writing' } MicHTMLVisitor >> visitTableHeaders: header [ self visitTableRow: header withTag: 'th'. ] -{ #category : #writing } +{ #category : 'writing' } MicHTMLVisitor >> visitTableRow: row [ self visitTableRow: row withTag: 'td' ] -{ #category : #writing } +{ #category : 'writing' } MicHTMLVisitor >> visitTableRow: row withTag: aString [ "Private - Generalized visiting row to handle both table header and table row (td)" @@ -503,7 +505,7 @@ MicHTMLVisitor >> visitTableRow: row withTag: aString [ canvas newLine ] -{ #category : #writing } +{ #category : 'writing' } MicHTMLVisitor >> visitTableRows: aTable [ | remainingRows | @@ -517,7 +519,7 @@ MicHTMLVisitor >> visitTableRows: aTable [ remainingRows do: [ : row | self visitTableRow: row ] ] -{ #category : #'visiting - inline elements' } +{ #category : 'visiting - inline elements' } MicHTMLVisitor >> visitText: aText [ canvas nextPutAll: ( @@ -526,7 +528,7 @@ MicHTMLVisitor >> visitText: aText [ ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicHTMLVisitor >> visitUnorderedList: anUnorderedList [ canvas newLine. @@ -537,7 +539,7 @@ MicHTMLVisitor >> visitUnorderedList: anUnorderedList [ super visitUnorderedList: anUnorderedList ] ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicHTMLVisitor >> visitUnorderedListItem: anUnorderedListItem [ "will not work with we have text decorators such as bold, italic, monospace" @@ -548,7 +550,7 @@ MicHTMLVisitor >> visitUnorderedListItem: anUnorderedListItem [ ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> writeCounter: aCounter [ "Write on the canvas the string representation of ==aCounter==" @@ -558,25 +560,25 @@ MicHTMLVisitor >> writeCounter: aCounter [ separatedBy: [ self writeCounterElementSeparator ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> writeCounterDefinitionSeparator [ canvas nextPutAll: '. ' ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> writeCounterElement: aCounterElement [ canvas nextPutAll: aCounterElement asString ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> writeCounterElementSeparator [ self shouldBeImplemented ] -{ #category : #visiting } +{ #category : 'visiting' } MicHTMLVisitor >> writeCounterForScript: aScript [ aScript counter isValidCounter ifFalse: [ ^ self ]. diff --git a/src/Microdown-HTMLExporter/MicLinkBlock.extension.st b/src/Microdown-HTMLExporter/MicLinkBlock.extension.st index 4c7ff8ae..d8036b67 100644 --- a/src/Microdown-HTMLExporter/MicLinkBlock.extension.st +++ b/src/Microdown-HTMLExporter/MicLinkBlock.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicLinkBlock } +Extension { #name : 'MicLinkBlock' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } MicLinkBlock >> referencePath [ ^ self reference fullName diff --git a/src/Microdown-HTMLExporter/MicListBlock.extension.st b/src/Microdown-HTMLExporter/MicListBlock.extension.st index c18fec09..317cdce5 100644 --- a/src/Microdown-HTMLExporter/MicListBlock.extension.st +++ b/src/Microdown-HTMLExporter/MicListBlock.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicListBlock } +Extension { #name : 'MicListBlock' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } MicListBlock >> listItemText [ "I just need the first children which contains the text, currently #text concatenates all children's text" diff --git a/src/Microdown-HTMLExporter/MicListItemBlock.extension.st b/src/Microdown-HTMLExporter/MicListItemBlock.extension.st index f358dce3..2d3461e0 100644 --- a/src/Microdown-HTMLExporter/MicListItemBlock.extension.st +++ b/src/Microdown-HTMLExporter/MicListItemBlock.extension.st @@ -1,13 +1,13 @@ -Extension { #name : #MicListItemBlock } +Extension { #name : 'MicListItemBlock' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } MicListItemBlock >> hasChildren [ "Answer if the receiver has any children" ^ self children size > 1 ] -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } MicListItemBlock >> hasNestedChildren [ "Answer if the receiver's children are list items and they are nested" @@ -15,7 +15,7 @@ MicListItemBlock >> hasNestedChildren [ self children second nestedLevel > self nestedLevel ] ] -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } MicListItemBlock >> listItemText [ ^ text diff --git a/src/Microdown-HTMLExporter/MicRelativeResourceReference.extension.st b/src/Microdown-HTMLExporter/MicRelativeResourceReference.extension.st index cbab0c8b..f041ffd1 100644 --- a/src/Microdown-HTMLExporter/MicRelativeResourceReference.extension.st +++ b/src/Microdown-HTMLExporter/MicRelativeResourceReference.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicRelativeResourceReference } +Extension { #name : 'MicRelativeResourceReference' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } MicRelativeResourceReference >> uri [ "Answer the receiver's reference in a uri (ZnUrl)." diff --git a/src/Microdown-HTMLExporter/Microdown.extension.st b/src/Microdown-HTMLExporter/Microdown.extension.st index 94ee6521..61b11af1 100644 --- a/src/Microdown-HTMLExporter/Microdown.extension.st +++ b/src/Microdown-HTMLExporter/Microdown.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Microdown } +Extension { #name : 'Microdown' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } Microdown class >> asHTMLDocument: aStringOrDoc [ "Facade method to serialize a Microdown document or string to HTML" @@ -9,7 +9,7 @@ Microdown class >> asHTMLDocument: aStringOrDoc [ ] -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } Microdown class >> asHTMLString: aStringOrDoc [ "Facade method to render a microdown document or string to HTML" @@ -18,7 +18,7 @@ Microdown class >> asHTMLString: aStringOrDoc [ ] -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } Microdown class >> asHTMLString: aStringOrDoc configuration: aMicHTMLConfiguration [ "Facade method to render a microdown document or string to HTML" diff --git a/src/Microdown-HTMLExporter/ZnClient.extension.st b/src/Microdown-HTMLExporter/ZnClient.extension.st index b6426fa9..41bf5e5e 100644 --- a/src/Microdown-HTMLExporter/ZnClient.extension.st +++ b/src/Microdown-HTMLExporter/ZnClient.extension.st @@ -1,19 +1,19 @@ -Extension { #name : #ZnClient } +Extension { #name : 'ZnClient' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } ZnClient >> requestSegments [ "Answer a with the receiver's parts (those separated by /)" ^ self requestUri segments ] -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } ZnClient >> requestUri [ ^ self request uri ] -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } ZnClient >> requestedResource [ "Answer a with the name of resource (file or directory) requested" diff --git a/src/Microdown-HTMLExporter/ZnUrl.extension.st b/src/Microdown-HTMLExporter/ZnUrl.extension.st index 86ebcf44..59be2b44 100644 --- a/src/Microdown-HTMLExporter/ZnUrl.extension.st +++ b/src/Microdown-HTMLExporter/ZnUrl.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ZnUrl } +Extension { #name : 'ZnUrl' } -{ #category : #'*Microdown-HTMLExporter' } +{ #category : '*Microdown-HTMLExporter' } ZnUrl >> filename [ ^ self pathSegments last diff --git a/src/Microdown-HTMLExporter/package.st b/src/Microdown-HTMLExporter/package.st index cb23ee6c..3e0bf061 100644 --- a/src/Microdown-HTMLExporter/package.st +++ b/src/Microdown-HTMLExporter/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-HTMLExporter' } +Package { #name : 'Microdown-HTMLExporter' } diff --git a/src/Microdown-RichTextComposer-Tests/ManifestMicrodownRichTextComposerTests.class.st b/src/Microdown-RichTextComposer-Tests/ManifestMicrodownRichTextComposerTests.class.st index 084c955d..d30aef89 100644 --- a/src/Microdown-RichTextComposer-Tests/ManifestMicrodownRichTextComposerTests.class.st +++ b/src/Microdown-RichTextComposer-Tests/ManifestMicrodownRichTextComposerTests.class.st @@ -2,7 +2,9 @@ Some specific microdown rich text integration tests. " Class { - #name : #ManifestMicrodownRichTextComposerTests, - #superclass : #PackageManifest, - #category : #'Microdown-RichTextComposer-Tests-Manifest' + #name : 'ManifestMicrodownRichTextComposerTests', + #superclass : 'PackageManifest', + #category : 'Microdown-RichTextComposer-Tests-Manifest', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Manifest' } diff --git a/src/Microdown-RichTextComposer-Tests/MicCenterAlignmentBlockTest.class.st b/src/Microdown-RichTextComposer-Tests/MicCenterAlignmentBlockTest.class.st index 83de140f..76b363d2 100644 --- a/src/Microdown-RichTextComposer-Tests/MicCenterAlignmentBlockTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicCenterAlignmentBlockTest.class.st @@ -2,12 +2,14 @@ A MicCenterAllignmentBlockTest is a test class for testing the behavior of MicCenterAllignmentBlock " Class { - #name : #MicCenterAlignmentBlockTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-BlockExtensions' + #name : 'MicCenterAlignmentBlockTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-BlockExtensions', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'BlockExtensions' } -{ #category : #tests } +{ #category : 'tests' } MicCenterAlignmentBlockTest >> testCenter [ | src doc center | src := ' diff --git a/src/Microdown-RichTextComposer-Tests/MicCodeSemanticActionTest.class.st b/src/Microdown-RichTextComposer-Tests/MicCodeSemanticActionTest.class.st index 3f36c9e6..a41961f0 100644 --- a/src/Microdown-RichTextComposer-Tests/MicCodeSemanticActionTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicCodeSemanticActionTest.class.st @@ -1,23 +1,25 @@ Class { - #name : #MicCodeSemanticActionTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicCodeSemanticActionTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> semanticActionClass [ ^ MicSemanticAction ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testArrayShouldNotBreak [ self deny: (self semanticActionClass fromTokens: #( 1 #+ 2 #* 3 )) hasEntity. self deny: (self semanticActionClass fromTokens: #( 1 #+ 2 #* )) hasEntity ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testChevronWithBrokenArguments [ self assert: (self semanticActionClass fromTokens: #( Point #>> 2 )) entity isNil. @@ -27,7 +29,7 @@ MicCodeSemanticActionTest >> testChevronWithBrokenArguments [ self assert: (self semanticActionClass fromTokens: #( Point #>> Point )) entity isNil ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testChevronWithBrokenReceiver [ self assert: (self semanticActionClass fromTokens: #( 1 #>> 2 )) entity isNil. @@ -40,19 +42,19 @@ MicCodeSemanticActionTest >> testChevronWithBrokenReceiver [ self assert: (self semanticActionClass fromTokens: #( ClassThatDoesNotExist class #>> 2 )) entity isNil ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testDoubleDollars [ self deny: (self semanticActionClass from: '$$') hasEntity ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testEmptyString [ self deny: (self semanticActionClass from: '') hasEntity ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testGlobalAccess [ self assert: (self semanticActionClass fromTokens: #( Transcript )) hasEntity @@ -60,31 +62,31 @@ MicCodeSemanticActionTest >> testGlobalAccess [ used by the browse invocation when clicking on it. " ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testMoreSpaces [ self deny: (self semanticActionClass from: ' ') hasEntity ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testOneSpace [ self deny: (self semanticActionClass from: ' ') hasEntity ] -{ #category : #'tests - metaclass' } +{ #category : 'tests - metaclass' } MicCodeSemanticActionTest >> testReferenceToABrokenMetaClass [ self assert: (self semanticActionClass from: 'Point2 class') entity isNil ] -{ #category : #'tests - metaclass' } +{ #category : 'tests - metaclass' } MicCodeSemanticActionTest >> testReferenceToABrokenMetaClass2 [ self assert: (self semanticActionClass from: 'Point grgrgr') entity isNil ] -{ #category : #'tests - class' } +{ #category : 'tests - class' } MicCodeSemanticActionTest >> testReferenceToAClass [ self @@ -92,7 +94,7 @@ MicCodeSemanticActionTest >> testReferenceToAClass [ equals: Point ] -{ #category : #'tests - metaclass' } +{ #category : 'tests - metaclass' } MicCodeSemanticActionTest >> testReferenceToAMetaClass [ self @@ -100,7 +102,7 @@ MicCodeSemanticActionTest >> testReferenceToAMetaClass [ equals: Point class ] -{ #category : #'tests - methods' } +{ #category : 'tests - methods' } MicCodeSemanticActionTest >> testReferenceToAMethod [ self @@ -108,31 +110,31 @@ MicCodeSemanticActionTest >> testReferenceToAMethod [ equals: 'Point>>#setX:setY:' ] -{ #category : #'tests - methods' } +{ #category : 'tests - methods' } MicCodeSemanticActionTest >> testReferenceToANonExistingMethod [ self assert: (self semanticActionClass from: 'Point >> 12+3 ') entity isNil ] -{ #category : #'tests - methods' } +{ #category : 'tests - methods' } MicCodeSemanticActionTest >> testReferenceToANonExistingMethodBecauseOfBogusClass [ self assert: (self semanticActionClass from: 'Point222 >> #setX:setY:') entity isNil ] -{ #category : #'tests - methods' } +{ #category : 'tests - methods' } MicCodeSemanticActionTest >> testReferenceToANonExistingMethodBecauseOfNoSymbol [ self assert: (self semanticActionClass from: 'Point >> setX:setY2:') entity isNil ] -{ #category : #'tests - package' } +{ #category : 'tests - package' } MicCodeSemanticActionTest >> testReferenceToANonExistingPackage [ self assert: (self semanticActionClass from: #Pillar) entity isNil ] -{ #category : #'tests - package' } +{ #category : 'tests - package' } MicCodeSemanticActionTest >> testReferenceToAPackage [ self @@ -140,13 +142,13 @@ MicCodeSemanticActionTest >> testReferenceToAPackage [ equals: 'Microdown' ] -{ #category : #'tests - class' } +{ #category : 'tests - class' } MicCodeSemanticActionTest >> testReferenceToNonExistingClass [ self deny: (self semanticActionClass from: 'Point22') hasEntity ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testScannerShouldNotFail [ self deny: (self semanticActionClass from: 'half"baked') hasEntity. @@ -155,7 +157,7 @@ MicCodeSemanticActionTest >> testScannerShouldNotFail [ self deny: (self semanticActionClass from: 16rFFFD asCharacter asString) hasEntity. ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testTwoBogusElements [ self assert: @@ -166,7 +168,7 @@ MicCodeSemanticActionTest >> testTwoBogusElements [ (self semanticActionClass fromTokens: #( Point #foo )) entity isNil ] -{ #category : #'test - bogus entry' } +{ #category : 'test - bogus entry' } MicCodeSemanticActionTest >> testTwoSpaces [ self deny: (self semanticActionClass from: ' ') hasEntity diff --git a/src/Microdown-RichTextComposer-Tests/MicDynamicTextStylerTest.class.st b/src/Microdown-RichTextComposer-Tests/MicDynamicTextStylerTest.class.st index 3e8d2d41..8f274b14 100644 --- a/src/Microdown-RichTextComposer-Tests/MicDynamicTextStylerTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicDynamicTextStylerTest.class.st @@ -2,12 +2,14 @@ A MicDynamicTextStylerTest is a test class for testing the behavior of MicDynamicTextStyler " Class { - #name : #MicDynamicTextStylerTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicDynamicTextStylerTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testBodyFont [ | styler | styler := MicDynamicTextStyler new. @@ -17,7 +19,7 @@ MicDynamicTextStylerTest >> testBodyFont [ self assert: styler bodyFont pointSize equals: 72. ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testBulletForLevel [ | styler | styler := MicDynamicTextStyler new. @@ -27,17 +29,17 @@ MicDynamicTextStylerTest >> testBulletForLevel [ self assert: (styler bulletForLevel: 4) equals: 'a' asText. ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testBullets [ "I am not needed as I am tested by testCounterForAtLevel, but being here marks counters: as tested" ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testCodeBackgroundColor [ ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testCounterForAtLevel [ | styler | styler := MicDynamicTextStyler new. @@ -48,12 +50,12 @@ MicDynamicTextStylerTest >> testCounterForAtLevel [ self assert: (styler counterFor: 5 atLevel: 5) equals: 'e)' asText. ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testCounters [ "I am not needed as I am tested by testCounterForAtLevel, but being here marks counters: as tested" ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testCrAfterHeader [ | styler | styler := MicDynamicTextStyler new. @@ -64,7 +66,7 @@ MicDynamicTextStylerTest >> testCrAfterHeader [ ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testHeaderFontForLevel [ | styler | styler := MicDynamicTextStyler new. @@ -73,7 +75,7 @@ MicDynamicTextStylerTest >> testHeaderFontForLevel [ self assert: (styler headerLevelFont: 1) font pointSize equals: 72. ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testHeaderFontForLevel_wrongFormat [ | styler | styler := MicDynamicTextStyler new. @@ -82,7 +84,7 @@ MicDynamicTextStylerTest >> testHeaderFontForLevel_wrongFormat [ ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testHeaderFontForLevel_wrongLevel [ | styler | styler := MicDynamicTextStyler new. @@ -90,7 +92,7 @@ MicDynamicTextStylerTest >> testHeaderFontForLevel_wrongLevel [ self assert: styler errors isNotEmpty ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testInterblockSpacing [ | styler | styler := MicDynamicTextStyler new. @@ -101,7 +103,7 @@ MicDynamicTextStylerTest >> testInterblockSpacing [ self assert: styler interBlockSpacing equals: (String cr, String cr) asText ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testKeepCRFromInput [ | styler textSample| styler := MicDynamicTextStyler new. @@ -112,7 +114,7 @@ MicDynamicTextStylerTest >> testKeepCRFromInput [ ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testMonospaceBackgroundColor [ | styler | styler := MicDynamicTextStyler new. @@ -124,7 +126,7 @@ MicDynamicTextStylerTest >> testMonospaceBackgroundColor [ ] -{ #category : #tests } +{ #category : 'tests' } MicDynamicTextStylerTest >> testNewLineIfNotAlready [ | styler | styler := MicDynamicTextStyler new. diff --git a/src/Microdown-RichTextComposer-Tests/MicMockBaselineOf.class.st b/src/Microdown-RichTextComposer-Tests/MicMockBaselineOf.class.st index 98d634de..91077731 100644 --- a/src/Microdown-RichTextComposer-Tests/MicMockBaselineOf.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicMockBaselineOf.class.st @@ -1,5 +1,7 @@ Class { - #name : #MicMockBaselineOf, - #superclass : #BaselineOf, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicMockBaselineOf', + #superclass : 'BaselineOf', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } diff --git a/src/Microdown-RichTextComposer-Tests/MicParsesAndRendersAllCommentsTest.class.st b/src/Microdown-RichTextComposer-Tests/MicParsesAndRendersAllCommentsTest.class.st index b1a300c9..b389cc07 100644 --- a/src/Microdown-RichTextComposer-Tests/MicParsesAndRendersAllCommentsTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicParsesAndRendersAllCommentsTest.class.st @@ -2,19 +2,21 @@ I test that rendering no class comments make microdown parser or renderer fail " Class { - #name : #MicParsesAndRendersAllCommentsTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicParsesAndRendersAllCommentsTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #tests } +{ #category : 'tests' } MicParsesAndRendersAllCommentsTest >> testCommentFromChunkReadStream [ "Test that we do not break on empty annotated blocks" Microdown asRichText: ChunkReadStream comment. Microdown asRichText: '!!' ] -{ #category : #tests } +{ #category : 'tests' } MicParsesAndRendersAllCommentsTest >> testCommentFromConfigurationCommandLineHandler [ Microdown asRichText: ConfigurationCommandLineHandler comment. "Command line handler for dealing with Metacello configurations from the command line @@ -51,14 +53,14 @@ Examples: " ] -{ #category : #tests } +{ #category : 'tests' } MicParsesAndRendersAllCommentsTest >> testCommentFromFluidBuilder [ "Test that we do not break on empty code blocks" Microdown asRichText: '``` ```' ] -{ #category : #tests } +{ #category : 'tests' } MicParsesAndRendersAllCommentsTest >> testSmokeSignalAndChoke [ | difficultClasses | "this test disables error handling and tries to render all class comments in the system" diff --git a/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerDummyForTest.class.st b/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerDummyForTest.class.st index 10288ee1..8ce4e09a 100644 --- a/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerDummyForTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerDummyForTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicRichTextCodeBlockStylerDummyForTest, - #superclass : #MicRichTextCodeBlockStyler, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicRichTextCodeBlockStylerDummyForTest', + #superclass : 'MicRichTextCodeBlockStyler', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerDummyForTest class >> styleTags [ ^ #(dummyForTest) ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerDummyForTest >> style: sString [ ^ '§dummy§' asText ] diff --git a/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerTest.class.st b/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerTest.class.st index dd5ff3d6..0b140fb3 100644 --- a/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicRichTextCodeBlockStylerTest.class.st @@ -2,17 +2,19 @@ A MicRichTextCodeBlockStylerTest is a test class for testing the behavior of MicRichTextCodeBlockStyler " Class { - #name : #MicRichTextCodeBlockStylerTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicRichTextCodeBlockStylerTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerTest >> stylerFor: aLanguage [ ^ MicRichTextCodeBlockStyler stylerFor: aLanguage ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextCodeBlockStylerTest >> testDefaultStylerIsFound [ | defaultStyler | @@ -20,7 +22,7 @@ MicRichTextCodeBlockStylerTest >> testDefaultStylerIsFound [ self assert: defaultStyler class equals: MicRichTextCodeBlockStylerDefault ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextCodeBlockStylerTest >> testStylerForMethod [ | code richText blueLocation textColor | @@ -41,7 +43,7 @@ styledTextFor: aString asFest'. self assert: textColor color red equals: 0. ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextCodeBlockStylerTest >> testStylerForSmalltalk [ | code richText blueLocation textColor | @@ -60,7 +62,7 @@ green isColored: yellow self assert: textColor color red equals: 0. ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextCodeBlockStylerTest >> testStylersForText [ | defaultStyler | diff --git a/src/Microdown-RichTextComposer-Tests/MicRichTextComposerTest.class.st b/src/Microdown-RichTextComposer-Tests/MicRichTextComposerTest.class.st index e639631f..f7fba97b 100644 --- a/src/Microdown-RichTextComposer-Tests/MicRichTextComposerTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicRichTextComposerTest.class.st @@ -1,168 +1,169 @@ Class { - #name : #MicRichTextComposerTest, - #superclass : #TestCase, + #name : 'MicRichTextComposerTest', + #superclass : 'TestCase', #instVars : [ 'sample', 'parser', 'composer', 'offlineStatus' ], - #category : #'Microdown-RichTextComposer-Tests-Composer' + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } MicRichTextComposerTest class >> sampleMicrodownForInputTest [ ^ '# TestHeader body for testing' ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> assertWriting: aPRDocument include: expectedAttribute [ self assert: ((self runsOf: aPRDocument) includes: {expectedAttribute}) ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> boldFormat [ ^ TextEmphasis bold ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> composer [ composer ifNotNil: [ ^ composer ]. ^ composer := self composerClass new ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> composerClass [ ^ MicRichTextComposer ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> externalLink: aLink [ ^ TextAction new actOnClickBlock: [WebBrowser openOn: aLink] ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> figure: aFigureLink [ | url | url := aFigureLink. ^ TextAnchor new anchoredMorph: (ZnEasy getPng: url) ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> headerLevel1 [ ^ self composer textStyler headerLevelFont: 1 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> headerLevel2 [ ^ self composer textStyler headerLevelFont: 2 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> headerLevel3 [ ^ self composer textStyler headerLevelFont: 3 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> headerLevel4 [ ^ self composer textStyler headerLevelFont: 4 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> headerLevel5 [ ^ self composer textStyler headerLevelFont: 5 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> headerLevel6 [ ^ self composer textStyler headerLevelFont: 6 ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> italicFormat [ ^ TextEmphasis italic ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> microElementsFrom: aString [ ^ sample documentFrom: aString. ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> monospaceFormat [ ^ TextBackgroundColor color: Smalltalk ui theme settings windowColor ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> normalFormat [ ^ TextEmphasis normal ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> richTextFor: aDocument [ ^ self composer visit: aDocument ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> richTextForString: aString [ ^ self composer asRichText: aString ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> runsOf: aDocument [ ^ (self richTextFor: aDocument) runs ] -{ #category : #running } +{ #category : 'running' } MicRichTextComposerTest >> setUp [ super setUp. sample := MicMicrodownSnippetFactory new. parser := Microdown new. offlineStatus := Microdown offline. Microdown offline: false. - MicRichTextComposer initialize. ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> strikethroughtFormat [ ^ TextEmphasis struckOut ] -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextComposerTest >> stringOf: aPRDocument [ ^ (self richTextFor: aPRDocument) string ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> subscriptFormat [ ^ TextColor red ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> superscriptFormat [ ^ TextColor blue ] -{ #category : #running } +{ #category : 'running' } MicRichTextComposerTest >> tearDown [ Microdown offline: offlineStatus. super tearDown. ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testBackslashLast [ | source richText | source := 'I am a text which ends in \'. @@ -170,7 +171,7 @@ MicRichTextComposerTest >> testBackslashLast [ self assert: richText asString trim equals: source ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testBackslashNoBreak [ "This test is related to issue: https://github.com/pillar-markup/Microdown/issues/107" | source richText | @@ -187,13 +188,13 @@ Subclasses may change the definition of names by redefining isCurrentALetter.'. self assert: true "I did not fail" ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> testBoldFormat [ self assertWriting: (self microElementsFrom: sample boldFormatSample) include: self boldFormat ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> testCenter [ | src doc| src := ' @@ -204,7 +205,7 @@ This is centered self assertWriting: doc include: TextAlignment centered ] -{ #category : #'tests - codeBlock' } +{ #category : 'tests - codeBlock' } MicRichTextComposerTest >> testCodeBlock [ | source runs richText | @@ -223,7 +224,7 @@ line 2 line 2' ] -{ #category : #'tests - codeBlock' } +{ #category : 'tests - codeBlock' } MicRichTextComposerTest >> testCodeBlockStylerExplicitLanguage [ | source richText expected | @@ -238,7 +239,7 @@ line 2 self assert: richText asString trim equals: expected ] -{ #category : #'tests - codeBlock' } +{ #category : 'tests - codeBlock' } MicRichTextComposerTest >> testCodeBlockStylerShortHand [ | source richText expected | @@ -253,7 +254,7 @@ line 2 self assert: richText asString trim equals: expected ] -{ #category : #'tests - codeBlock' } +{ #category : 'tests - codeBlock' } MicRichTextComposerTest >> testCodeBlockWithCaption [ | source runs richText | @@ -275,7 +276,7 @@ line 2 Roger Rabbit' ] -{ #category : #'tests - codeBlock' } +{ #category : 'tests - codeBlock' } MicRichTextComposerTest >> testCodeBlockWithTabbedCode [ | source richText | @@ -290,7 +291,7 @@ MicRichTextComposerTest >> testCodeBlockWithTabbedCode [ 8' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testEnvironment_unknownShouldNotFail [ | src | src := ' @@ -301,7 +302,7 @@ stuff Microdown asRichText: src ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testExternaLink [ | source richText obj1 | @@ -312,7 +313,7 @@ MicRichTextComposerTest >> testExternaLink [ self assert: obj1 class name equals: #TextAction ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testFigureCaptionMissingRemote [ | source richText| @@ -323,7 +324,7 @@ MicRichTextComposerTest >> testFigureCaptionMissingRemote [ self assert: richText asTextMorph height < 100 "No image embedded" ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testFigureCaptionRemote [ | source richText | @@ -334,7 +335,7 @@ MicRichTextComposerTest >> testFigureCaptionRemote [ self assert: richText asTextMorph height > 100 "It is high because of the embedded image" ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testFigureNoCaptionRemote [ | source richText | @@ -345,7 +346,7 @@ MicRichTextComposerTest >> testFigureNoCaptionRemote [ self assert: richText asTextMorph height > 100 "It is high because of the embedded image" ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> testHeaderLevel1 [ self @@ -353,7 +354,7 @@ MicRichTextComposerTest >> testHeaderLevel1 [ include: self headerLevel1 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> testHeaderLevel2 [ self @@ -361,7 +362,7 @@ MicRichTextComposerTest >> testHeaderLevel2 [ include: self headerLevel2 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> testHeaderLevel3 [ self @@ -369,7 +370,7 @@ MicRichTextComposerTest >> testHeaderLevel3 [ include: self headerLevel3 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> testHeaderLevel4 [ self @@ -377,7 +378,7 @@ MicRichTextComposerTest >> testHeaderLevel4 [ include: self headerLevel4 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> testHeaderLevel5 [ self @@ -385,7 +386,7 @@ MicRichTextComposerTest >> testHeaderLevel5 [ include: self headerLevel5 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicRichTextComposerTest >> testHeaderLevel6 [ self @@ -393,7 +394,7 @@ MicRichTextComposerTest >> testHeaderLevel6 [ include: self headerLevel6 ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testInputfile [ | source result | @@ -403,7 +404,7 @@ MicRichTextComposerTest >> testInputfile [ self assert: (result includesSubstring: 'body for test') ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testItalicFormat [ | source runs richText | @@ -416,7 +417,7 @@ MicRichTextComposerTest >> testItalicFormat [ self deny: ((runs at: 6 "the h in have") includes: self italicFormat ). ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testLatexMathStyleEmpty [ | source richText | @@ -425,7 +426,7 @@ MicRichTextComposerTest >> testLatexMathStyleEmpty [ self assert: richText asString trim equals: 'foobar' . ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testListAreCorrectlyNumbered [ | source richText | @@ -441,7 +442,7 @@ MicRichTextComposerTest >> testListAreCorrectlyNumbered [ ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testMathEnvironmentError [ | source richText | source := 'foo @@ -455,7 +456,7 @@ $$ $$ - LATEX ERROR - $$' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testNestedList [ "I just need to be here and succeed to override an existing test which is obsolete" | silly | @@ -463,7 +464,7 @@ MicRichTextComposerTest >> testNestedList [ self assert: silly equals: silly ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testNestedMixedList [ | source richText runs | @@ -483,7 +484,7 @@ MicRichTextComposerTest >> testNestedMixedList [ ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testNestedMixedListNoEmptyLinesEfterSubLists [ | source output | @@ -500,7 +501,7 @@ MicRichTextComposerTest >> testNestedMixedListNoEmptyLinesEfterSubLists [ ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testNestedUnorderdList [ | source richText | @@ -518,7 +519,7 @@ MicRichTextComposerTest >> testNestedUnorderdList [ ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testNewDictionaryAPI [ | dict | @@ -526,7 +527,7 @@ MicRichTextComposerTest >> testNewDictionaryAPI [ self assert: (dict at: #a) equals: 1 ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testNoNSuperfluousNewLines [ | source richText expected | @@ -540,7 +541,7 @@ And this is just an other paragraph'. self assert: richText asString equals: expected ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testNosuperfluousNewLines [ | source richText expected | @@ -550,7 +551,7 @@ MicRichTextComposerTest >> testNosuperfluousNewLines [ self assert: richText asString equals: expected ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testOrderedList [ | source richText runs | @@ -568,7 +569,7 @@ MicRichTextComposerTest >> testOrderedList [ ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testOrderedNestedList [ | source richText | source := ' @@ -582,7 +583,7 @@ MicRichTextComposerTest >> testOrderedNestedList [ ] -{ #category : #'tests - paragraph' } +{ #category : 'tests - paragraph' } MicRichTextComposerTest >> testParagraphNotFormat [ | runs richText | @@ -594,7 +595,7 @@ barwith a space'). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testQuoteBlock [ | src richText | "Quote blocks have not been implemented" @@ -604,14 +605,14 @@ MicRichTextComposerTest >> testQuoteBlock [ self deny: (richText asString findString: 'foo') equals: 0 ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testRaw [ | text | text := Microdown asRichText: '{{**not bold**}}'. self assert: text asString trim equals: '**not bold**'. ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testRawNewLinesPreserved [ | text | text := Microdown asRichText: '{{**not @@ -620,7 +621,7 @@ bold**}}'. bold**'. ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> testRightAlignment [ | src doc| src := ' @@ -631,7 +632,7 @@ This is righted self assertWriting: doc include: TextAlignment rightFlush ] -{ #category : #'skipped tests' } +{ #category : 'skipped tests' } MicRichTextComposerTest >> testStrikethroughFormat [ | source runs richText | source := 'This have been ~deleted~'. @@ -643,11 +644,11 @@ MicRichTextComposerTest >> testStrikethroughFormat [ self deny: ((runs at: 6 "the h in have") includes: self strikethroughtFormat ). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextComposerTest >> testStylerForMethod [ | code source richText blueLocation textColor | - self composerClass initialize. + code := ' codeStylerFor: aString @@ -669,7 +670,7 @@ styledTextFor: aString asFest'. self assert: textColor color red equals: 0. ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicRichTextComposerTest >> testUnorderedList [ | source richText runs | @@ -685,7 +686,7 @@ MicRichTextComposerTest >> testUnorderedList [ self assert: (runs at: 29) first amount equals: 2. ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicRichTextComposerTest >> underlineFormat [ ^ TextEmphasis underlined ] diff --git a/src/Microdown-RichTextComposer-Tests/MicRichTextFormatConfigurationTest.class.st b/src/Microdown-RichTextComposer-Tests/MicRichTextFormatConfigurationTest.class.st index 8daace63..eb63d587 100644 --- a/src/Microdown-RichTextComposer-Tests/MicRichTextFormatConfigurationTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicRichTextFormatConfigurationTest.class.st @@ -2,17 +2,19 @@ A MicRichTextFormatConfigurationTest is a test class for testing the behavior of MicRichTextFormatConfiguration " Class { - #name : #MicRichTextFormatConfigurationTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicRichTextFormatConfigurationTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #helpers } +{ #category : 'helpers' } MicRichTextFormatConfigurationTest >> fontString [ ^ TextStyle defaultFont familyName,';72' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testBodyFont [ | richText | richText := Microdown asRichText: ' @@ -24,7 +26,7 @@ foo bar' copyReplaceAll: '$font$' with: self fontString). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testBullets [ | src richText | src := '{!richtext|bullets=◊»!} @@ -35,7 +37,7 @@ MicRichTextFormatConfigurationTest >> testBullets [ self assert: (richText asString includesSubstring: '» bbb') ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testChangingSameStyler [ | src richText | "Test that the same styler is changed" @@ -55,7 +57,7 @@ Header 2 last line' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testCounters [ | src richText | src := '{!richtext|counters=A1!} @@ -66,7 +68,7 @@ MicRichTextFormatConfigurationTest >> testCounters [ self assert: (richText asString includesSubstring: '1. bbb') ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testHeader1 [ | src richText | src := '{!richtext|headerFont1=$font$!} @@ -76,7 +78,7 @@ MicRichTextFormatConfigurationTest >> testHeader1 [ self assert: (richText asMorph height > 100). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testHeader2 [ | src richText | src := '{!richtext|headerFont2=$font$!} @@ -86,7 +88,7 @@ MicRichTextFormatConfigurationTest >> testHeader2 [ self assert: (richText asMorph height > 100). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testHeader3 [ | src richText | src := '{!richtext|headerFont3=$font$!} @@ -96,7 +98,7 @@ MicRichTextFormatConfigurationTest >> testHeader3 [ self assert: (richText asMorph height > 100). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testHeader4 [ | src richText | src := '{!richtext|headerFont4=$font$!} @@ -106,7 +108,7 @@ MicRichTextFormatConfigurationTest >> testHeader4 [ self assert: (richText asMorph height > 100). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testHeader5 [ | src richText | src := '{!richtext|headerFont5=$font$!} @@ -116,7 +118,7 @@ MicRichTextFormatConfigurationTest >> testHeader5 [ self assert: (richText asMorph height > 100). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testHeader6 [ | src richText | src := '{!richtext|headerFont6=$font$!} @@ -126,7 +128,7 @@ MicRichTextFormatConfigurationTest >> testHeader6 [ self assert: (richText asMorph height > 100). ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testIllegalArgument [ | src richText | src := '{!richtext|foo=bar!}'. @@ -134,7 +136,7 @@ MicRichTextFormatConfigurationTest >> testIllegalArgument [ self assert: richText asString equals: 'richtext annotation - unknown argument: foo' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testInterBlockSpacing [ | src richText | src := '{!richtext|interBlockSpacing=0!}fooo @@ -146,7 +148,7 @@ boo'. self assert: (richText asString lines size) equals: 3 ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testInterBlockSpacing_three [ | src richText | src := '{!richtext|interBlockSpacing=3!}fooo @@ -158,7 +160,7 @@ boo'. self assert: (richText asString lines size) equals: 7 ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testNewLineIfNotAlready [ | src richText | "newLineIfNotAlready mostely makes sense if interBlockSpacing is 0" @@ -172,7 +174,7 @@ bar'. bar' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextFormatConfigurationTest >> testSpaceAfterHeader [ | src richText | src := '{!richtext|crAfterHeader=2;2;1;1!} diff --git a/src/Microdown-RichTextComposer-Tests/MicRichTextLinkPresenterTest.class.st b/src/Microdown-RichTextComposer-Tests/MicRichTextLinkPresenterTest.class.st index a4fedbb9..1938fb87 100644 --- a/src/Microdown-RichTextComposer-Tests/MicRichTextLinkPresenterTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicRichTextLinkPresenterTest.class.st @@ -2,21 +2,23 @@ A MicRichTextLinkPresenterTest is a test class for testing the behavior of MicRichTextLinkPresenter " Class { - #name : #MicRichTextLinkPresenterTest, - #superclass : #TestCase, + #name : 'MicRichTextLinkPresenterTest', + #superclass : 'TestCase', #instVars : [ 'linkPresenter' ], - #category : #'Microdown-RichTextComposer-Tests-Composer' + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #running } +{ #category : 'running' } MicRichTextLinkPresenterTest >> setUp [ super setUp. linkPresenter := MicRichTextLinkPresenter new. ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextLinkPresenterTest >> testGuessKindOf [ "Testing default" | ref file | @@ -26,7 +28,7 @@ MicRichTextLinkPresenterTest >> testGuessKindOf [ self assert: (linkPresenter guessKindOf: ref) equals: 'md' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextLinkPresenterTest >> testGuessKindOf_html [ "Testing default" | ref file | @@ -36,7 +38,7 @@ MicRichTextLinkPresenterTest >> testGuessKindOf_html [ self assert: (linkPresenter guessKindOf: ref) equals: 'html' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextLinkPresenterTest >> testGuessKindOf_html_with_comment [ "Testing default" | ref file | @@ -48,7 +50,7 @@ MicRichTextLinkPresenterTest >> testGuessKindOf_html_with_comment [ self assert: (linkPresenter guessKindOf: ref) equals: 'html' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextLinkPresenterTest >> testGuessKindOf_withExtension [ "Testing default" | ref file | @@ -57,7 +59,7 @@ MicRichTextLinkPresenterTest >> testGuessKindOf_withExtension [ self assert: (linkPresenter guessKindOf: ref) equals: 'foo' ] -{ #category : #tests } +{ #category : 'tests' } MicRichTextLinkPresenterTest >> testPragmaForKind [ "Testing default" diff --git a/src/Microdown-RichTextComposer-Tests/MicRightAlignmentBlockTest.class.st b/src/Microdown-RichTextComposer-Tests/MicRightAlignmentBlockTest.class.st index cc591aab..3fdb680a 100644 --- a/src/Microdown-RichTextComposer-Tests/MicRightAlignmentBlockTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicRightAlignmentBlockTest.class.st @@ -2,12 +2,14 @@ A MicRightAllignmentBlockTest is a test class for testing the behavior of MicRightAllignmentBlock " Class { - #name : #MicRightAlignmentBlockTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-BlockExtensions' + #name : 'MicRightAlignmentBlockTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-BlockExtensions', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'BlockExtensions' } -{ #category : #tests } +{ #category : 'tests' } MicRightAlignmentBlockTest >> testRightAlignment [ | src doc center | src := ' diff --git a/src/Microdown-RichTextComposer-Tests/MicTemplatingTest.class.st b/src/Microdown-RichTextComposer-Tests/MicTemplatingTest.class.st index 0128685d..e5e650b4 100644 --- a/src/Microdown-RichTextComposer-Tests/MicTemplatingTest.class.st +++ b/src/Microdown-RichTextComposer-Tests/MicTemplatingTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicTemplatingTest, - #superclass : #TestCase, - #category : #'Microdown-RichTextComposer-Tests-Composer' + #name : 'MicTemplatingTest', + #superclass : 'TestCase', + #category : 'Microdown-RichTextComposer-Tests-Composer', + #package : 'Microdown-RichTextComposer-Tests', + #tag : 'Composer' } -{ #category : #tests } +{ #category : 'tests' } MicTemplatingTest >> testBaselineWithoutBaselineMethodShouldNotBreak [ diff --git a/src/Microdown-RichTextComposer-Tests/package.st b/src/Microdown-RichTextComposer-Tests/package.st index 15cd0f58..26637086 100644 --- a/src/Microdown-RichTextComposer-Tests/package.st +++ b/src/Microdown-RichTextComposer-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-RichTextComposer-Tests' } +Package { #name : 'Microdown-RichTextComposer-Tests' } diff --git a/src/Microdown-RichTextComposer/Form.extension.st b/src/Microdown-RichTextComposer/Form.extension.st index d6807c73..d7fbbdbb 100644 --- a/src/Microdown-RichTextComposer/Form.extension.st +++ b/src/Microdown-RichTextComposer/Form.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Form } +Extension { #name : 'Form' } -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } Form >> asText [ "I return a text with myself embedded - Similar to Morph>>asText" ^ (String value: 1) asText addAttribute: (TextAnchor new anchoredMorph: self) diff --git a/src/Microdown-RichTextComposer/ManifestMicrodownRichTextComposer.class.st b/src/Microdown-RichTextComposer/ManifestMicrodownRichTextComposer.class.st index 8c604588..246c21cf 100644 --- a/src/Microdown-RichTextComposer/ManifestMicrodownRichTextComposer.class.st +++ b/src/Microdown-RichTextComposer/ManifestMicrodownRichTextComposer.class.st @@ -4,7 +4,9 @@ I am used to render class and package comments based on Microdown markup. The key class is `MicRichTextComposer` " Class { - #name : #ManifestMicrodownRichTextComposer, - #superclass : #PackageManifest, - #category : #'Microdown-RichTextComposer-Manifest' + #name : 'ManifestMicrodownRichTextComposer', + #superclass : 'PackageManifest', + #category : 'Microdown-RichTextComposer-Manifest', + #package : 'Microdown-RichTextComposer', + #tag : 'Manifest' } diff --git a/src/Microdown-RichTextComposer/MicCenterAlignmentBlock.class.st b/src/Microdown-RichTextComposer/MicCenterAlignmentBlock.class.st index 209d622c..207076bf 100644 --- a/src/Microdown-RichTextComposer/MicCenterAlignmentBlock.class.st +++ b/src/Microdown-RichTextComposer/MicCenterAlignmentBlock.class.st @@ -4,17 +4,19 @@ I implement a centering environment which can be rendered using RichText. !> " Class { - #name : #MicCenterAlignmentBlock, - #superclass : #MicEnvironmentBlock, - #category : #'Microdown-RichTextComposer-BlockExtensions' + #name : 'MicCenterAlignmentBlock', + #superclass : 'MicEnvironmentBlock', + #category : 'Microdown-RichTextComposer-BlockExtensions', + #package : 'Microdown-RichTextComposer', + #tag : 'BlockExtensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicCenterAlignmentBlock class >> tag [ ^ #center ] -{ #category : #visiting } +{ #category : 'visiting' } MicCenterAlignmentBlock >> accept: aVisitor [ ^ aVisitor visitCenter: self ] diff --git a/src/Microdown-RichTextComposer/MicDocumentHierarchyBuilder.class.st b/src/Microdown-RichTextComposer/MicDocumentHierarchyBuilder.class.st index 4e70f426..47c613c8 100644 --- a/src/Microdown-RichTextComposer/MicDocumentHierarchyBuilder.class.st +++ b/src/Microdown-RichTextComposer/MicDocumentHierarchyBuilder.class.st @@ -16,8 +16,8 @@ SpDocumentHierarchyBuilder new ``` " Class { - #name : #MicDocumentHierarchyBuilder, - #superclass : #Object, + #name : 'MicDocumentHierarchyBuilder', + #superclass : 'Object', #instVars : [ 'topClass', 'flattenTree', @@ -26,10 +26,11 @@ Class { 'class', 'fromClass' ], - #category : #'Microdown-RichTextComposer' + #category : 'Microdown-RichTextComposer', + #package : 'Microdown-RichTextComposer' } -{ #category : #private } +{ #category : 'private' } MicDocumentHierarchyBuilder >> addLevel: level from: aClass [ "'├ ─ ╰ │'" | path | @@ -61,7 +62,7 @@ MicDocumentHierarchyBuilder >> addLevel: level from: aClass [ from: each ] ] -{ #category : #private } +{ #category : 'private' } MicDocumentHierarchyBuilder >> addLevel: level from: aClass to: stream [ "'├ ─ ╰ │'" | path | @@ -90,14 +91,14 @@ MicDocumentHierarchyBuilder >> addLevel: level from: aClass to: stream [ to: stream ] ] -{ #category : #private } +{ #category : 'private' } MicDocumentHierarchyBuilder >> applyFilterTo: aCollection [ filterBlock ifNil: [ ^ aCollection ]. ^ aCollection select: filterBlock ] -{ #category : #building } +{ #category : 'building' } MicDocumentHierarchyBuilder >> buildFor: aClass [ self fillTreeOf: aClass. @@ -106,7 +107,7 @@ MicDocumentHierarchyBuilder >> buildFor: aClass [ from: self fromClass ] -{ #category : #building } +{ #category : 'building' } MicDocumentHierarchyBuilder >> buildStringFor: aClass [ self fillTreeOf: aClass. @@ -117,13 +118,13 @@ MicDocumentHierarchyBuilder >> buildStringFor: aClass [ to: (ZnNewLineWriterStream on: stream) ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentHierarchyBuilder >> builder: aBuilder [ builder := aBuilder ] -{ #category : #private } +{ #category : 'private' } MicDocumentHierarchyBuilder >> fillTreeOf: aClass [ class := aClass. @@ -134,7 +135,7 @@ MicDocumentHierarchyBuilder >> fillTreeOf: aClass [ ^ flattenTree ] -{ #category : #private } +{ #category : 'private' } MicDocumentHierarchyBuilder >> fillTreeWithSubclassesOf: aClass [ flattenTree at: aClass put: (self applyFilterTo: aClass subclasses). @@ -142,7 +143,7 @@ MicDocumentHierarchyBuilder >> fillTreeWithSubclassesOf: aClass [ self fillTreeWithSubclassesOf: each ] ] -{ #category : #private } +{ #category : 'private' } MicDocumentHierarchyBuilder >> fillTreeWithSuperclassesOf: aClass [ | superclasses | @@ -156,25 +157,25 @@ MicDocumentHierarchyBuilder >> fillTreeWithSuperclassesOf: aClass [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentHierarchyBuilder >> filter: aBlock [ filterBlock := aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentHierarchyBuilder >> fromClass [ ^ fromClass ifNil: [ SpAbstractPresenter ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentHierarchyBuilder >> fromClass: aClass [ fromClass := aClass ] -{ #category : #testing } +{ #category : 'testing' } MicDocumentHierarchyBuilder >> isPassingThrough: aClass topLevel: aTopClass [ | superclasses | @@ -185,13 +186,13 @@ MicDocumentHierarchyBuilder >> isPassingThrough: aClass topLevel: aTopClass [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentHierarchyBuilder >> topClass [ ^ topClass ifNil: [ self fromClass superclass ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentHierarchyBuilder >> topClass: aClass [ topClass := aClass diff --git a/src/Microdown-RichTextComposer/MicDynamicTextStyler.class.st b/src/Microdown-RichTextComposer/MicDynamicTextStyler.class.st index d147b788..1c0b7682 100644 --- a/src/Microdown-RichTextComposer/MicDynamicTextStyler.class.st +++ b/src/Microdown-RichTextComposer/MicDynamicTextStyler.class.st @@ -39,8 +39,8 @@ and very small body - back to first " Class { - #name : #MicDynamicTextStyler, - #superclass : #MicTextStyler, + #name : 'MicDynamicTextStyler', + #superclass : 'MicTextStyler', #instVars : [ 'bullets', 'counters', @@ -52,20 +52,22 @@ Class { 'keepCRFromInput', 'errors' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> addError: error [ errors add: error ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> bodyFont [ ^ bodyFont ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> bodyFont: fontSpec [ |list| list := (fontSpec splitOn: $;). @@ -76,19 +78,19 @@ MicDynamicTextStyler >> bodyFont: fontSpec [ pointSize: list second asNumber ] -{ #category : #initialization } +{ #category : 'initialization' } MicDynamicTextStyler >> bulletForLevel: level [ "outer level is 1, second level is 2, " ^ ( bullets at: ( (level - 1) % bullets size ) +1 ) asText. ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> bullets: anObject [ bullets := anObject ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> counterFor: counter atLevel: level [ | kind | "outer level is 1, second level is 2, " @@ -101,13 +103,13 @@ MicDynamicTextStyler >> counterFor: counter atLevel: level [ ifTrue: [ ^ ($A asInteger + (counter - 1)) asCharacter asText , ')' ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> counters: counterTypes [ "counter types are 1 (number), a (small letters), A (capital letters)" counters := counterTypes ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> crAfterHeader: spacingSpec [ "spacingSpec is a series of numbers 2;2;1;1 - which is the number of new lines to be added after headers of level1, level2 etc. 1's at the end can be omitted (2;2;1;1 is the same as 2;2)" @@ -117,22 +119,22 @@ MicDynamicTextStyler >> crAfterHeader: spacingSpec [ spacings doWithIndex: [ :elem :index |crAfterHeader at: index put: elem ] ] -{ #category : #initialization } +{ #category : 'initialization' } MicDynamicTextStyler >> crAfterHeaderLevel: level [ ^ String cr repeat: (crAfterHeader at: level) ] -{ #category : #initialization } +{ #category : 'initialization' } MicDynamicTextStyler >> crAfterHeaders [ ^ crAfterHeader ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> errors [ ^ errors ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> headerFont: fontString forLevel: level [ |list font| (level between: 1 and: 6) @@ -148,7 +150,7 @@ MicDynamicTextStyler >> headerFont: fontString forLevel: level [ put: (TextFontReference toFont:font) ] -{ #category : #initialization } +{ #category : 'initialization' } MicDynamicTextStyler >> initialize [ self computeHeaderFonts. "super rely on lazy initilization" errors := OrderedCollection new. @@ -162,40 +164,40 @@ MicDynamicTextStyler >> initialize [ keepCRFromInput := true. ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> interBlockSpacing [ ^ interBlockSpacing ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> interBlockSpacing: spacingSpec [ "I can put a number of cr between blocks. " interBlockSpacing := ((String cr) repeat: (spacingSpec asNumber)) asText ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> keepCRFromInput: aBooleanText [ "if aBooleanText is 'false', set keepCRFromInput to false. This will merge lines in text blocks to a single line" keepCRFromInput := aBooleanText ~= 'false' ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> monospaceBackgroundColor [ ^ monospaceBackgroundColor ] -{ #category : #accessing } +{ #category : 'accessing' } MicDynamicTextStyler >> monospaceBackgroundColor: colorString [ monospaceBackgroundColor := Color fromString: colorString ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> newLineIfNotAlready [ ^ newLineIfNotAlready ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> newLineIfNotAlready: spacingSpec [ "add extra newline or tab indentation of the following line" "spacingSpec is (cr|tab|space)* with ; as seperator - for example 'cr;tab'" @@ -210,7 +212,7 @@ MicDynamicTextStyler >> newLineIfNotAlready: spacingSpec [ newLineIfNotAlready := spacing asText ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicDynamicTextStyler >> postTextTreatment: aText [ "my primary purpose is to replace newLines with space in some styles" keepCRFromInput ifTrue: [ ^ aText ]. diff --git a/src/Microdown-RichTextComposer/MicRichTextBrush.class.st b/src/Microdown-RichTextComposer/MicRichTextBrush.class.st index a34a4d09..b09562a0 100644 --- a/src/Microdown-RichTextComposer/MicRichTextBrush.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextBrush.class.st @@ -4,49 +4,51 @@ I am a brush in the canvas-brush pattern. I represent one kind of `TextAttribute` to be added to a `Text`. " Class { - #name : #MicRichTextBrush, - #superclass : #Object, + #name : 'MicRichTextBrush', + #superclass : 'Object', #instVars : [ 'canvas', 'attribute' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicRichTextBrush class >> on: canvas [ ^self new canvas: canvas ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicRichTextBrush class >> on: canvas attribute: attr [ ^self new canvas: canvas; attribute: attr ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextBrush >> attribute [ ^ attribute ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextBrush >> attribute: anObject [ attribute := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextBrush >> canvas [ ^ canvas ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextBrush >> canvas: anObject [ canvas := anObject ] -{ #category : #paint } +{ #category : 'paint' } MicRichTextBrush >> paint: aText [ aText addAttribute: attribute ] diff --git a/src/Microdown-RichTextComposer/MicRichTextCanvas.class.st b/src/Microdown-RichTextComposer/MicRichTextCanvas.class.st index f7dc3195..3a855b27 100644 --- a/src/Microdown-RichTextComposer/MicRichTextCanvas.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextCanvas.class.st @@ -4,8 +4,8 @@ As texts can have multiple annotations, I have a stack of brushes to paint a tex My only method for adding text to my stream is `<<`. " Class { - #name : #MicRichTextCanvas, - #superclass : #Object, + #name : 'MicRichTextCanvas', + #superclass : 'Object', #instVars : [ 'out', 'brushes', @@ -13,10 +13,12 @@ Class { 'crAtEnd', 'textStyler' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> << aText [ |text| aText ifEmpty: [ ^ self ]. @@ -30,30 +32,30 @@ MicRichTextCanvas >> << aText [ text ifNotEmpty: [crAtEnd := text last = Character cr]. ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> contents [ ^ out contents ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> cr [ self newLine ] -{ #category : #testing } +{ #category : 'testing' } MicRichTextCanvas >> hasFontDefinitions: aText [ "Answer the fontfor characters in the run beginning at characterIndex." ^ (aText runs flattened asSet select: [ :attr | attr isKindOf: TextFontReference ]) isNotEmpty. ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> includeAttribute: attr in: aBlock [ brushes addLast: (MicRichTextBrush on: self attribute: attr). aBlock value. brushes removeLast ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> includeBrush: aBrush in: aBlock [ "Add for the course of aBlock, a brush (aBrush) to the currently used brushes." brushes addLast: aBrush. @@ -61,7 +63,7 @@ MicRichTextCanvas >> includeBrush: aBrush in: aBlock [ brushes removeLast ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> indentIn: aBlock [ nesting := nesting + 1. aBlock value. @@ -70,7 +72,7 @@ MicRichTextCanvas >> indentIn: aBlock [ ] -{ #category : #initialization } +{ #category : 'initialization' } MicRichTextCanvas >> initialize [ super initialize. out := WriteStream on: '' asText. @@ -79,41 +81,41 @@ MicRichTextCanvas >> initialize [ crAtEnd := true. "Prevent newlines in beginning" ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCanvas >> nesting [ ^ nesting ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> newLine [ self newLineBody. crAtEnd := true ] -{ #category : #private } +{ #category : 'private' } MicRichTextCanvas >> newLineBody [ self << self textStyler newLineBody ] -{ #category : #public } +{ #category : 'public' } MicRichTextCanvas >> newLineIfNotAlready [ crAtEnd ifFalse: [ self << self textStyler newLineIfNotAlready ]. crAtEnd := true ] -{ #category : #private } +{ #category : 'private' } MicRichTextCanvas >> tab [ self << String tab asText ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCanvas >> textStyler [ ^ textStyler ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCanvas >> textStyler: anObject [ textStyler := anObject diff --git a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStyler.class.st b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStyler.class.st index da95ae17..bdee9b4a 100644 --- a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStyler.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStyler.class.st @@ -11,12 +11,14 @@ I will find a subclass matching `languageTag`. My subclasses identify tags it they will handle. " Class { - #name : #MicRichTextCodeBlockStyler, - #superclass : #Object, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextCodeBlockStyler', + #superclass : 'Object', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #documentation } +{ #category : 'documentation' } MicRichTextCodeBlockStyler class >> buildMicroDownUsing: aBuilder withComment: aComment [ super buildMicroDownUsing: aBuilder withComment: aComment. "Only add this list here, not in my subclasses" @@ -31,12 +33,12 @@ MicRichTextCodeBlockStyler class >> buildMicroDownUsing: aBuilder withComment: ]] ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStyler class >> styleTags [ ^ #() ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStyler class >> stylerFor: languageName [ ^ (self allSubclasses detect: [ :cl | (cl styleTags collect: #asLowercase) includes: languageName asLowercase ] @@ -44,7 +46,7 @@ MicRichTextCodeBlockStyler class >> stylerFor: languageName [ ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStyler >> style: sourceString [ ^ self subclassResponsibility ] diff --git a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerDefault.class.st b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerDefault.class.st index 41859658..a52743f9 100644 --- a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerDefault.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerDefault.class.st @@ -2,20 +2,23 @@ I am a class for formating codeblocks containing smalltalk code fragments " Class { - #name : #MicRichTextCodeBlockStylerDefault, - #superclass : #MicRichTextCodeBlockStyler, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextCodeBlockStylerDefault', + #superclass : 'MicRichTextCodeBlockStyler', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerDefault class >> styleTags [ ^ #(default pharo smalltalk) ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerDefault >> style: sourceString [ "I style a set of smalltalk expressions" - ^ MicSmalltalkTextStyler new - isForWorkspace: true; - styledTextFor: sourceString asText + + ^ MicSmalltalkTextStyler new + isScripting: true; + styledTextFor: sourceString asText ] diff --git a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerFullMethod.class.st b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerFullMethod.class.st index e2d070dc..28686a74 100644 --- a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerFullMethod.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerFullMethod.class.st @@ -2,17 +2,19 @@ I am a class for formating codeblocks containing smalltalk methods " Class { - #name : #MicRichTextCodeBlockStylerFullMethod, - #superclass : #MicRichTextCodeBlockStyler, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextCodeBlockStylerFullMethod', + #superclass : 'MicRichTextCodeBlockStyler', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerFullMethod class >> styleTags [ ^ #(method) ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerFullMethod >> style: sourceString [ | source styler ast | diff --git a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerUnstyledText.class.st b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerUnstyledText.class.st index d46131a4..be2fdc89 100644 --- a/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerUnstyledText.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextCodeBlockStylerUnstyledText.class.st @@ -2,17 +2,19 @@ I am a class for formating codeblocks containing plain text " Class { - #name : #MicRichTextCodeBlockStylerUnstyledText, - #superclass : #MicRichTextCodeBlockStyler, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextCodeBlockStylerUnstyledText', + #superclass : 'MicRichTextCodeBlockStyler', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerUnstyledText class >> styleTags [ ^ #(text) ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextCodeBlockStylerUnstyledText >> style: aString [ ^ aString asText diff --git a/src/Microdown-RichTextComposer/MicRichTextComposer.class.st b/src/Microdown-RichTextComposer/MicRichTextComposer.class.st index e2b377bf..db9ff9d0 100644 --- a/src/Microdown-RichTextComposer/MicRichTextComposer.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextComposer.class.st @@ -71,24 +71,26 @@ Monospaced text (e.g., `Point`, `Point class`, `Point>>#setX:setY:`, or `#'Pill " Class { - #name : #MicRichTextComposer, - #superclass : #MicrodownVisitor, + #name : 'MicRichTextComposer', + #superclass : 'MicrodownVisitor', #instVars : [ 'canvas', 'textStyler', 'codeStylerClass' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #public } +{ #category : 'public' } MicRichTextComposer class >> asRichText: aStringOrDoc [ ^ self new asRichText: aStringOrDoc ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown1 [ ^ self asRichText: '### Emphasis and lists @@ -108,7 +110,7 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 1. For the moment numbered lists always start with 1, and count upwards' ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown2 [ ^ self asRichText: @@ -140,7 +142,7 @@ textStyler: aString ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown3 [ ^ self asRichText: @@ -156,7 +158,7 @@ Here are direct links to classes and method And this is another line' ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown4 [ ^ self asRichText: @@ -173,7 +175,7 @@ Images can be used as anchors: ' ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown5 [ ^ self asRichText: @@ -187,7 +189,7 @@ MicRichTextComposer class >> exampleMicrodown5 [ ' ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown6 [ ^ self asRichText: @@ -202,7 +204,7 @@ Cool eh? ' ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown7 [ @@ -211,7 +213,7 @@ MicRichTextComposer class >> exampleMicrodown7 [ It is possible to use the icons in the image: ![Object class](pharo:///Object/iconNamed:/info)' ] -{ #category : #examples } +{ #category : 'examples' } MicRichTextComposer class >> exampleMicrodown8 [ ^ self asRichText: @@ -222,7 +224,7 @@ this is just _first_ line and this is the second line' ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> anchorFor: anImageOrMorph of: aNode [ aNode arguments at: #width ifPresent: [ :width | @@ -244,7 +246,7 @@ MicRichTextComposer >> anchorFor: anImageOrMorph of: aNode [ ^ TextAnchor new anchoredMorph: anImageOrMorph ] -{ #category : #public } +{ #category : 'public' } MicRichTextComposer >> asRichText: aStringOrDoc [ @@ -253,13 +255,13 @@ MicRichTextComposer >> asRichText: aStringOrDoc [ ifFalse: [ aStringOrDoc ]) ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextComposer >> codeStylerClass [ ^ codeStylerClass ] -{ #category : #private } +{ #category : 'private' } MicRichTextComposer >> doVisitCode: aCodeBlock [ self @@ -267,7 +269,7 @@ MicRichTextComposer >> doVisitCode: aCodeBlock [ code: aCodeBlock body ] -{ #category : #private } +{ #category : 'private' } MicRichTextComposer >> doVisitCode: aCodeBlock code: aStringOrText [ canvas indentIn: [ @@ -285,14 +287,14 @@ MicRichTextComposer >> doVisitCode: aCodeBlock code: aStringOrText [ canvas << textStyler interBlockSpacing ] -{ #category : #initialization } +{ #category : 'initialization' } MicRichTextComposer >> initialize [ super initialize. codeStylerClass := MicRichTextCodeBlockStyler. self textStyler: MicTextStyler new. ] -{ #category : #private } +{ #category : 'private' } MicRichTextComposer >> latexFor: aString onError: aBlock [ "Return a Text containing an image with the latex formula. @@ -310,13 +312,13 @@ MicRichTextComposer >> latexFor: aString onError: aBlock [ do: [^ aBlock value] ] -{ #category : #private } +{ #category : 'private' } MicRichTextComposer >> level [ "level is the logical indention level of lists. Outer list is indented 1, next is indented 3, etc." ^(canvas nesting // 2) +1 ] -{ #category : #private } +{ #category : 'private' } MicRichTextComposer >> renderTableCell: aCell [ "a cell is an array of nodes. Each element should be rendered and concatenated" ^ aCell inject: Text new into: [ :txt :part | @@ -324,20 +326,20 @@ MicRichTextComposer >> renderTableCell: aCell [ ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextComposer >> textStyler [ ^ textStyler ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextComposer >> textStyler: aTextStyler [ textStyler := aTextStyler. canvas ifNotNil: [ canvas textStyler: aTextStyler ] ] -{ #category : #private } +{ #category : 'private' } MicRichTextComposer >> textWithImage: anImage usingAnchor: anchor [ "return a text with an image embedded" | text | @@ -350,19 +352,19 @@ MicRichTextComposer >> textWithImage: anImage usingAnchor: anchor [ ^ ' ' asText , text, ' ' asText ] -{ #category : #initialization } +{ #category : 'initialization' } MicRichTextComposer >> theme [ ^ Smalltalk ui theme ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextComposer >> todo [ ^ 'there is too much hspace after a section when it is followed by a paragraph. This also because people will not want to to not let a newline between the header and paragraph when writing the text.' ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visit: aDocument [ canvas := MicRichTextCanvas new @@ -372,21 +374,21 @@ MicRichTextComposer >> visit: aDocument [ ^ canvas contents trim ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitAnnotatedParagraph: anAnnotatedParagraph [ "Do nothing - You are supposed to use specialized annotations" self error: 'You are not supposed to be here - did you misspell an annotation type?' ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitAnnotation: aMicAnnotationBlock [ "Environment is an abstract class, and if we end here it is because of error" canvas << ('>>> Annotation ''' , aMicAnnotationBlock name , ''' is not defined <<<') asText ] -{ #category : #'visiting - format' } +{ #category : 'visiting - format' } MicRichTextComposer >> visitBold: anObject [ canvas includeAttribute: TextEmphasis bold @@ -394,28 +396,28 @@ MicRichTextComposer >> visitBold: anObject [ ] -{ #category : #'visiting - extensions' } +{ #category : 'visiting - extensions' } MicRichTextComposer >> visitCenter: aMicCenterBlock [ canvas includeAttribute: TextAlignment centered in: [ super visitChildrenOf: aMicCenterBlock ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitCode: aCodeBlock [ canvas newLineIfNotAlready. self doVisitCode: aCodeBlock ] -{ #category : #'visiting - format' } +{ #category : 'visiting - format' } MicRichTextComposer >> visitColumn: columnBlock [ "I do nothing - handled by columns" ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitColumns: columnsBlock [ "I render the using MicRichTable which is dedicated to this. I insert the table as an image (form)" | columns columnsBlocks totalWidth| @@ -441,14 +443,14 @@ MicRichTextComposer >> visitColumns: columnsBlock [ << textStyler interBlockSpacing ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitEnvironment: aMicEnvironmentBlock [ "Environment is an abstract class, and if we end here it is because of error" canvas << ('>>> Environment ''' , aMicEnvironmentBlock environmentName , ''' is not defined <<<') asText ] -{ #category : #'visiting - inline elements' } +{ #category : 'visiting - inline elements' } MicRichTextComposer >> visitFigure: aFigure [ | image anchor| @@ -463,7 +465,7 @@ MicRichTextComposer >> visitFigure: aFigure [ do: [ :error | canvas << ('>>> ', error printString, ' <<<') ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitFootnote: aFootnote [ "Adds support for footnotes by use of BalloonMorph (because it is silly and retro)" | popAction popText | @@ -476,7 +478,7 @@ MicRichTextComposer >> visitFootnote: aFootnote [ canvas << popText ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitHeader: aHeader [ | level | canvas newLineIfNotAlready. @@ -487,7 +489,7 @@ MicRichTextComposer >> visitHeader: aHeader [ canvas << (textStyler crAfterHeaderLevel: level) ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitHorizontalLine: anHorizontalLine [ canvas newLineIfNotAlready. @@ -495,7 +497,7 @@ MicRichTextComposer >> visitHorizontalLine: anHorizontalLine [ canvas newLine. ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitInputFile: inputFileBloc [ | inputRef includedText | inputRef := inputFileBloc reference. @@ -505,14 +507,14 @@ MicRichTextComposer >> visitInputFile: inputFileBloc [ canvas << (textStyler postTextTreatment: includedText ) ] -{ #category : #'visiting - format' } +{ #category : 'visiting - format' } MicRichTextComposer >> visitItalic: anObject [ canvas includeAttribute: TextEmphasis italic in: [ super visitItalic: anObject ] ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitLink: aLink [ | attribute | @@ -523,7 +525,7 @@ MicRichTextComposer >> visitLink: aLink [ canvas includeAttribute: attribute in: [ super visitLink: aLink ] ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitLink_old: aLink [ | attribute | @@ -534,7 +536,7 @@ MicRichTextComposer >> visitLink_old: aLink [ canvas includeAttribute: attribute in: [ super visitLink: aLink ] ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicRichTextComposer >> visitListItem: anItem [ | bullet | "The depth counter and bullet type in `visitOrderedList` and `visitUnorderedList`" @@ -548,7 +550,7 @@ MicRichTextComposer >> visitListItem: anItem [ ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitMath: aMicMathEnvironment [ | aString | @@ -557,7 +559,7 @@ MicRichTextComposer >> visitMath: aMicMathEnvironment [ canvas << (self latexFor: aString onError: ['$$ - LATEX ERROR - $$' asText] ) ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitMathInline: aMicMathInline [ | aString | aString := aMicMathInline substring . @@ -565,7 +567,7 @@ MicRichTextComposer >> visitMathInline: aMicMathInline [ canvas << (self latexFor: aString onError: [ '$ - LATEX ERROR - $' asText ]) ] -{ #category : #'visiting - inline elements' } +{ #category : 'visiting - inline elements' } MicRichTextComposer >> visitMonospace: anObject [ "Notice - I add a highlight to the backgorund rather than mono-spaced." | backgroundColor sem | @@ -583,7 +585,7 @@ MicRichTextComposer >> visitMonospace: anObject [ ifFalse: [ super visitMonospace: anObject]]. ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicRichTextComposer >> visitOrderedList: aList [ "here we annotate items with their kind and the depth" | counter | @@ -601,7 +603,7 @@ MicRichTextComposer >> visitOrderedList: aList [ aList nestedLevel = 1 ifTrue: [ canvas << textStyler interBlockSpacing] ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitParagraph: anObject [ canvas newLineIfNotAlready. @@ -609,14 +611,14 @@ MicRichTextComposer >> visitParagraph: anObject [ canvas << textStyler interBlockSpacing ] -{ #category : #'visiting - document' } +{ #category : 'visiting - document' } MicRichTextComposer >> visitParameters: anObject [ "do nothing for now" ^ self ] -{ #category : #'visiting - extensions' } +{ #category : 'visiting - extensions' } MicRichTextComposer >> visitPharoEvaluator: aScriptBlock [ "I execute the body. I handle four types of results: Text - inserted verbatim @@ -651,7 +653,7 @@ MicRichTextComposer >> visitPharoEvaluator: aScriptBlock [ canvas newLineIfNotAlready ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitQuote: aQuote [ "I should have a fancier implementation, but for now this should work and be recognized as a quote" canvas newLineIfNotAlready. @@ -660,13 +662,13 @@ MicRichTextComposer >> visitQuote: aQuote [ canvas newLine ] -{ #category : #'visiting - inline elements' } +{ #category : 'visiting - inline elements' } MicRichTextComposer >> visitRaw: aRawFormat [ canvas << aRawFormat substring asText. ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitRichTextFormatConfiguration: config [ self textStyler class = MicDynamicTextStyler ifFalse: [ self textStyler: MicDynamicTextStyler new ]. @@ -676,14 +678,14 @@ MicRichTextComposer >> visitRichTextFormatConfiguration: config [ canvas << (errors joinUsing: String cr) ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextComposer >> visitRightAlignment: aMicRightAlignmentBlock [ canvas includeAttribute: TextAlignment rightFlush in: [ self visitChildrenOf: aMicRightAlignmentBlock ] ] -{ #category : #'visiting - extensions' } +{ #category : 'visiting - extensions' } MicRichTextComposer >> visitScript: aScriptBlock [ " I execute the body. I handle four types of results: Text - inserted verbatim @@ -713,7 +715,7 @@ MicRichTextComposer >> visitScript: aScriptBlock [ ] -{ #category : #'visiting - format' } +{ #category : 'visiting - format' } MicRichTextComposer >> visitStrike: anObject [ canvas @@ -721,7 +723,7 @@ MicRichTextComposer >> visitStrike: anObject [ in: [ super visitStrike: anObject ] ] -{ #category : #'visiting - format' } +{ #category : 'visiting - format' } MicRichTextComposer >> visitTable: tableBlock [ "I render the using MicRichTable which is dedicated to this. I insert the table as an image (form)" | headers rows table anchoredTable renderedRows | @@ -748,7 +750,7 @@ MicRichTextComposer >> visitTable: tableBlock [ ] -{ #category : #'visiting - format' } +{ #category : 'visiting - format' } MicRichTextComposer >> visitText: anInlineBlock [ "we should set attribute because it would override link and others." |text| @@ -756,7 +758,7 @@ MicRichTextComposer >> visitText: anInlineBlock [ canvas << (textStyler postTextTreatment: text ) ] -{ #category : #'visiting - list' } +{ #category : 'visiting - list' } MicRichTextComposer >> visitUnorderedList: aList [ canvas newLineIfNotAlready. canvas diff --git a/src/Microdown-RichTextComposer/MicRichTextDoIt.class.st b/src/Microdown-RichTextComposer/MicRichTextDoIt.class.st index 3f30bb62..efba5be0 100644 --- a/src/Microdown-RichTextComposer/MicRichTextDoIt.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextDoIt.class.st @@ -2,12 +2,14 @@ An extension of TextDoIt attribute to be used to display executable code (in the evaluator). " Class { - #name : #MicRichTextDoIt, - #superclass : #TextDoIt, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextDoIt', + #superclass : 'TextDoIt', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #scanning } +{ #category : 'scanning' } MicRichTextDoIt >> emphasizeScanner: scanner [ "Skip emphasis" ] diff --git a/src/Microdown-RichTextComposer/MicRichTextFormatConfiguration.class.st b/src/Microdown-RichTextComposer/MicRichTextFormatConfiguration.class.st index f858889e..a4b45adb 100644 --- a/src/Microdown-RichTextComposer/MicRichTextFormatConfiguration.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextFormatConfiguration.class.st @@ -17,22 +17,24 @@ I support the following arguments: {!richtext|bullets=◊»!} - spaceAfterHeader " Class { - #name : #MicRichTextFormatConfiguration, - #superclass : #MicAnnotationBlock, - #category : #'Microdown-RichTextComposer-BlockExtensions' + #name : 'MicRichTextFormatConfiguration', + #superclass : 'MicAnnotationBlock', + #category : 'Microdown-RichTextComposer-BlockExtensions', + #package : 'Microdown-RichTextComposer', + #tag : 'BlockExtensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextFormatConfiguration class >> tag [ ^ #richtext ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextFormatConfiguration >> accept: visitor [ visitor visitRichTextFormatConfiguration: self ] -{ #category : #visiting } +{ #category : 'visiting' } MicRichTextFormatConfiguration >> adjustStyler: styler [ | setters | setters := self setterDictionaryFor: styler. @@ -43,7 +45,7 @@ MicRichTextFormatConfiguration >> adjustStyler: styler [ ]. ] -{ #category : #private } +{ #category : 'private' } MicRichTextFormatConfiguration >> setterDictionaryFor: styler [ ^ { 'bullets' -> [ :a | styler bullets: a]. diff --git a/src/Microdown-RichTextComposer/MicRichTextIndentBrush.class.st b/src/Microdown-RichTextComposer/MicRichTextIndentBrush.class.st index e1062c13..0eb7c0ee 100644 --- a/src/Microdown-RichTextComposer/MicRichTextIndentBrush.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextIndentBrush.class.st @@ -2,12 +2,14 @@ I am a Brush that paints the `TextIndent` on a `Text`. The actual value of the indent is picked up from the canvas. " Class { - #name : #MicRichTextIndentBrush, - #superclass : #MicRichTextBrush, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextIndentBrush', + #superclass : 'MicRichTextBrush', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #paint } +{ #category : 'paint' } MicRichTextIndentBrush >> paint: aText [ canvas nesting isZero ifFalse: [ aText addAttribute: (TextIndent tabs: canvas nesting) ] diff --git a/src/Microdown-RichTextComposer/MicRichTextLinkPresenter.class.st b/src/Microdown-RichTextComposer/MicRichTextLinkPresenter.class.st index e1a8b993..5a2a1294 100644 --- a/src/Microdown-RichTextComposer/MicRichTextLinkPresenter.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextLinkPresenter.class.st @@ -18,12 +18,14 @@ A link to the microdown Relative references must be resolved before invoking this presenter. " Class { - #name : #MicRichTextLinkPresenter, - #superclass : #Object, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicRichTextLinkPresenter', + #superclass : 'Object', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #opening } +{ #category : 'opening' } MicRichTextLinkPresenter >> guessKindOf: aMicAbsoluteResourceReference [ |kind| kind := aMicAbsoluteResourceReference path copyAfterLast: $. . @@ -35,7 +37,7 @@ MicRichTextLinkPresenter >> guessKindOf: aMicAbsoluteResourceReference [ ] -{ #category : #opening } +{ #category : 'opening' } MicRichTextLinkPresenter >> openFormOn: aMicResourceReference [ |image window | image := aMicResourceReference loadImage. @@ -48,7 +50,7 @@ MicRichTextLinkPresenter >> openFormOn: aMicResourceReference [ open. ] -{ #category : #opening } +{ #category : 'opening' } MicRichTextLinkPresenter >> openLink: anAbsoluteResourceReference [ | kind | anAbsoluteResourceReference isRelative @@ -65,12 +67,12 @@ MicRichTextLinkPresenter >> openLink: anAbsoluteResourceReference [ ] -{ #category : #opening } +{ #category : 'opening' } MicRichTextLinkPresenter >> openWebLink: aHtmlResource [ WebBrowser openOn: aHtmlResource uri ] -{ #category : #opening } +{ #category : 'opening' } MicRichTextLinkPresenter >> pragmaForKind: kind [ | implementation | implementation := (Pragma allNamed: #richtextlinkpresenter:) @@ -78,7 +80,7 @@ MicRichTextLinkPresenter >> pragmaForKind: kind [ ^ implementation ] -{ #category : #opening } +{ #category : 'opening' } MicRichTextLinkPresenter >> resolveKind: kind andOpen: aMicHTTPResourceReference [ "I will check if there is an implementation which would like to handle this kind. If so, handle it, if not return false" diff --git a/src/Microdown-RichTextComposer/MicRichTextTable.class.st b/src/Microdown-RichTextComposer/MicRichTextTable.class.st index e5a8b893..1e084bd8 100644 --- a/src/Microdown-RichTextComposer/MicRichTextTable.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextTable.class.st @@ -2,18 +2,20 @@ I am a Morphic table used by `MicRichTextComposer>>visitTable:` to render tables. I serve no other purpose. " Class { - #name : #MicRichTextTable, - #superclass : #FTTableMorph, - #category : #'Microdown-RichTextComposer-Table-Support' + #name : 'MicRichTextTable', + #superclass : 'FTTableMorph', + #category : 'Microdown-RichTextComposer-Table-Support', + #package : 'Microdown-RichTextComposer', + #tag : 'Table-Support' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicRichTextTable class >> headers: headers rows: rows [ "headers is an array of column names, and rows are an array of array of string" ^ self new headers: headers rows: rows ] -{ #category : #adding } +{ #category : 'adding' } MicRichTextTable >> addHeaders: headers with: renderedRows [ |totalWidth totalHeight | totalWidth := 0. @@ -32,7 +34,7 @@ MicRichTextTable >> addHeaders: headers with: renderedRows [ self extent: (totalWidth + (headers size * 5)) @ (totalHeight+(renderedRows size +1 *5) ) ] -{ #category : #initialization } +{ #category : 'initialization' } MicRichTextTable >> headers: headers rows: rows [ self addHeaders: headers with: rows ; @@ -42,7 +44,7 @@ MicRichTextTable >> headers: headers rows: rows [ ] -{ #category : #rendering } +{ #category : 'rendering' } MicRichTextTable >> renderCell: aCell [ "a cell is an array of nodes. Each element should be rendered and concatenated" ^ aCell inject: Text new into: [ :txt :part | @@ -50,7 +52,7 @@ MicRichTextTable >> renderCell: aCell [ ] ] -{ #category : #private } +{ #category : 'private' } MicRichTextTable >> resizeAllSubviews [ "This method is just like its super, except it prevents the vertical scroll bar to appear" self resizeContainer. diff --git a/src/Microdown-RichTextComposer/MicRichTextTableDataSource.class.st b/src/Microdown-RichTextComposer/MicRichTextTableDataSource.class.st index 51ab29fa..9541b53b 100644 --- a/src/Microdown-RichTextComposer/MicRichTextTableDataSource.class.st +++ b/src/Microdown-RichTextComposer/MicRichTextTableDataSource.class.st @@ -3,21 +3,23 @@ I am a morphic table datasource for rendering tables inside rich text. I serve only that one purpose. " Class { - #name : #MicRichTextTableDataSource, - #superclass : #FTSimpleDataSource, + #name : 'MicRichTextTableDataSource', + #superclass : 'FTSimpleDataSource', #instVars : [ 'colNames', 'rows' ], - #category : #'Microdown-RichTextComposer-Table-Support' + #category : 'Microdown-RichTextComposer-Table-Support', + #package : 'Microdown-RichTextComposer', + #tag : 'Table-Support' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicRichTextTableDataSource class >> headers: headers rows: theRows [ ^ self new headers: headers rows: theRows ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextTableDataSource >> basicHeaderCellFor: column [ | cell | column id ifNil: [ ^ nil ]. @@ -30,7 +32,7 @@ MicRichTextTableDataSource >> basicHeaderCellFor: column [ ^ cell ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextTableDataSource >> cellColumn: column row: rowIndex [ "Answer a morph with the cell view. I will probably return a FTCellMorph." | cell | @@ -40,47 +42,47 @@ MicRichTextTableDataSource >> cellColumn: column row: rowIndex [ yourself ] -{ #category : #private } +{ #category : 'private' } MicRichTextTableDataSource >> elementAt: rowIndex [ "I am a really important method for a DataSource. I take an index and I return an object that should be displayed in the table for the index." rows at: rowIndex ] -{ #category : #initialization } +{ #category : 'initialization' } MicRichTextTableDataSource >> headers: headers rows: theRows [ rows := theRows. colNames := Dictionary new. 1 to: headers size do: [ :index | colNames at: (headers at: index) put: index ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextTableDataSource >> numberOfRows [ "I return the number of elements I can display in the table when I am call." ^ rows size ] -{ #category : #accessing } +{ #category : 'accessing' } MicRichTextTableDataSource >> rowHeight: rowIndex [ ^ (rows at: rowIndex ) max: [ :cell | cell asTextMorph height ] ] -{ #category : #sorting } +{ #category : 'sorting' } MicRichTextTableDataSource >> sortElements: aSortFunction [ "This method should sort the elements of the datasource using the sort function as parameter." ^ self ] -{ #category : #sorting } +{ #category : 'sorting' } MicRichTextTableDataSource >> unsortElements [ "This method should return the elements in their initial state." ^ self ] -{ #category : #private } +{ #category : 'private' } MicRichTextTableDataSource >> widthOfText: txt [ |width| width := ((txt fontAt: 1) widthOfStringOrText: txt). diff --git a/src/Microdown-RichTextComposer/MicRightAlignmentBlock.class.st b/src/Microdown-RichTextComposer/MicRightAlignmentBlock.class.st index dd19144b..65c44c68 100644 --- a/src/Microdown-RichTextComposer/MicRightAlignmentBlock.class.st +++ b/src/Microdown-RichTextComposer/MicRightAlignmentBlock.class.st @@ -4,17 +4,19 @@ I implement a right allignment block for RichText !> " Class { - #name : #MicRightAlignmentBlock, - #superclass : #MicEnvironmentBlock, - #category : #'Microdown-RichTextComposer-BlockExtensions' + #name : 'MicRightAlignmentBlock', + #superclass : 'MicEnvironmentBlock', + #category : 'Microdown-RichTextComposer-BlockExtensions', + #package : 'Microdown-RichTextComposer', + #tag : 'BlockExtensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicRightAlignmentBlock class >> tag [ ^ #right ] -{ #category : #visiting } +{ #category : 'visiting' } MicRightAlignmentBlock >> accept: aVisitor [ ^ aVisitor visitRightAlignment: self ] diff --git a/src/Microdown-RichTextComposer/MicScalingTextAnchor.class.st b/src/Microdown-RichTextComposer/MicScalingTextAnchor.class.st index a531c163..6982bb74 100644 --- a/src/Microdown-RichTextComposer/MicScalingTextAnchor.class.st +++ b/src/Microdown-RichTextComposer/MicScalingTextAnchor.class.st @@ -11,47 +11,49 @@ optionally one can freeze the height of the embedded image. This is mostly usefu New width is given by targetWidth: - this is not a user function, but is called by the scaling mechanism. " Class { - #name : #MicScalingTextAnchor, - #superclass : #TextAnchor, + #name : 'MicScalingTextAnchor', + #superclass : 'TextAnchor', #instVars : [ 'original', 'scale', 'freezeHeight' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #accessing } +{ #category : 'accessing' } MicScalingTextAnchor >> freezeHeight [ ^ freezeHeight ] -{ #category : #accessing } +{ #category : 'accessing' } MicScalingTextAnchor >> freezeHeight: anObject [ freezeHeight := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } MicScalingTextAnchor >> original [ ^ original ] -{ #category : #accessing } +{ #category : 'accessing' } MicScalingTextAnchor >> original: aForm [ original := aForm. anchoredMorph := aForm ] -{ #category : #accessing } +{ #category : 'accessing' } MicScalingTextAnchor >> scale: percentOrNil [ scale := percentOrNil ] -{ #category : #accessing } +{ #category : 'accessing' } MicScalingTextAnchor >> targetWidth: rightMargin [ | newWidth newHeight | diff --git a/src/Microdown-RichTextComposer/MicSemanticAction.class.st b/src/Microdown-RichTextComposer/MicSemanticAction.class.st index 425f115f..63237749 100644 --- a/src/Microdown-RichTextComposer/MicSemanticAction.class.st +++ b/src/Microdown-RichTextComposer/MicSemanticAction.class.st @@ -20,16 +20,18 @@ The following entities can be referenced. " Class { - #name : #MicSemanticAction, - #superclass : #Object, + #name : 'MicSemanticAction', + #superclass : 'Object', #instVars : [ 'entity', 'tokens' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction class >> from: aString [ | contents | @@ -37,12 +39,12 @@ MicSemanticAction class >> from: aString [ ^ self fromTokens: (contents collect: [ :e | e value ]) ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction class >> fromTokens: anArray [ ^ self new fromTokens: anArray; yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction >> computeEntity [ "Try to guess what the text is: Point @@ -75,12 +77,12 @@ MicSemanticAction >> computeEntity [ ifFalse: [ ^ self ] ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicSemanticAction >> entity [ ^ entity ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction >> fromTokens: anArray [ anArray ifEmpty: [ ^ self]. @@ -88,7 +90,7 @@ MicSemanticAction >> fromTokens: anArray [ self computeEntity. ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction >> getClassOrNil [ self class environment @@ -99,7 +101,7 @@ MicSemanticAction >> getClassOrNil [ ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction >> getCompiledMethodFrom: start [ " @@ -116,7 +118,7 @@ MicSemanticAction >> getCompiledMethodFrom: start [ ifAbsent: [ entity := nil ] ] ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction >> getMetaClassOrNil [ self class environment @@ -130,19 +132,19 @@ MicSemanticAction >> getMetaClassOrNil [ ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSemanticAction >> getPackageOrNil [ entity := RPackageOrganizer default packageNamed: tokens first asString ifAbsent: [ nil ]. ^ entity ] -{ #category : #testing } +{ #category : 'testing' } MicSemanticAction >> hasEntity [ ^ entity isNotNil ] -{ #category : #accessing } +{ #category : 'accessing' } MicSemanticAction >> tokens: aCol [ tokens := aCol diff --git a/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st b/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st index c31042a0..90bd7e4c 100644 --- a/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st +++ b/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st @@ -3,12 +3,14 @@ I am a smalltalk code styler which renders undefined variables and methods same I am used to render smalltalk codeblocks. " Class { - #name : #MicSmalltalkTextStyler, - #superclass : #SHRBTextStyler, - #category : #'Microdown-RichTextComposer-Composer' + #name : 'MicSmalltalkTextStyler', + #superclass : 'SHRBTextStyler', + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #attributes } +{ #category : 'attributes' } MicSmalltalkTextStyler class >> initialTextAttributesForPixelHeight: aNumber [ "Render undefined same way as defined" @@ -21,7 +23,7 @@ MicSmalltalkTextStyler class >> initialTextAttributesForPixelHeight: aNumber [ ^ dict ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } MicSmalltalkTextStyler class >> initialize [ "I have my own set of class side variables. I should not, but alas, so it is" "do not super initialize, that whould interfer with settings" @@ -30,7 +32,7 @@ MicSmalltalkTextStyler class >> initialize [ textAttributesByPixelHeight := nil. ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicSmalltalkTextStyler class >> new [ "I need to stay in sync with my superclass, so I initilize on each instantiation. Performance says a few micro seconds, so OK" self styleTable = SHRBTextStyler styleTable "style table was changed" @@ -38,14 +40,14 @@ MicSmalltalkTextStyler class >> new [ ^ super new ] -{ #category : #private } +{ #category : 'private' } MicSmalltalkTextStyler >> resolveStyleFor: aVariableNode [ "This circumvent an error in my super" aVariableNode isUndeclaredVariable ifTrue: [ ^#undefinedIdentifier ]. ^ super resolveStyleFor: aVariableNode ] -{ #category : #styling } +{ #category : 'styling' } MicSmalltalkTextStyler >> styledTextFor: aText [ aText ifEmpty: [ ^ aText ]. ^self privateStyle: aText diff --git a/src/Microdown-RichTextComposer/MicTextStyler.class.st b/src/Microdown-RichTextComposer/MicTextStyler.class.st index 5c49b9fb..692bca30 100644 --- a/src/Microdown-RichTextComposer/MicTextStyler.class.st +++ b/src/Microdown-RichTextComposer/MicTextStyler.class.st @@ -6,26 +6,28 @@ I control heading sizes and bullets. I am defining all these in methods, so to override and do something different, make a subclass of me and set `MicRichTextComposer` to use your new subclass (using `MicRichTextComposer>>textStyler:`). " Class { - #name : #MicTextStyler, - #superclass : #Object, + #name : 'MicTextStyler', + #superclass : 'Object', #instVars : [ 'headerFonts' ], - #category : #'Microdown-RichTextComposer-Composer' + #category : 'Microdown-RichTextComposer-Composer', + #package : 'Microdown-RichTextComposer', + #tag : 'Composer' } -{ #category : #'presenter styles' } +{ #category : 'presenter styles' } MicTextStyler >> bodyFont [ ^ nil ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicTextStyler >> bulletForLevel: level [ "first level is 1, then 2, then 3..." ^ ('•-' at: (level-1 % 2)+1) asText ] -{ #category : #private } +{ #category : 'private' } MicTextStyler >> computeHeaderFonts [ headerFonts := Array new: self headerFontSizes size. @@ -39,7 +41,7 @@ MicTextStyler >> computeHeaderFonts [ ] ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicTextStyler >> counterFor: counter atLevel: level [ | kind | "first level is 1" @@ -52,49 +54,49 @@ MicTextStyler >> counterFor: counter atLevel: level [ ifTrue: [ ^ ($a asInteger + (counter - 1)) asCharacter asText , ')' ] ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicTextStyler >> crAfterHeaderLevel: level [ "I return Text to make space after a header" ^ String cr asText ] -{ #category : #public } +{ #category : 'public' } MicTextStyler >> headerFontSizes [ ^ #(28 24 18 14 12 10) ] -{ #category : #private } +{ #category : 'private' } MicTextStyler >> headerLevelFont: level [ "I return a font annotation to be used with Attributes" headerFonts ifNil: [ self computeHeaderFonts ]. ^ headerFonts at: (level min: 6) ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicTextStyler >> interBlockSpacing [ "I return the space to be put between blocks, first cr to end block, second to make empty line" ^ (String cr, String cr) asText ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicTextStyler >> monospaceBackgroundColor [ ^ Smalltalk ui theme settings windowColor ] -{ #category : #'canvas styles' } +{ #category : 'canvas styles' } MicTextStyler >> newLineBody [ "return a newline" ^ String cr asText ] -{ #category : #'canvas styles' } +{ #category : 'canvas styles' } MicTextStyler >> newLineIfNotAlready [ "return a newline if there is not already one" "Intended to be overridden to add extra newline or tab indentation of the following line" ^ String cr asText ] -{ #category : #'composer styles' } +{ #category : 'composer styles' } MicTextStyler >> postTextTreatment: aText [ "my primary purpose is to replace newLines with space in some styles" "((1 to: aText size) diff --git a/src/Microdown-RichTextComposer/MicrodownParser.extension.st b/src/Microdown-RichTextComposer/MicrodownParser.extension.st index d8b271d9..ca23a5a9 100644 --- a/src/Microdown-RichTextComposer/MicrodownParser.extension.st +++ b/src/Microdown-RichTextComposer/MicrodownParser.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicrodownParser } +Extension { #name : 'MicrodownParser' } -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } MicrodownParser class >> convertToRichText: aString [ ^ MicRichTextComposer new visit: (self new parse: aString) ] diff --git a/src/Microdown-RichTextComposer/MicrodownVisitor.extension.st b/src/Microdown-RichTextComposer/MicrodownVisitor.extension.st index 9d73589e..31f3061c 100644 --- a/src/Microdown-RichTextComposer/MicrodownVisitor.extension.st +++ b/src/Microdown-RichTextComposer/MicrodownVisitor.extension.st @@ -1,16 +1,16 @@ -Extension { #name : #MicrodownVisitor } +Extension { #name : 'MicrodownVisitor' } -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } MicrodownVisitor >> visitCenter: aMicCenterBlock [ self visitEnvironment: aMicCenterBlock ] -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } MicrodownVisitor >> visitRichTextFormatConfiguration: config [ self visitAnnotation: config ] -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } MicrodownVisitor >> visitRightAlignment: aMicRightAlignmentBlock [ self visitEnvironment: aMicRightAlignmentBlock ] diff --git a/src/Microdown-RichTextComposer/OrderedCollection.extension.st b/src/Microdown-RichTextComposer/OrderedCollection.extension.st index 2817d005..a7b075d1 100644 --- a/src/Microdown-RichTextComposer/OrderedCollection.extension.st +++ b/src/Microdown-RichTextComposer/OrderedCollection.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #OrderedCollection } +Extension { #name : 'OrderedCollection' } -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } OrderedCollection >> truncateTo: smallSize [ "return myself or a copy shortened to smallSize." diff --git a/src/Microdown-RichTextComposer/Text.extension.st b/src/Microdown-RichTextComposer/Text.extension.st index d06274fe..78d9d514 100644 --- a/src/Microdown-RichTextComposer/Text.extension.st +++ b/src/Microdown-RichTextComposer/Text.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Text } +Extension { #name : 'Text' } -{ #category : #'*Microdown-RichTextComposer' } +{ #category : '*Microdown-RichTextComposer' } Text >> trim [ | left right | left := 1. diff --git a/src/Microdown-RichTextComposer/package.st b/src/Microdown-RichTextComposer/package.st index 910bd168..a329ebc3 100644 --- a/src/Microdown-RichTextComposer/package.st +++ b/src/Microdown-RichTextComposer/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-RichTextComposer' } +Package { #name : 'Microdown-RichTextComposer' } diff --git a/src/Microdown-Tests/ManifestMicrodownTests.class.st b/src/Microdown-Tests/ManifestMicrodownTests.class.st index 33cf3caa..2b339e05 100644 --- a/src/Microdown-Tests/ManifestMicrodownTests.class.st +++ b/src/Microdown-Tests/ManifestMicrodownTests.class.st @@ -2,7 +2,9 @@ I have test for the core classes of Microdown. " Class { - #name : #ManifestMicrodownTests, - #superclass : #PackageManifest, - #category : #'Microdown-Tests-Manifest' + #name : 'ManifestMicrodownTests', + #superclass : 'PackageManifest', + #category : 'Microdown-Tests-Manifest', + #package : 'Microdown-Tests', + #tag : 'Manifest' } diff --git a/src/Microdown-Tests/MicAnchorBlockTest.class.st b/src/Microdown-Tests/MicAnchorBlockTest.class.st index bee67de7..b1769227 100644 --- a/src/Microdown-Tests/MicAnchorBlockTest.class.st +++ b/src/Microdown-Tests/MicAnchorBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicAnchorBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicAnchorBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicAnchorBlockTest >> subjectClass [ ^ MicAnchorBlock ] -{ #category : #tests } +{ #category : 'tests' } MicAnchorBlockTest >> testModifyLabel [ | mic | mic := (parser parse: '@label') children first. diff --git a/src/Microdown-Tests/MicAnchorLinkerTest.class.st b/src/Microdown-Tests/MicAnchorLinkerTest.class.st index 2665bfa7..2ec4da6e 100644 --- a/src/Microdown-Tests/MicAnchorLinkerTest.class.st +++ b/src/Microdown-Tests/MicAnchorLinkerTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicAnchorLinkerTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Parser' + #name : 'MicAnchorLinkerTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicAnchorLinkerTest >> testAnchorIsAttachedToItsTarget [ | linker doc | linker := MicAnchorLinker new. @@ -20,7 +22,7 @@ this is a sentence ] -{ #category : #tests } +{ #category : 'tests' } MicAnchorLinkerTest >> testAnchorIsAttachedToItsTarget2 [ | linker doc | linker := MicAnchorLinker new. @@ -38,7 +40,7 @@ this is a sentence ] -{ #category : #tests } +{ #category : 'tests' } MicAnchorLinkerTest >> testHeaderLast [ | linker doc | linker := MicAnchorLinker new. diff --git a/src/Microdown-Tests/MicAnnotationSubclassTest.class.st b/src/Microdown-Tests/MicAnnotationSubclassTest.class.st index 7c7683ad..2aaef0ea 100644 --- a/src/Microdown-Tests/MicAnnotationSubclassTest.class.st +++ b/src/Microdown-Tests/MicAnnotationSubclassTest.class.st @@ -1,13 +1,15 @@ Class { - #name : #MicAnnotationSubclassTest, - #superclass : #TestCase, + #name : 'MicAnnotationSubclassTest', + #superclass : 'TestCase', #instVars : [ 'parser' ], - #category : #'Microdown-Tests-Extensions' + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #running } +{ #category : 'running' } MicAnnotationSubclassTest >> setUp [ super setUp. parser := Microdown new diff --git a/src/Microdown-Tests/MicArgumentsSplitterTest.class.st b/src/Microdown-Tests/MicArgumentsSplitterTest.class.st index 3a0d99f6..9936bdd3 100644 --- a/src/Microdown-Tests/MicArgumentsSplitterTest.class.st +++ b/src/Microdown-Tests/MicArgumentsSplitterTest.class.st @@ -2,36 +2,38 @@ A MicArgumentsSplitterTest is a test class for testing the behavior of MicArgumentsSplitter " Class { - #name : #MicArgumentsSplitterTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Parser' + #name : 'MicArgumentsSplitterTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #helpers } +{ #category : 'helpers' } MicArgumentsSplitterTest >> splitter [ ^ MicArgumentList ] -{ #category : #helpers } +{ #category : 'helpers' } MicArgumentsSplitterTest >> subjectUnderTestWith: aString [ ^ MicArgumentList withString: aString ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testArguments [ | subject | subject := self subjectUnderTestWith: 'foo=bar'. self assert: (subject at: #foo) equals: 'bar' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testCanInstantiate [ | subject | subject := self subjectUnderTestWith: 'bla'. self assert: (subject isNotNil) ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testDefaultWithEmptyInput [ | subject | subject := self splitter split: '' defaultArg: #language defaultValue: 'smalltalk'. @@ -41,7 +43,7 @@ MicArgumentsSplitterTest >> testDefaultWithEmptyInput [ self deny: subject hasNonDefaultArguments ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testDefaultWithNoValue [ | subject | subject := self splitter split: 'pharo' defaultArg: #language. @@ -50,7 +52,7 @@ MicArgumentsSplitterTest >> testDefaultWithNoValue [ self assert: (subject at: #language) equals: 'pharo' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testDefaultWithValue [ | subject | subject := self splitter split: 'pharo' defaultArg: #language defaultValue: #smalltalk. @@ -59,28 +61,28 @@ MicArgumentsSplitterTest >> testDefaultWithValue [ self assert: (subject at: #language) equals: 'pharo' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testEmpty [ | subject | subject := self subjectUnderTestWith: ''. self assert: subject size equals: 0. ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testFirstTag [ | subject | subject := self subjectUnderTestWith: 'bla'. self assert: (subject defaultValue) equals: 'bla' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testFirstTagWithDelimiter [ | subject | subject := self subjectUnderTestWith: 'foo|bar=99'. self assert: (subject defaultValue) equals: 'foo' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultArguments [ | subject | subject := self splitter split: '' defaultArg: #language. @@ -88,14 +90,14 @@ MicArgumentsSplitterTest >> testHasNonDefaultArguments [ self assert: subject hasNonDefaultArguments ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultArguments_no [ | subject | subject := self splitter split: '' defaultArg: #language. self deny: subject hasNonDefaultArguments ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultArguments_nonDefault [ | subject | subject := self splitter split: '' defaultArg: #language defaultValue: 'Pharo'. @@ -103,42 +105,42 @@ MicArgumentsSplitterTest >> testHasNonDefaultArguments_nonDefault [ self assert: subject hasNonDefaultArguments ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultValue [ | subject | subject := self splitter split: 'fortran' defaultArg: #language. self assert: subject hasNonDefaultValue ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultValue_AndSomeArgs [ | subject | subject := self splitter split: 'fortran|wasOnce=cool' defaultArg: #language. self assert: subject hasNonDefaultValue ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultValue_Default [ | subject | subject := self splitter split: '' defaultArg: #language defaultValue: 'pharo'. self deny: subject hasNonDefaultValue ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultValue_DefaultOverridden [ | subject | subject := self splitter split: 'fortran' defaultArg: #language defaultValue: 'pharo'. self assert: subject hasNonDefaultValue ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testHasNonDefaultValue_NoDefault [ | subject | subject := self splitter split: '' defaultArg: #language. self deny: subject hasNonDefaultValue ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testJustTheArguments [ | subject input | input := 'joe|foo=bar&aaa=bbb ccc&pip='. @@ -146,7 +148,7 @@ MicArgumentsSplitterTest >> testJustTheArguments [ self assert: subject justTheArguments printString equals: 'foo=bar&aaa=bbb ccc&pip=' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testJustTheArguments_NoDefault [ | subject input | input := 'foo=bar&aaa=bbb ccc&pip='. @@ -154,7 +156,7 @@ MicArgumentsSplitterTest >> testJustTheArguments_NoDefault [ self assert: subject justTheArguments printString equals: 'foo=bar&aaa=bbb ccc&pip=' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testNameAndArguments [ | subject | subject := self subjectUnderTestWith: 'aName|foo=bar'. @@ -162,14 +164,14 @@ MicArgumentsSplitterTest >> testNameAndArguments [ self assert: subject defaultValue equals: 'aName'. ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testNameWithDelimiter [ | subject | subject := self subjectUnderTestWith: 'fooName|bar=foe'. self assert: (subject defaultValue) equals: 'fooName' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testPrintString [ | subject input | input := 'joe|foo=bar&aaa=bbb ccc&pip='. @@ -177,7 +179,7 @@ MicArgumentsSplitterTest >> testPrintString [ self assert: subject printString equals: input ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testPrintString_AssignDefaultUsingEquals [ | subject input | input := 'language=fortran'. @@ -185,7 +187,7 @@ MicArgumentsSplitterTest >> testPrintString_AssignDefaultUsingEquals [ self assert: subject printString equals: 'fortran' ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testPrintString_Empty [ | subject input | input := ''. @@ -193,7 +195,7 @@ MicArgumentsSplitterTest >> testPrintString_Empty [ self assert: subject printString equals: input ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testPrintString_defaultValue [ | subject input | input := 'foo'. @@ -201,7 +203,7 @@ MicArgumentsSplitterTest >> testPrintString_defaultValue [ self assert: subject printString equals: input ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testPrintString_oneParam [ | subject input | input := 'foo=bar'. @@ -209,7 +211,7 @@ MicArgumentsSplitterTest >> testPrintString_oneParam [ self assert: subject printString equals: input ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testPrintString_onlyParams [ | subject input | input := 'foo=bar&a=b'. @@ -217,7 +219,7 @@ MicArgumentsSplitterTest >> testPrintString_onlyParams [ self assert: subject printString equals: input ] -{ #category : #tests } +{ #category : 'tests' } MicArgumentsSplitterTest >> testSeveralArguments [ | subject | subject := self subjectUnderTestWith: 'foo=bar&caption=this is lovely&aaa=99'. diff --git a/src/Microdown-Tests/MicBlockTest.class.st b/src/Microdown-Tests/MicBlockTest.class.st index 2891c313..67cefcae 100644 --- a/src/Microdown-Tests/MicBlockTest.class.st +++ b/src/Microdown-Tests/MicBlockTest.class.st @@ -1,30 +1,32 @@ Class { - #name : #MicBlockTest, - #superclass : #MicElementTest, + #name : 'MicBlockTest', + #superclass : 'MicElementTest', #instVars : [ 'subject' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #testing } +{ #category : 'testing' } MicBlockTest class >> isAbstract [ ^ self = MicBlockTest ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> subject [ ^ subject ifNil: [ subject := self subjectClass new ] ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> subjectClass [ ^ self subclassResponsibility ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> testHasProperty [ self deny: (self subject hasProperty: #foo). self subject propertyAt: #foo put: 'bar'. @@ -32,7 +34,7 @@ MicBlockTest >> testHasProperty [ self deny: (self subject hasProperty: #bar) ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> testProperties [ self assert: self subject properties isNotNil. self subject instVarNamed: 'properties' put: nil. @@ -50,21 +52,21 @@ MicBlockTest >> testProperties [ self subject instVarNamed: 'properties' put: nil ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> testPropertyAt [ self assert: (self subject propertyAt: #foo put: 'bar') equals: 'bar'. self assert: (self subject propertyAt: #foo) equals: 'bar'. self should: [ self subject propertyAt: #bar ] raise: MicPropertyError ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> testPropertyAtIfAbsent [ self assert: (self subject propertyAt: #foo put: 'bar') equals: 'bar'. self assert: (self subject propertyAt: #foo ifAbsent: [ 'baz' ]) equals: 'bar'. self assert: (self subject propertyAt: #bar ifAbsent: [ 'baz' ]) equals: 'baz' ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> testPropertyAtPut [ self subject propertyAt: #foo put: 'bar'. self assert: (self subject propertyAt: #foo) equals: 'bar'. @@ -73,7 +75,7 @@ MicBlockTest >> testPropertyAtPut [ self assert: (self subject propertyAt: #foo) equals: 'baz' ] -{ #category : #tests } +{ #category : 'tests' } MicBlockTest >> testSanity [ "If this test case fails, there is something wrong with the setup of the test-case." diff --git a/src/Microdown-Tests/MicCitationBlockTest.class.st b/src/Microdown-Tests/MicCitationBlockTest.class.st index ed2ce8a7..7c0a6ac2 100644 --- a/src/Microdown-Tests/MicCitationBlockTest.class.st +++ b/src/Microdown-Tests/MicCitationBlockTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicCitationBlockTest, - #superclass : #MicAnnotationSubclassTest, - #category : #'Microdown-Tests-Extensions' + #name : 'MicCitationBlockTest', + #superclass : 'MicAnnotationSubclassTest', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicCitationBlockTest >> testCreateTheRightCitationObject [ | doc | @@ -14,7 +16,7 @@ MicCitationBlockTest >> testCreateTheRightCitationObject [ self assert: (doc children first children first arguments at: #key) equals: 'Duca99a'. ] -{ #category : #tests } +{ #category : 'tests' } MicCitationBlockTest >> testDefaultingClassWhenNoTag [ | doc | diff --git a/src/Microdown-Tests/MicCodeBlockTest.class.st b/src/Microdown-Tests/MicCodeBlockTest.class.st index 12fb90ba..7517d00c 100644 --- a/src/Microdown-Tests/MicCodeBlockTest.class.st +++ b/src/Microdown-Tests/MicCodeBlockTest.class.st @@ -13,17 +13,19 @@ If you want to embed codeblock inside codeblock you must use an extra space. ``` " Class { - #name : #MicCodeBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicCodeBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> subjectClass [ ^ MicCodeBlock ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testBody [ | source root textBody | textBody := 'my fancy code @@ -34,7 +36,7 @@ is really cool'. ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testCanConsumeLine [ "This test verfies that when a code block is closed it does not consume anymore." "It also show that consume is not just blindly do a line starts with the markup @@ -54,7 +56,7 @@ is really cool'. self deny: (root children first canConsumeLine: 'plain text') ] -{ #category : #'tests - code' } +{ #category : 'tests - code' } MicCodeBlockTest >> testCaption [ | codeBlock | @@ -65,7 +67,7 @@ MicCodeBlockTest >> testCaption [ self assert: codeBlock captionElements size equals: 2. ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testCodeBlockWithNestedCodeBlock [ "This test shows that we can write a code block inside a code block but that the later is not interpreter." @@ -88,7 +90,7 @@ MicCodeBlockTest >> testCodeBlockWithNestedCodeBlock [ ] -{ #category : #'tests - code' } +{ #category : 'tests - code' } MicCodeBlockTest >> testCodeCreatesInnerText [ | code | @@ -97,7 +99,7 @@ MicCodeBlockTest >> testCodeCreatesInnerText [ self assert: (code arguments at: #language) equals: 'a b```' ] -{ #category : #'tests - first tag' } +{ #category : 'tests - first tag' } MicCodeBlockTest >> testFirstTagNoValue [ " @@ -117,7 +119,7 @@ Color >> asMorph self assert: (code arguments at:#language) equals: 'Method' ] -{ #category : #'tests - first tag' } +{ #category : 'tests - first tag' } MicCodeBlockTest >> testFirstTagValue [ | source codeBlock | @@ -127,7 +129,7 @@ MicCodeBlockTest >> testFirstTagValue [ self assert: (codeBlock language) equals: '12'. ] -{ #category : #'tests - first tag' } +{ #category : 'tests - first tag' } MicCodeBlockTest >> testFirstTagWithValue [ " @@ -147,7 +149,7 @@ Color >> asMorph self assert: (code arguments at:#language) equals: 'PharoMethod' ] -{ #category : #'tests - deviation' } +{ #category : 'tests - deviation' } MicCodeBlockTest >> testFourBackQuotes [ | codeBlock | @@ -158,7 +160,7 @@ something in the way self assert: codeBlock children first body equals: 'something in the way' ] -{ #category : #'tests - deviation' } +{ #category : 'tests - deviation' } MicCodeBlockTest >> testFourBackQuotesClosedByThreeQuotes [ | codeBlock | @@ -169,7 +171,7 @@ something in the way self assert: codeBlock children first body equals: 'something in the way' ] -{ #category : #'tests - deviation' } +{ #category : 'tests - deviation' } MicCodeBlockTest >> testFourBackQuotesOnMultipleLines [ | codeBlock | @@ -184,7 +186,7 @@ pif glop or pas glop' ] -{ #category : #'tests - deviation' } +{ #category : 'tests - deviation' } MicCodeBlockTest >> testFourBackQuotesOnMultipleLinesWithText [ | codeBlock | @@ -205,7 +207,7 @@ pif glop or pas glop' ] -{ #category : #'tests - deviation' } +{ #category : 'tests - deviation' } MicCodeBlockTest >> testFourBackQuotesWithTextAround [ | codeBlock | @@ -221,7 +223,7 @@ Ending text'. self assert: codeBlock children second body equals: 'something in the way' ] -{ #category : #'tests - code' } +{ #category : 'tests - code' } MicCodeBlockTest >> testHasBody [ | source root textBody | @@ -231,7 +233,7 @@ MicCodeBlockTest >> testHasBody [ self assert: root children first hasBody ] -{ #category : #'tests - code' } +{ #category : 'tests - code' } MicCodeBlockTest >> testHasBody_not [ | source root textBody | @@ -241,7 +243,7 @@ MicCodeBlockTest >> testHasBody_not [ self assert: root children first hasBody not ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testHasCaption [ " @@ -261,7 +263,7 @@ Color >> asMorph self assert: code hasCaption ] -{ #category : #'tests - arguments' } +{ #category : 'tests - arguments' } MicCodeBlockTest >> testHasLabelFalse [ " ```language=pharo&caption=Getting a morph for an instance of ==Color==&label=scr:asMorphInColor @@ -277,7 +279,7 @@ Color >> asMorph self deny: code hasLabel ] -{ #category : #'tests - arguments' } +{ #category : 'tests - arguments' } MicCodeBlockTest >> testHasLabelTrue [ " ```language=pharo&caption=Getting a morph for an instance of ==Color==&label=scr:asMorphInColor @@ -293,7 +295,7 @@ Color >> asMorph self assert: code hasLabel ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testHasNOCaption [ " ```language=pharo&caption=Getting a morph for an instance of ==Color==&label=scr:asMorphInColor @@ -312,7 +314,7 @@ Color >> asMorph self deny: code hasCaption ] -{ #category : #'tests - arguments' } +{ #category : 'tests - arguments' } MicCodeBlockTest >> testLanguage [ " @@ -329,7 +331,7 @@ Color >> asMorph self assert: code language equals: 'pharo' ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testOpenCanConsumeLine [ | source root textBody argument line code | @@ -364,7 +366,7 @@ is really cool'. ] -{ #category : #'tests - code' } +{ #category : 'tests - code' } MicCodeBlockTest >> testSetLabel [ | codeBlock | @@ -375,7 +377,7 @@ MicCodeBlockTest >> testSetLabel [ ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testSingleBlockWithArguments [ " ```language=pharo&caption=Getting a morph for an instance of ==Color==&label=scr:asMorphInColor @@ -397,7 +399,7 @@ Color >> asMorph self assert: (code arguments at:#label) equals: 'scr:asMorphInColor'. ] -{ #category : #tests } +{ #category : 'tests' } MicCodeBlockTest >> testSingleBlockWithArgumentsWithFormat [ " @@ -429,7 +431,7 @@ Color >> asMorph self assert: code label equals: 'scr:asMorphInColor'. ] -{ #category : #'tests - deviation' } +{ #category : 'tests - deviation' } MicCodeBlockTest >> testThreeBackQuotesClosedByFourQuotes [ | codeBlock | diff --git a/src/Microdown-Tests/MicColumnsBlockTest.class.st b/src/Microdown-Tests/MicColumnsBlockTest.class.st index aaeae1b1..a76cbcf5 100644 --- a/src/Microdown-Tests/MicColumnsBlockTest.class.st +++ b/src/Microdown-Tests/MicColumnsBlockTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicColumnsBlockTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Extensions' + #name : 'MicColumnsBlockTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicColumnsBlockTest >> testSimpleColumn [ | doc | @@ -32,7 +34,7 @@ MicColumnsBlockTest >> testSimpleColumn [ self assert: doc children first children second children first class equals: MicUnorderedListBlock. ] -{ #category : #tests } +{ #category : 'tests' } MicColumnsBlockTest >> testSimpleColumnWithWidth [ | doc | diff --git a/src/Microdown-Tests/MicCommentTest.class.st b/src/Microdown-Tests/MicCommentTest.class.st index d23a12c1..40d7b4cf 100644 --- a/src/Microdown-Tests/MicCommentTest.class.st +++ b/src/Microdown-Tests/MicCommentTest.class.st @@ -1,16 +1,18 @@ Class { - #name : #MicCommentTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicCommentTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicCommentTest >> subjectClass [ ^ MicCommentBlock ] -{ #category : #tests } +{ #category : 'tests' } MicCommentTest >> testCommentAPI [ | comment | diff --git a/src/Microdown-Tests/MicElementTest.class.st b/src/Microdown-Tests/MicElementTest.class.st index 2d1204a0..58e69a76 100644 --- a/src/Microdown-Tests/MicElementTest.class.st +++ b/src/Microdown-Tests/MicElementTest.class.st @@ -1,27 +1,29 @@ Class { - #name : #MicElementTest, - #superclass : #TestCase, + #name : 'MicElementTest', + #superclass : 'TestCase', #instVars : [ 'parser' ], #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #testing } +{ #category : 'testing' } MicElementTest class >> isAbstract [ ^ self = MicElementTest ] -{ #category : #factory } +{ #category : 'factory' } MicElementTest >> parser [ ^ self parserClass new ] -{ #category : #factory } +{ #category : 'factory' } MicElementTest >> parserClass [ "This references to MicrodownParser is needed for the test. Replacing it by Microdown does not work." @@ -29,7 +31,7 @@ MicElementTest >> parserClass [ ^ MicrodownParser ] -{ #category : #running } +{ #category : 'running' } MicElementTest >> setUp [ super setUp. diff --git a/src/Microdown-Tests/MicEnvironmentBlockTest.class.st b/src/Microdown-Tests/MicEnvironmentBlockTest.class.st index 2e22f7a7..d9807814 100644 --- a/src/Microdown-Tests/MicEnvironmentBlockTest.class.st +++ b/src/Microdown-Tests/MicEnvironmentBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicEnvironmentBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicEnvironmentBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> subjectClass [ ^ MicEnvironmentBlock ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testEnvironment [ "'> testEnvironmentClosingNotEatingClosingCharacter [ @@ -42,7 +44,7 @@ to self assert: env children first text equals: 'to'. ] -{ #category : #'tests - extensions' } +{ #category : 'tests - extensions' } MicEnvironmentBlockTest >> testEnvironmentIsCreatedWhenTagDoesNotMatch [ | source root env environmentName | @@ -59,7 +61,7 @@ MicEnvironmentBlockTest >> testEnvironmentIsCreatedWhenTagDoesNotMatch [ ] -{ #category : #'tests - extensions' } +{ #category : 'tests - extensions' } MicEnvironmentBlockTest >> testEnvironmentWiathArgsWithCorrespondingClassIsCreated [ | source root environment environmentName contents | @@ -81,7 +83,7 @@ toto'. ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testEnvironmentWithAnyNestedElement [ "'> testEnvironmentWithArguments [ "'> testEnvironmentWithBrokenMotherNested [ | root | @@ -158,7 +160,7 @@ The mother environment is not closed so it will eat everything. ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testEnvironmentWithBrokenNestedScript [ | root | @@ -173,7 +175,7 @@ MicEnvironmentBlockTest >> testEnvironmentWithBrokenNestedScript [ self assert: root children first children first class equals: MicPharoScriptBlock. ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testEnvironmentWithCodeBlock [ | root env | @@ -197,7 +199,7 @@ isn''t it ] -{ #category : #'tests - extensions' } +{ #category : 'tests - extensions' } MicEnvironmentBlockTest >> testEnvironmentWithCorrespondingClassIsCreated [ | source root env environmentName | @@ -215,7 +217,7 @@ MicEnvironmentBlockTest >> testEnvironmentWithCorrespondingClassIsCreated [ ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testEnvironmentWithFormat [ "'> testEnvironmentWithMultipleLines [ "'> testEnvironmentWithNoEmptyBeforeTheEndMarker [ @@ -286,7 +288,7 @@ environment, else we force writer to enter a new line to declare the end of the paragraph.'. ] -{ #category : #'tests - extensions' } +{ #category : 'tests - extensions' } MicEnvironmentBlockTest >> testExtensionClassWithSpaceAndArgIsCreated [ | source root environment environmentName contents | @@ -310,7 +312,7 @@ toto'. ] -{ #category : #'tests - better parsing' } +{ #category : 'tests - better parsing' } MicEnvironmentBlockTest >> testInputFileOnOneLineWithJunkAfter [ | mic infileReference | @@ -319,7 +321,7 @@ MicEnvironmentBlockTest >> testInputFileOnOneLineWithJunkAfter [ self assert: infileReference path equals: 'chapters/withStyle.md' ] -{ #category : #'tests - better parsing' } +{ #category : 'tests - better parsing' } MicEnvironmentBlockTest >> testInputFileOnOneLineWithJunkSpaceBeforeEnd [ | mic infileReference | @@ -328,7 +330,7 @@ MicEnvironmentBlockTest >> testInputFileOnOneLineWithJunkSpaceBeforeEnd [ self assert: infileReference path equals: 'chapters/withStyle.md' ] -{ #category : #'tests - better parsing' } +{ #category : 'tests - better parsing' } MicEnvironmentBlockTest >> testInputFileOnOneLineWithSpaceBeforeJunkAfter [ | mic infileReference | @@ -337,7 +339,7 @@ MicEnvironmentBlockTest >> testInputFileOnOneLineWithSpaceBeforeJunkAfter [ self assert: infileReference path equals: 'chapters/withStyle.md' ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testParagraphEnvironmentParagraph [ | root | root := parser parse: 'What a super day for a ride. @@ -356,7 +358,7 @@ Yes this is a good idea.'. ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testParagraphEnvironmentParagraph2 [ "This test has a space after ?> '?> ' - was strangely broken at one point in time" | root | @@ -374,7 +376,7 @@ Yes this is a good idea.'. ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testParagraphEnvironmentParagraph3 [ "Text after ?> should be ignored - was strangely broken at one point in time" | root | @@ -392,7 +394,7 @@ Yes this is a good idea.'. ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testSecondScriptShouldNotBeChildOfFirst [ | root | @@ -414,7 +416,7 @@ MicEnvironmentBlockTest >> testSecondScriptShouldNotBeChildOfFirst [ children size equals: 2 ] -{ #category : #'tests - default environment' } +{ #category : 'tests - default environment' } MicEnvironmentBlockTest >> testSecondScriptShouldNotBeChildOfFirstWhenClosingOnTheSameLine [ | root | diff --git a/src/Microdown-Tests/MicFigureBlockTest.class.st b/src/Microdown-Tests/MicFigureBlockTest.class.st index e7afbabb..58a97659 100644 --- a/src/Microdown-Tests/MicFigureBlockTest.class.st +++ b/src/Microdown-Tests/MicFigureBlockTest.class.st @@ -1,13 +1,15 @@ Class { - #name : #MicFigureBlockTest, - #superclass : #MicBlockTest, + #name : 'MicFigureBlockTest', + #superclass : 'MicBlockTest', #instVars : [ 'splitterClass' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #running } +{ #category : 'running' } MicFigureBlockTest >> setUp [ super setUp. @@ -15,12 +17,12 @@ MicFigureBlockTest >> setUp [ splitterClass := MicInlineParser ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> subjectClass [ ^ MicFigureBlock ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testAlt [ | figure | @@ -32,7 +34,7 @@ MicFigureBlockTest >> testAlt [ self assert: figure alt equals: 'je suis le alt texte' ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testAnchor [ | figure | @@ -45,7 +47,7 @@ MicFigureBlockTest >> testAnchor [ self assert: figure anchor equals: '233' ] -{ #category : #running } +{ #category : 'running' } MicFigureBlockTest >> testArgumentAtIfPresent [ | expected tested | @@ -60,7 +62,7 @@ MicFigureBlockTest >> testArgumentAtIfPresent [ self assert: (tested arguments at: 'testKey') equals: 'object'. ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testCaption [ | figure | figure := (splitterClass new parse: '![caption with space and dot...](http://www.Pharo.ORG)') first. @@ -69,7 +71,7 @@ MicFigureBlockTest >> testCaption [ ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testHasArguments [ | figure | figure := (splitterClass new parse: '![caption with space and dot...](https://github.com/pillar-markup/Microdown/runs/4336482137?check_suite_focus=true width=80&anchor=bla)') first. @@ -82,7 +84,7 @@ MicFigureBlockTest >> testHasArguments [ ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testHasNoArguments [ | figure | figure := (splitterClass new parse: '![caption with space and dot...](https://github.com/pillar-markup/Microdown/runs/4336482137?check_suite_focus=true)') first. @@ -93,14 +95,14 @@ MicFigureBlockTest >> testHasNoArguments [ ] -{ #category : #'tests - testing' } +{ #category : 'tests - testing' } MicFigureBlockTest >> testIsNotRelativeFilePathWithUrl [ | figure | figure := (splitterClass new parse: '![caption](http://www.pharo.org)') first. self assert: figure reference fullName asString equals: 'http://www.pharo.org/' ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testPrintOn [ | figure | figure := (splitterClass new parse: '![caption](http://www.Pharo.ORG)') first. @@ -109,14 +111,14 @@ MicFigureBlockTest >> testPrintOn [ "not really good but let us make it work" ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testPrintOnWithParameters [ | figure | figure := (splitterClass new parse: '![caption](http://anURL.org?label=1&title=testFigure)') first. self assert: figure printString equals: '![caption](http://anURL.org?label=1&title=testFigure)' ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testUrlWitMicrodownParameterAndUrlParameters [ | figure | @@ -128,7 +130,7 @@ MicFigureBlockTest >> testUrlWitMicrodownParameterAndUrlParameters [ self assert: (figure arguments at: 'delog') equals: '1' ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testUrlWithMicrodownParameters [ | figure | @@ -138,7 +140,7 @@ MicFigureBlockTest >> testUrlWithMicrodownParameters [ self assert: (figure arguments at: 'anchor') equals: 'fig:pharo' ] -{ #category : #tests } +{ #category : 'tests' } MicFigureBlockTest >> testUrlWithoutMicrodownParameters2 [ | figure | diff --git a/src/Microdown-Tests/MicFileResourceReferenceTest.class.st b/src/Microdown-Tests/MicFileResourceReferenceTest.class.st index 7d58ca6f..11c05d50 100644 --- a/src/Microdown-Tests/MicFileResourceReferenceTest.class.st +++ b/src/Microdown-Tests/MicFileResourceReferenceTest.class.st @@ -3,16 +3,18 @@ These tests will fail if MicHTTPResourceTest fails. I read the files from the gi " Class { - #name : #MicFileResourceReferenceTest, - #superclass : #TestCase, + #name : 'MicFileResourceReferenceTest', + #superclass : 'TestCase', #instVars : [ 'filesystem', 'emptyFilesystem' ], - #category : #'Microdown-Tests-Resolution' + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> exampleMicFileResourceReference [ | file | @@ -20,7 +22,7 @@ MicFileResourceReferenceTest >> exampleMicFileResourceReference [ ^ MicFileResourceReference fromFileRef: file ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> exampleMicFileResourceReferenceInsideSubFolder [ | file | @@ -28,7 +30,7 @@ MicFileResourceReferenceTest >> exampleMicFileResourceReferenceInsideSubFolder [ ^ MicFileResourceReference fromFileRef: file ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> examplePNGByteArray [ ^ #[137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 0 200 0 0 0 90 4 3 0 0 0 15 @@ -53,7 +55,7 @@ MicFileResourceReferenceTest >> examplePNGByteArray [ 78 68 174 66 96 130] ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> examplePNGFile [ " Answer a
for testing purposes " @@ -61,13 +63,13 @@ MicFileResourceReferenceTest >> examplePNGFile [ ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> examplePNGFileContents [ ^ self examplePNGByteArray readStream ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> exampleReadmeFile [ " Answer a on a memory file system for testing purposes " @@ -76,7 +78,7 @@ MicFileResourceReferenceTest >> exampleReadmeFile [ yourself ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> exampleReadmeFileContents [ " Answer a for file resource testing purposes " @@ -101,7 +103,7 @@ Link to a document in subfolder: ' ] -{ #category : #private } +{ #category : 'private' } MicFileResourceReferenceTest >> exampleReadmeFileInsideSubFolder [ " Answer a on a memory file system for testing purposes " filesystem ensureCreateDirectory: 'figures'. @@ -110,7 +112,7 @@ MicFileResourceReferenceTest >> exampleReadmeFileInsideSubFolder [ yourself ] -{ #category : #running } +{ #category : 'running' } MicFileResourceReferenceTest >> setUp [ | readme image file | super setUp. @@ -130,7 +132,7 @@ MicFileResourceReferenceTest >> setUp [ ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testContents [ | micFileResource | @@ -138,7 +140,7 @@ MicFileResourceReferenceTest >> testContents [ self assert: micFileResource contents equals: self exampleReadmeFileContents ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testContentsInsideSubFolder [ | micFileResource | @@ -147,14 +149,14 @@ MicFileResourceReferenceTest >> testContentsInsideSubFolder [ self assert: micFileResource contents equals: self exampleReadmeFileContents ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testContentsOfDirectory [ | ref | ref := filesystem workingDirectory asMicResourceReference. self assert: ref contents equals: '' ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testContentsSet [ |ref header | ref := (MicResourceReference fromUri: 'file:/example.md') @@ -165,7 +167,7 @@ MicFileResourceReferenceTest >> testContentsSet [ self assert: header children first text equals: 'Super cool header' ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testFileReferenceExtensionMethod [ | fileRef micRef | fileRef := '/path/to/nowhere.md' asFileReference. @@ -174,7 +176,7 @@ MicFileResourceReferenceTest >> testFileReferenceExtensionMethod [ self assert: micRef fullName equals: (fileRef fullName copyReplaceAll: WindowsStore delimiter asString with: UnixStore delimiter asString) ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testFileReferenceExtensionMethod_dir [ | fileRef micRef | fileRef := (filesystem workingDirectory / '/subdir') asFileReference. @@ -184,7 +186,7 @@ MicFileResourceReferenceTest >> testFileReferenceExtensionMethod_dir [ self assert: (micRef uri printString endsWith: '/') ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testFullName [ self assert: 'figures/foo.png' asMicResourceReference fullName equals: 'figures/foo.png'. @@ -193,14 +195,14 @@ MicFileResourceReferenceTest >> testFullName [ self assert: 'file:///figures/foo.png' asMicResourceReference fullName equals: '/figures/foo.png' ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testIsDirectory [ | ref | ref := filesystem workingDirectory asMicResourceReference. self assert: ref isDirectory ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadChildren [ | ref files | ref := filesystem workingDirectory asMicResourceReference. @@ -209,7 +211,7 @@ MicFileResourceReferenceTest >> testLoadChildren [ self assert: files first class equals: MicFileResourceReference ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadImage [ | ref image | @@ -221,7 +223,7 @@ MicFileResourceReferenceTest >> testLoadImage [ self assert: image width equals: 200 ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadMicrodown [ | ref doc | ref := (MicResourceReference fromUri: 'file:/readme.md') @@ -232,7 +234,7 @@ MicFileResourceReferenceTest >> testLoadMicrodown [ ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadNotCorrectImage [ | ref | ref := (MicResourceReference fromUri: 'file:/readme.md') @@ -242,7 +244,7 @@ MicFileResourceReferenceTest >> testLoadNotCorrectImage [ raise: UnrecognizedImageFormatError ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadNotCorrectMicrodown [ | ref | @@ -253,7 +255,7 @@ MicFileResourceReferenceTest >> testLoadNotCorrectMicrodown [ raise: ZnInvalidUTF8 ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadNotFoundImage [ | ref | @@ -265,7 +267,7 @@ MicFileResourceReferenceTest >> testLoadNotFoundImage [ self assert: e messageText equals: 'Microdown file not found' ] ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testLoadNotFoundMicrodown [ | uri ref | uri := 'file:///readme.md'. @@ -278,7 +280,7 @@ MicFileResourceReferenceTest >> testLoadNotFoundMicrodown [ self assert: e messageText equals: 'Microdown file not found' ] ] -{ #category : #tests } +{ #category : 'tests' } MicFileResourceReferenceTest >> testPath [ self assert: 'figures/foo.png' asMicResourceReference path equals: 'figures/foo.png'. diff --git a/src/Microdown-Tests/MicFootnoteBlockTest.class.st b/src/Microdown-Tests/MicFootnoteBlockTest.class.st index 8f137f0f..08a8fd6e 100644 --- a/src/Microdown-Tests/MicFootnoteBlockTest.class.st +++ b/src/Microdown-Tests/MicFootnoteBlockTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicFootnoteBlockTest, - #superclass : #MicAnnotationSubclassTest, - #category : #'Microdown-Tests-Extensions' + #name : 'MicFootnoteBlockTest', + #superclass : 'MicAnnotationSubclassTest', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicFootnoteBlockTest >> testCreateTheRightFootnoteObject [ | doc | diff --git a/src/Microdown-Tests/MicFormatBlockTest.class.st b/src/Microdown-Tests/MicFormatBlockTest.class.st index 808296c3..c5d5c53c 100644 --- a/src/Microdown-Tests/MicFormatBlockTest.class.st +++ b/src/Microdown-Tests/MicFormatBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicFormatBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicFormatBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicFormatBlockTest >> subjectClass [ ^ MicBoldFormatBlock ] -{ #category : #'tests - bold' } +{ #category : 'tests - bold' } MicFormatBlockTest >> testBoldAPIToAccessText [ | bold | @@ -19,7 +21,7 @@ MicFormatBlockTest >> testBoldAPIToAccessText [ self assert: bold textElement substring equals: 'a b' ] -{ #category : #'tests - bold' } +{ #category : 'tests - bold' } MicFormatBlockTest >> testBoldAPIToSetText [ | bold | @@ -29,7 +31,7 @@ MicFormatBlockTest >> testBoldAPIToSetText [ self assert: bold textElement substring equals: 'Blblbl' ] -{ #category : #'tests - bold' } +{ #category : 'tests - bold' } MicFormatBlockTest >> testBoldCreatesInnerText [ | bold | @@ -39,7 +41,7 @@ MicFormatBlockTest >> testBoldCreatesInnerText [ self assert: bold children first substring equals: 'a b' ] -{ #category : #'tests - bold' } +{ #category : 'tests - bold' } MicFormatBlockTest >> testBoldItalicAPIToAccessText [ | italic | @@ -52,7 +54,7 @@ MicFormatBlockTest >> testBoldItalicAPIToAccessText [ self assert: italic textElement substring equals: 'a b' ] -{ #category : #tests } +{ #category : 'tests' } MicFormatBlockTest >> testBoldWrappedElements [ | paragraph | @@ -64,7 +66,7 @@ MicFormatBlockTest >> testBoldWrappedElements [ ] -{ #category : #'tests - bold' } +{ #category : 'tests - bold' } MicFormatBlockTest >> testBoldWrappedWithAccessAPIElements [ | paragraph | @@ -77,7 +79,7 @@ MicFormatBlockTest >> testBoldWrappedWithAccessAPIElements [ self assert: paragraph children second substring equals: ' c' ] -{ #category : #tests } +{ #category : 'tests' } MicFormatBlockTest >> testHasProperty [ self assert: (self subject propertyAt: #foo ifAbsent: [ true ]) . @@ -86,7 +88,7 @@ MicFormatBlockTest >> testHasProperty [ self deny: (self subject hasProperty: #bar) ] -{ #category : #'tests - italic' } +{ #category : 'tests - italic' } MicFormatBlockTest >> testItalicAPIToAccessText [ | italic | @@ -96,7 +98,7 @@ MicFormatBlockTest >> testItalicAPIToAccessText [ self assert: italic textElement substring equals: 'a b' ] -{ #category : #'tests - italic' } +{ #category : 'tests - italic' } MicFormatBlockTest >> testItalicAPIToSetText [ | italic | @@ -106,7 +108,7 @@ MicFormatBlockTest >> testItalicAPIToSetText [ self assert: italic textElement substring equals: 'Blblbl' ] -{ #category : #'tests - italic' } +{ #category : 'tests - italic' } MicFormatBlockTest >> testItalicCreatesInnerText [ | italic | @@ -116,7 +118,7 @@ MicFormatBlockTest >> testItalicCreatesInnerText [ self assert: italic children first substring equals: 'a b' ] -{ #category : #'tests - italic' } +{ #category : 'tests - italic' } MicFormatBlockTest >> testItalicWrappedElements [ | paragraph | @@ -131,7 +133,7 @@ MicFormatBlockTest >> testItalicWrappedElements [ equals: MicTextBlock ] -{ #category : #'tests - italic' } +{ #category : 'tests - italic' } MicFormatBlockTest >> testItalicWrappedWithAccessAPIElements [ | paragraph | @@ -144,7 +146,7 @@ MicFormatBlockTest >> testItalicWrappedWithAccessAPIElements [ self assert: paragraph children second substring equals: ' c' ] -{ #category : #'tests - monospace' } +{ #category : 'tests - monospace' } MicFormatBlockTest >> testMonospaceCreatesInnerText [ | mono | @@ -154,7 +156,7 @@ MicFormatBlockTest >> testMonospaceCreatesInnerText [ self assert: mono children first substring equals: 'a b' ] -{ #category : #'tests - monospace' } +{ #category : 'tests - monospace' } MicFormatBlockTest >> testMonospaceTextCreatesInnerText [ | mono | @@ -165,7 +167,7 @@ MicFormatBlockTest >> testMonospaceTextCreatesInnerText [ self assert: mono textElement substring equals: 'a b' ] -{ #category : #'tests - monospace' } +{ #category : 'tests - monospace' } MicFormatBlockTest >> testMonospaceWrappedElements [ | mono | @@ -174,7 +176,7 @@ MicFormatBlockTest >> testMonospaceWrappedElements [ self assert: mono wrappedElements first substring equals: 'a b' ] -{ #category : #'tests - bold' } +{ #category : 'tests - bold' } MicFormatBlockTest >> testPrintingBold [ | bold | @@ -183,7 +185,7 @@ MicFormatBlockTest >> testPrintingBold [ ] -{ #category : #'tests - monospace' } +{ #category : 'tests - monospace' } MicFormatBlockTest >> testPrintingBold2 [ | bold | @@ -191,7 +193,7 @@ MicFormatBlockTest >> testPrintingBold2 [ self assert: bold printString equals: 'MonospaceFormat(Text(_a b_))' ] -{ #category : #'tests - italic' } +{ #category : 'tests - italic' } MicFormatBlockTest >> testPrintingItalic [ | bold | @@ -199,7 +201,7 @@ MicFormatBlockTest >> testPrintingItalic [ self assert: bold printString equals: 'ItalicFormat(Text(a b))' ] -{ #category : #tests } +{ #category : 'tests' } MicFormatBlockTest >> testProperties [ self assert: self subject properties isNotNil. diff --git a/src/Microdown-Tests/MicHTTPResourceReferenceTest.class.st b/src/Microdown-Tests/MicHTTPResourceReferenceTest.class.st index f3873c97..9963ab06 100644 --- a/src/Microdown-Tests/MicHTTPResourceReferenceTest.class.st +++ b/src/Microdown-Tests/MicHTTPResourceReferenceTest.class.st @@ -2,21 +2,23 @@ A MicHTTPResourceTest is a test class for testing the behavior of MicHTTPResource " Class { - #name : #MicHTTPResourceReferenceTest, - #superclass : #TestCase, + #name : 'MicHTTPResourceReferenceTest', + #superclass : 'TestCase', #instVars : [ 'baseUrl', 'offlineSetting' ], - #category : #'Microdown-Tests-Resolution' + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #'test data' } +{ #category : 'test data' } MicHTTPResourceReferenceTest class >> githubTestData [ ^ MicResourceReference fromUri: 'https://raw.githubusercontent.com/pillar-markup/Microdown/dev/doc/testMicrodown/' ] -{ #category : #running } +{ #category : 'running' } MicHTTPResourceReferenceTest >> setUp [ super setUp. "All tests assume to be online" @@ -25,7 +27,7 @@ MicHTTPResourceReferenceTest >> setUp [ baseUrl := 'https://raw.githubusercontent.com/pillar-markup/Microdown/dev/doc/testMicrodown/' ] -{ #category : #running } +{ #category : 'running' } MicHTTPResourceReferenceTest >> tearDown [ Microdown offline: offlineSetting. @@ -33,7 +35,7 @@ MicHTTPResourceReferenceTest >> tearDown [ super tearDown ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testContentsSet [ self should: [('https://someplace.irk/mydocument.md' asMicResourceReference ) contents: '### Impossible'] @@ -42,7 +44,7 @@ MicHTTPResourceReferenceTest >> testContentsSet [ ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testErrorNonCorrectImage [ | ref | @@ -53,7 +55,7 @@ MicHTTPResourceReferenceTest >> testErrorNonCorrectImage [ raise: UnrecognizedImageFormatError ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testErrorNonExistingImage [ | ref | @@ -63,14 +65,14 @@ MicHTTPResourceReferenceTest >> testErrorNonExistingImage [ raise: MicResourceReferenceError ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testFullName [ self assert: 'http://pharo.org/figures/foo.png' asMicResourceReference fullName equals: 'http://pharo.org/figures/foo.png'. ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testLoadErrorMicrodown [ | ref | ref := MicResourceReference fromUri: baseUrl ,'toplevel.png'. @@ -80,7 +82,7 @@ MicHTTPResourceReferenceTest >> testLoadErrorMicrodown [ raise: ZnInvalidUTF8 ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testLoadImage [ | ref image | @@ -91,7 +93,7 @@ MicHTTPResourceReferenceTest >> testLoadImage [ self assert: image width equals: 200 ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testLoadMicrodown [ | ref doc | ref := MicResourceReference fromUri: baseUrl , 'readme.md'. @@ -101,7 +103,7 @@ MicHTTPResourceReferenceTest >> testLoadMicrodown [ ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testLoadMicrodownResolvesUrlsRelativeToTheParent [ | ref doc topLevelImageRef | @@ -115,7 +117,7 @@ MicHTTPResourceReferenceTest >> testLoadMicrodownResolvesUrlsRelativeToTheParent equals: 90 ] -{ #category : #tests } +{ #category : 'tests' } MicHTTPResourceReferenceTest >> testLoadNonExistingMicrodown [ | ref errorMessage| ref := MicResourceReference fromUri: baseUrl , 'readmeNOT.md'. diff --git a/src/Microdown-Tests/MicHeaderBlockTest.class.st b/src/Microdown-Tests/MicHeaderBlockTest.class.st index babdc6fd..82857b3b 100644 --- a/src/Microdown-Tests/MicHeaderBlockTest.class.st +++ b/src/Microdown-Tests/MicHeaderBlockTest.class.st @@ -2,17 +2,19 @@ I'm a test class for testing the behavior of MicHeaderBlock " Class { - #name : #MicHeaderBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicHeaderBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #running } +{ #category : 'running' } MicHeaderBlockTest >> subjectClass [ ^ MicHeaderBlock ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testCanConsumeLine [ | root headerString | @@ -21,7 +23,7 @@ MicHeaderBlockTest >> testCanConsumeLine [ self deny: (root children first canConsumeLine: headerString) ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderAPIToAccessText [ | header | @@ -31,7 +33,7 @@ MicHeaderBlockTest >> testHeaderAPIToAccessText [ self assert: header children first substring equals: 'titre1' ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderAPIToSetText [ | header | @@ -42,7 +44,7 @@ MicHeaderBlockTest >> testHeaderAPIToSetText [ self assert: header headerElements first substring equals: 'Blblbl' ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderCreatesInnerText [ | header | @@ -52,7 +54,7 @@ MicHeaderBlockTest >> testHeaderCreatesInnerText [ self assert: header children first substring equals: 'titre1' ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderLevel1 [ | root | root := parser parse: HeaderMarkup, ' Level1'. @@ -61,7 +63,7 @@ MicHeaderBlockTest >> testHeaderLevel1 [ self assert: root children first level equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderLevel1NoSpace [ | source root | @@ -72,7 +74,7 @@ MicHeaderBlockTest >> testHeaderLevel1NoSpace [ self assert: root children first level equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderLevel4 [ | source root | @@ -83,7 +85,7 @@ MicHeaderBlockTest >> testHeaderLevel4 [ self assert: root children first level equals: 4 ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderLevel6 [ | source root | source := (HeaderMarkup repeat: 6), ' Level six'. @@ -93,7 +95,7 @@ MicHeaderBlockTest >> testHeaderLevel6 [ self assert: root children first level equals: 6 ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderLevelOutOfRange [ | source header | source := (HeaderMarkup repeat: 1), ' Level one'. @@ -105,7 +107,7 @@ MicHeaderBlockTest >> testHeaderLevelOutOfRange [ ] -{ #category : #tests } +{ #category : 'tests' } MicHeaderBlockTest >> testHeaderLongElements [ | header | diff --git a/src/Microdown-Tests/MicHorizontalLineBlockTest.class.st b/src/Microdown-Tests/MicHorizontalLineBlockTest.class.st index 1b77ce1c..7621447f 100644 --- a/src/Microdown-Tests/MicHorizontalLineBlockTest.class.st +++ b/src/Microdown-Tests/MicHorizontalLineBlockTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicHorizontalLineBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicHorizontalLineBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicHorizontalLineBlockTest >> subjectClass [ ^ MicHorizontalLineBlock ] diff --git a/src/Microdown-Tests/MicInlineParserTest.class.st b/src/Microdown-Tests/MicInlineParserTest.class.st index 281af4a7..31ba562e 100644 --- a/src/Microdown-Tests/MicInlineParserTest.class.st +++ b/src/Microdown-Tests/MicInlineParserTest.class.st @@ -2,20 +2,22 @@ These tests should be merged in MicrodDownInlineParserTest " Class { - #name : #MicInlineParserTest, - #superclass : #TestCase, + #name : 'MicInlineParserTest', + #superclass : 'TestCase', #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #accessing } +{ #category : 'accessing' } MicInlineParserTest >> splitter [ ^ MicInlineParser new ] -{ #category : #'tests - anchors' } +{ #category : 'tests - anchors' } MicInlineParserTest >> testAnchorReference [ | res | @@ -27,7 +29,7 @@ MicInlineParserTest >> testAnchorReference [ self assert: (res second isKindOf: MicAnchorReferenceBlock) ] -{ #category : #'tests - anchors' } +{ #category : 'tests - anchors' } MicInlineParserTest >> testAnchorReferenceUnevaluated [ "When isEvaluated class method returns false, like anchor reference's case, inline inside shoudn't be evaluated" @@ -40,7 +42,7 @@ MicInlineParserTest >> testAnchorReferenceUnevaluated [ 'Text(xyz)' } ] -{ #category : #'tests - annotation' } +{ #category : 'tests - annotation' } MicInlineParserTest >> testAnnotationWithParameters [ | res | @@ -55,7 +57,7 @@ MicInlineParserTest >> testAnnotationWithParameters [ self assert: (res second arguments at: 'label') equals: '42' ] -{ #category : #'tests - annotation' } +{ #category : 'tests - annotation' } MicInlineParserTest >> testAnnotationWithParametersWithBlank [ | res | @@ -69,7 +71,7 @@ MicInlineParserTest >> testAnnotationWithParametersWithBlank [ self assert: (res second arguments at: 'label') equals: '42' ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testBold [ | res | @@ -86,14 +88,14 @@ MicInlineParserTest >> testBold [ self assert: res second kind equals: #bold ] -{ #category : #tests } +{ #category : 'tests' } MicInlineParserTest >> testCurlyBraceDoesNotLeadToProblem [ | mic | mic := (self splitter parse: ' jhkjhk { a }') first. self assert: mic substring equals: ' jhkjhk { a }' ] -{ #category : #'tests to make green again' } +{ #category : 'tests to make green again' } MicInlineParserTest >> testEscapeCharacter [ "we should have just one escape" @@ -103,7 +105,7 @@ MicInlineParserTest >> testEscapeCharacter [ self assert: (res collect: [ :x | x printString ]) equals: { 'Text(not `mono` here)' } ] -{ #category : #'tests - escape' } +{ #category : 'tests - escape' } MicInlineParserTest >> testEscapeCharacterAtBeginning [ "Test the escape \ in simple case (here, bold one)" @@ -114,7 +116,7 @@ MicInlineParserTest >> testEscapeCharacterAtBeginning [ equals: { 'Text(**test**)' } ] -{ #category : #'tests - escape' } +{ #category : 'tests - escape' } MicInlineParserTest >> testEscapeCharacterInLinkName [ "Test the escape \ in link description" @@ -125,7 +127,7 @@ MicInlineParserTest >> testEscapeCharacterInLinkName [ equals: { 'Text(abc)'. '[**test**](myURL)'. 'Text(last)' } ] -{ #category : #'tests - escape' } +{ #category : 'tests - escape' } MicInlineParserTest >> testEscapeCharacterInNestedCase [ "Test the escape \ in case of nested formats" @@ -136,7 +138,7 @@ MicInlineParserTest >> testEscapeCharacterInNestedCase [ equals: {'Text(abc)' . 'ItalicFormat(Text(**not bold** italic))' . 'Text(last)'}. ] -{ #category : #'tests - escape' } +{ #category : 'tests - escape' } MicInlineParserTest >> testEscapeCharacterInNestedLinkName [ "Test the escape \ in case of nested linknames" @@ -147,7 +149,7 @@ MicInlineParserTest >> testEscapeCharacterInNestedLinkName [ equals: { 'Text(abc)'. '[[nested]](myURL)'. 'Text(last)' } ] -{ #category : #'tests to make green again' } +{ #category : 'tests to make green again' } MicInlineParserTest >> testEscapeCharacterTwoConsecutive [ "we should have just one escape" @@ -156,7 +158,7 @@ MicInlineParserTest >> testEscapeCharacterTwoConsecutive [ self assert: (res collect: [ :x | x printString ]) equals: { 'Text(\begin\atend\)' } ] -{ #category : #'tests to make green again' } +{ #category : 'tests to make green again' } MicInlineParserTest >> testEscapeCharacterWithNoCharacterAfter [ | res | @@ -166,7 +168,7 @@ MicInlineParserTest >> testEscapeCharacterWithNoCharacterAfter [ assert: res first substring equals: '\' ] -{ #category : #tests } +{ #category : 'tests' } MicInlineParserTest >> testEscapeEncode [ | roundTrip | self assert: (MicInlineParser escapeEncode: '') equals: ''. @@ -181,7 +183,7 @@ MicInlineParserTest >> testEscapeEncode [ self assert: (roundTrip value: '\\') equals: '\'. ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testEscapeMonospace [ "When isEvaluated class method returns false, like monospace's case, inline inside shoudn't be evaluated" @@ -192,7 +194,7 @@ MicInlineParserTest >> testEscapeMonospace [ self assert: res second class equals: MicMonospaceFormatBlock ] -{ #category : #tests } +{ #category : 'tests' } MicInlineParserTest >> testEscapeReEscape [ | roundTrip | roundTrip := [ :str :keep | @@ -204,7 +206,7 @@ MicInlineParserTest >> testEscapeReEscape [ self assert: (roundTrip value: '\aa\\bb' value: 'a') equals: 'aa\\bb'. ] -{ #category : #'tests - escape' } +{ #category : 'tests - escape' } MicInlineParserTest >> testEscapeTripleBold [ "Test the escape \ in case of nested formats" @@ -215,7 +217,7 @@ MicInlineParserTest >> testEscapeTripleBold [ equals: {'Text(c*)' . 'BoldFormat(Text(bo))' . 'Text(la)'}. ] -{ #category : #'tests - various' } +{ #category : 'tests - various' } MicInlineParserTest >> testExclamationMark [ "Test that 'bla!bla' is ok, and not a failed image, same goes for '![goo]no parenthesis'" @@ -231,7 +233,7 @@ MicInlineParserTest >> testExclamationMark [ equals: { 'Text(![goo]no parenthesis)' } ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicInlineParserTest >> testFigure [ "Test the image annotation ![AltText](url)" @@ -247,7 +249,7 @@ MicInlineParserTest >> testFigure [ ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicInlineParserTest >> testFigureWithBracketInsteadOfParentheses [ "Test the image annotation ![AltText](url)" @@ -259,7 +261,7 @@ MicInlineParserTest >> testFigureWithBracketInsteadOfParentheses [ equals: { 'Text(abc![AltText][my_directory/image.png]last)' } ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicInlineParserTest >> testFigureWithParameters [ "Test the image annotation ![AltText](url)" @@ -278,7 +280,7 @@ MicInlineParserTest >> testFigureWithParameters [ self assert: (res second arguments at: 'width') equals: '90' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicInlineParserTest >> testFigureWithParametersWithBlank [ "Test the image annotation ![AltText](url)" @@ -297,7 +299,7 @@ MicInlineParserTest >> testFigureWithParametersWithBlank [ self assert: (res second arguments at: 'width') equals: '90' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicInlineParserTest >> testFigureWithParenthesesInsteadOfBracket [ "Test the image annotation ![AltText](url)" @@ -309,7 +311,7 @@ MicInlineParserTest >> testFigureWithParenthesesInsteadOfBracket [ equals: { 'Text(abc!(AltText)(my_directory/image.png)last)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testItalic [ | res | @@ -324,7 +326,7 @@ MicInlineParserTest >> testItalic [ equals: { 'Text(abc)'. 'ItalicFormat(Text( ita lics ))'. 'Text(def)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testItalicNestedInBold [ | res | @@ -335,7 +337,7 @@ MicInlineParserTest >> testItalicNestedInBold [ 'Text(xyz)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testItalicNestedInBoldWithSpace [ | res | @@ -345,7 +347,7 @@ MicInlineParserTest >> testItalicNestedInBoldWithSpace [ equals: { 'Text(abc)'. 'BoldFormat(Text(x) ItalicFormat(Text(y)) Text(z))'. 'Text(cba)' } ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicInlineParserTest >> testMath [ | res | @@ -357,7 +359,7 @@ MicInlineParserTest >> testMath [ self assert: (res second isKindOf: MicMathInlineBlock) ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicInlineParserTest >> testMath2 [ | res | @@ -367,7 +369,7 @@ MicInlineParserTest >> testMath2 [ equals: { 'Text(abc)'. '[math env](math)'. 'Text(def)' } ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicInlineParserTest >> testMathshouldBeUnevaluated [ "When isEvaluated class method returns false, like math's case, inline inside shoudn't be evaluated" @@ -380,7 +382,7 @@ MicInlineParserTest >> testMathshouldBeUnevaluated [ 'Text(xyz)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testMonospace [ | res | @@ -390,7 +392,7 @@ MicInlineParserTest >> testMonospace [ equals: { 'Text(ab)'. 'MonospaceFormat(Text(block))'. 'Text(de)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testMonospaceDoesNotTreatNestedElements [ | res | @@ -398,7 +400,7 @@ MicInlineParserTest >> testMonospaceDoesNotTreatNestedElements [ self assert: res first substring equals: '[* foo *])' ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testMonospaceUnevaluated [ "When isEvaluated class method returns false, like monospace's case, inline inside shoudn't be evaluated" @@ -411,7 +413,7 @@ MicInlineParserTest >> testMonospaceUnevaluated [ self assert: res second class equals: MicMonospaceFormatBlock ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testMultipleSequenceFormats [ "Test with multiple annotations" @@ -424,7 +426,7 @@ MicInlineParserTest >> testMultipleSequenceFormats [ 'Text(last)' } ] -{ #category : #'tests - various' } +{ #category : 'tests - various' } MicInlineParserTest >> testNoAnnotation [ | res | @@ -435,7 +437,7 @@ MicInlineParserTest >> testNoAnnotation [ self assert: res first printString equals: 'Text(abc def gh)' ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testOverlappingFormat [ | res | @@ -445,7 +447,7 @@ MicInlineParserTest >> testOverlappingFormat [ equals: #('Text(ab)' 'BoldFormat(Text(boldstart_ boldend))' 'Text( italicEnd_de)') ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testOverlappingFormat2 [ | res | @@ -455,7 +457,7 @@ MicInlineParserTest >> testOverlappingFormat2 [ equals: #('Text(ab)' 'BoldFormat(Text(boldstart_ boldend))' 'Text( )' 'ItalicFormat(Text(italicstart zz italicEnd))' 'Text(de)') ] -{ #category : #'tests - various' } +{ #category : 'tests - various' } MicInlineParserTest >> testParseEmptyText [ | res | @@ -463,7 +465,7 @@ MicInlineParserTest >> testParseEmptyText [ self assert: res isEmpty ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testParseMissingStartURL [ "Test the link annotation [LinkText]url)" @@ -472,7 +474,7 @@ MicInlineParserTest >> testParseMissingStartURL [ self assert: res first class = MicTextBlock. ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testParseMissingStartURLInPresenceOfNestedFormat [ "Test the link annotation [LinkText]url) _*foo*_" @@ -483,7 +485,7 @@ MicInlineParserTest >> testParseMissingStartURLInPresenceOfNestedFormat [ ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testParseShitInMiddleURL [ "Test the link annotation [Pharo is cool]khkjhjkh klhkjhkh (http://pharo.org)" @@ -495,7 +497,7 @@ MicInlineParserTest >> testParseShitInMiddleURL [ self assert: res size equals: 1 ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicInlineParserTest >> testRaw [ | res | @@ -505,7 +507,7 @@ MicInlineParserTest >> testRaw [ equals: { 'Text(abc)'. '[someRaw](raw)'. 'Text(def)' } ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicInlineParserTest >> testRawUnevaluated [ "When isEvaluated class method returns false, like raw's case, inline inside shoudn't be evaluated" @@ -518,7 +520,7 @@ MicInlineParserTest >> testRawUnevaluated [ 'Text(xyz)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testSequenceOfFormats [ "Test with multiple annotations" @@ -530,7 +532,7 @@ MicInlineParserTest >> testSequenceOfFormats [ 'Text(last)' } ] -{ #category : #'tests - annotation' } +{ #category : 'tests - annotation' } MicInlineParserTest >> testSplitAnnotation [ | res | @@ -542,7 +544,7 @@ MicInlineParserTest >> testSplitAnnotation [ 'Text(def)' } ] -{ #category : #'tests - annotation' } +{ #category : 'tests - annotation' } MicInlineParserTest >> testSplitBlockAnnotation [ | res | @@ -554,7 +556,7 @@ MicInlineParserTest >> testSplitBlockAnnotation [ self assert: (res second isKindOf: MicAnnotationBlock) ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testSplitBlockLink [ "Test the link annotation [LinkText](url)" @@ -567,7 +569,7 @@ MicInlineParserTest >> testSplitBlockLink [ ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testSplitBlockLinkIncomplete [ | res | @@ -578,7 +580,7 @@ MicInlineParserTest >> testSplitBlockLinkIncomplete [ self assert: res first class equals: MicTextBlock ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testSplitBlockLinkInlineImage [ | res | @@ -590,7 +592,7 @@ MicInlineParserTest >> testSplitBlockLinkInlineImage [ ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testSplitBlockLinkWithBracketInsteadOfParentheses [ "Test the link annotation [LinkText](url)" @@ -602,7 +604,7 @@ MicInlineParserTest >> testSplitBlockLinkWithBracketInsteadOfParentheses [ equals: { 'Text(abc[LinkText][myURL]last)' } ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicInlineParserTest >> testSplitBlockLinkWithParenthesesInsteadOfBracket [ "Test the link annotation [LinkText](url)" @@ -614,7 +616,7 @@ MicInlineParserTest >> testSplitBlockLinkWithParenthesesInsteadOfBracket [ equals: { 'Text(abc(LinkText)(myURL)last)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testStrike [ | res | @@ -625,7 +627,7 @@ MicInlineParserTest >> testStrike [ self assert: res second class equals: MicStrikeFormatBlock ] -{ #category : #'tests to make green again' } +{ #category : 'tests to make green again' } MicInlineParserTest >> testTwoConsecutiveEscapeCharacter [ "we should have just one escape" @@ -635,7 +637,7 @@ MicInlineParserTest >> testTwoConsecutiveEscapeCharacter [ self assert: (res collect: [ :x | x printString ]) equals: { 'Text(\)' } ] -{ #category : #'tests - annotation' } +{ #category : 'tests - annotation' } MicInlineParserTest >> testUnclosedAnnotation [ | res | @@ -645,7 +647,7 @@ MicInlineParserTest >> testUnclosedAnnotation [ equals: { 'Text(abcdef)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testUnclosedBold [ | res | @@ -653,7 +655,7 @@ MicInlineParserTest >> testUnclosedBold [ self assert: res first printString equals: 'Text(abc**xyz)' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicInlineParserTest >> testUnclosedFigure [ "Test the image annotation ![AltText](url)" @@ -664,7 +666,7 @@ MicInlineParserTest >> testUnclosedFigure [ equals: { 'Text(abc![AltText]last)' } ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicInlineParserTest >> testUnclosedMath [ | res | @@ -674,7 +676,7 @@ MicInlineParserTest >> testUnclosedMath [ equals: { 'Text(abc$ V)'. 'ItalicFormat(Text(i = C))'. 'Text(0 - C_3 &def)' } ] -{ #category : #tests } +{ #category : 'tests' } MicInlineParserTest >> testUnclosedOpeners [ | openers | openers := MicAbstractDelimiter subclasses select: [ :d | d hasSubclasses not and: [d isOpener ]] thenCollect: [ :d | d markup ]. @@ -685,7 +687,7 @@ MicInlineParserTest >> testUnclosedOpeners [ ] ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicInlineParserTest >> testUnclosedRaw [ | res | @@ -695,7 +697,7 @@ MicInlineParserTest >> testUnclosedRaw [ equals: { 'Text(abc{{ V)'. 'ItalicFormat(Text(i = C))'. 'Text(0 - C_3 &def)' } ] -{ #category : #'tests - formats' } +{ #category : 'tests - formats' } MicInlineParserTest >> testUnclosedStrike [ | res | @@ -705,7 +707,7 @@ MicInlineParserTest >> testUnclosedStrike [ equals: { 'Text(abc~strikeédef)' } ] -{ #category : #'tests - url' } +{ #category : 'tests - url' } MicInlineParserTest >> testUrlObjectInUrlBlocks [ | res | @@ -714,7 +716,7 @@ MicInlineParserTest >> testUrlObjectInUrlBlocks [ ] -{ #category : #'tests to make green again' } +{ #category : 'tests to make green again' } MicInlineParserTest >> testUrlObjectInUrlBlocks2 [ | res | @@ -724,7 +726,7 @@ MicInlineParserTest >> testUrlObjectInUrlBlocks2 [ self assert: res second reference fullName equals: 'https://github.com/Ducasse/NewTools-NewHelpBrowser/pulse#merged-pull-requests' ] -{ #category : #tests } +{ #category : 'tests' } MicInlineParserTest >> testWrappedElementOnBold [ | mic | mic := (self splitter parse: '**bold**') first. @@ -732,7 +734,7 @@ MicInlineParserTest >> testWrappedElementOnBold [ self assert: mic substring equals: 'bold' ] -{ #category : #tests } +{ #category : 'tests' } MicInlineParserTest >> testWrappedElementOnNested [ | mic | mic := (self splitter parse: '**_italic_**') first. diff --git a/src/Microdown-Tests/MicInputfileBlockTest.class.st b/src/Microdown-Tests/MicInputfileBlockTest.class.st index 30301eba..73c9ec39 100644 --- a/src/Microdown-Tests/MicInputfileBlockTest.class.st +++ b/src/Microdown-Tests/MicInputfileBlockTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #MicInputfileBlockTest, - #superclass : #MicAnnotationSubclassTest, - #category : #'Microdown-Tests-Extensions' + #name : 'MicInputfileBlockTest', + #superclass : 'MicAnnotationSubclassTest', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicInputfileBlockTest >> testMicInputfileIsNotRelativeFilePath [ | mic resourceReference | "a path starting with / should give an absolute file reference" @@ -14,7 +16,7 @@ MicInputfileBlockTest >> testMicInputfileIsNotRelativeFilePath [ self assert: resourceReference path equals: '/chapters/withStyle.md' ] -{ #category : #tests } +{ #category : 'tests' } MicInputfileBlockTest >> testMicInputfileIsRelativeFilePath [ | mic infileReference | mic := parser parse: ''. @@ -23,7 +25,7 @@ MicInputfileBlockTest >> testMicInputfileIsRelativeFilePath [ self assert: infileReference relativePath equals: 'chapters/withStyle.md' ] -{ #category : #tests } +{ #category : 'tests' } MicInputfileBlockTest >> testMicInputfilePath [ | mic infileReference | mic := parser parse: ''. @@ -31,7 +33,7 @@ MicInputfileBlockTest >> testMicInputfilePath [ self assert: infileReference relativePath equals: 'chapters/withStyle.md' ] -{ #category : #tests } +{ #category : 'tests' } MicInputfileBlockTest >> testMicInputfilePathError [ | doc fileInputBlock | doc := parser parse: ''. diff --git a/src/Microdown-Tests/MicLinkBlockTest.class.st b/src/Microdown-Tests/MicLinkBlockTest.class.st index 6f090f9e..81cca056 100644 --- a/src/Microdown-Tests/MicLinkBlockTest.class.st +++ b/src/Microdown-Tests/MicLinkBlockTest.class.st @@ -1,14 +1,16 @@ Class { - #name : #MicLinkBlockTest, - #superclass : #MicBlockTest, + #name : 'MicLinkBlockTest', + #superclass : 'MicBlockTest', #instVars : [ 'splitterClass', 'link' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #functions } +{ #category : 'functions' } MicLinkBlockTest >> linkBoldSample [ ^ ' @@ -16,7 +18,7 @@ MicLinkBlockTest >> linkBoldSample [ ' ] -{ #category : #functions } +{ #category : 'functions' } MicLinkBlockTest >> linkItalicSample [ ^ ' @@ -24,7 +26,7 @@ MicLinkBlockTest >> linkItalicSample [ ' ] -{ #category : #functions } +{ #category : 'functions' } MicLinkBlockTest >> linkMonospaceSample [ ^ ' @@ -32,7 +34,7 @@ MicLinkBlockTest >> linkMonospaceSample [ ' ] -{ #category : #functions } +{ #category : 'functions' } MicLinkBlockTest >> linkNestedSample [ ^ ' @@ -40,14 +42,14 @@ MicLinkBlockTest >> linkNestedSample [ ' ] -{ #category : #functions } +{ #category : 'functions' } MicLinkBlockTest >> linkSample [ ^ ' [Foo](/anUrl) ' ] -{ #category : #functions } +{ #category : 'functions' } MicLinkBlockTest >> linkStrikeSample [ ^ ' @@ -55,14 +57,14 @@ MicLinkBlockTest >> linkStrikeSample [ ' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> parseLink: aString [ "Parse aString containing Microdown link to a MicLinkBlock" ^ (self parser parse: aString) children first children first. ] -{ #category : #running } +{ #category : 'running' } MicLinkBlockTest >> setUp [ super setUp. @@ -70,12 +72,12 @@ MicLinkBlockTest >> setUp [ splitterClass := MicInlineParser ] -{ #category : #tests } +{ #category : 'tests' } MicLinkBlockTest >> subjectClass [ ^ MicHorizontalLineBlock ] -{ #category : #tests } +{ #category : 'tests' } MicLinkBlockTest >> testFullName [ link := self parseLink: self linkSample. @@ -83,7 +85,7 @@ MicLinkBlockTest >> testFullName [ ] -{ #category : #tests } +{ #category : 'tests' } MicLinkBlockTest >> testHasArguments [ | figure | figure := (splitterClass new parse: '[caption with space and dot...](https://github.com/pillar-markup/Microdown/runs/4336482137?check_suite_focus=true width=80&anchor=bla)') first. @@ -94,7 +96,7 @@ MicLinkBlockTest >> testHasArguments [ ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> testLinkAPIToAccessText [ link := self parseLink: self linkSample. @@ -102,7 +104,7 @@ MicLinkBlockTest >> testLinkAPIToAccessText [ self assert: link url equals: '/anUrl' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> testLinkAPIToSetText [ link := self parseLink: self linkSample. @@ -112,7 +114,7 @@ MicLinkBlockTest >> testLinkAPIToSetText [ self assert: link caption equals: 'Blblbl' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> testLinkBoldAPIToAccessText [ link := self parseLink: self linkBoldSample. @@ -123,7 +125,7 @@ MicLinkBlockTest >> testLinkBoldAPIToAccessText [ self assert: link url equals: '/anUrl' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> testLinkCreatesInnerText [ link := self parseLink: '[ab](https://ab.com)'. @@ -131,7 +133,7 @@ MicLinkBlockTest >> testLinkCreatesInnerText [ self assert: link url equals: 'https://ab.com' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> testLinkItalicAPIToAccessText [ link := self parseLink: self linkItalicSample. @@ -144,7 +146,7 @@ MicLinkBlockTest >> testLinkItalicAPIToAccessText [ self assert: link url equals: '/anUrl' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicLinkBlockTest >> testOpeningDelimiter [ link := self parseLink: self linkSample. @@ -153,14 +155,14 @@ MicLinkBlockTest >> testOpeningDelimiter [ self assert: link openingDelimiter equals: '[' ] -{ #category : #tests } +{ #category : 'tests' } MicLinkBlockTest >> testPrintOn [ link := (splitterClass new parse: '[caption](http://www.pharo.org)') first. self assert: link asString equals: '[caption](http://www.pharo.org)' ] -{ #category : #tests } +{ #category : 'tests' } MicLinkBlockTest >> testUrl [ link := (splitterClass new parse: '[caption](http://www.pharo.org:8080)') first. diff --git a/src/Microdown-Tests/MicMathBlockTest.class.st b/src/Microdown-Tests/MicMathBlockTest.class.st index 941dabdf..dfc4dc58 100644 --- a/src/Microdown-Tests/MicMathBlockTest.class.st +++ b/src/Microdown-Tests/MicMathBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicMathBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicMathBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> subjectClass [ ^ MicMathBlock ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockIsMathBlock [ | root | @@ -21,7 +23,7 @@ V_i = C_0 - C_3 self assert: root children first class equals: MicMathBlock ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithBackslashCommands [ "check that backslash are not expanded for math blocks" | root math | @@ -35,7 +37,7 @@ f(a) = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z - a} dz self assert: math body equals: 'f(a) = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z - a} dz'. ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithBadClosure [ | root | @@ -49,7 +51,7 @@ $'. $' ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithParameters [ | root math | @@ -65,7 +67,7 @@ V_i = C_0 - C_3 self assert: (math arguments at: 'label') equals: '42' ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithParametersAndLatexComment [ | root math | @@ -81,7 +83,7 @@ V_i = C_0 - C_3 self assert: (math arguments at: 'label') equals: '42' ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithParametersCaption [ | root math | @@ -103,7 +105,7 @@ V_i = C_0 - C_3 self assert: math caption equals: 'Ze great formula' ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithParametersCaptionAndFormatting [ | root math | @@ -126,7 +128,7 @@ V_i = C_0 - C_3 self assert: math captionElements second kind equals: 'bold' ] -{ #category : #tests } +{ #category : 'tests' } MicMathBlockTest >> testMathBlockWithParametersWithBlank [ | root math | diff --git a/src/Microdown-Tests/MicMetaDataBlockTest.class.st b/src/Microdown-Tests/MicMetaDataBlockTest.class.st index 9bd3eaea..3710cbc7 100644 --- a/src/Microdown-Tests/MicMetaDataBlockTest.class.st +++ b/src/Microdown-Tests/MicMetaDataBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicMetaDataBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicMetaDataBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> subjectClass [ ^ MicMetaDataBlock ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testCorrectJSONMetaDataProducesDictionary [ | source root metadata | @@ -23,7 +25,7 @@ MicMetaDataBlockTest >> testCorrectJSONMetaDataProducesDictionary [ self assert: (metadata body at: 'title') equals: 'Pharo by Example'. ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testCorrectMetaDataWithEmptyLinesProduceJSON [ | source root metadata | @@ -42,7 +44,7 @@ MicMetaDataBlockTest >> testCorrectMetaDataWithEmptyLinesProduceJSON [ self assert: (metadata body at: 'title') equals: 'Pharo by Example'. ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testMetaDataEatsOtherBlocks [ "this is normal since { @@ -65,7 +67,7 @@ then it eats. ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testParse [ | source root metadata | @@ -82,7 +84,7 @@ MicMetaDataBlockTest >> testParse [ ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testUncorrectJSONMetaDataProducesDictionaryWithContents [ | source root metadata | @@ -98,7 +100,7 @@ MicMetaDataBlockTest >> testUncorrectJSONMetaDataProducesDictionaryWithContents ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testUncorrectJSONMetaDataProducesDictionaryWithContents2 [ | source root metadata | @@ -114,7 +116,7 @@ title" : "Pharo by Example"'. ] -{ #category : #tests } +{ #category : 'tests' } MicMetaDataBlockTest >> testUncorrectJSONMetaDataProducesDictionaryWithContents3 [ | source root metadata | diff --git a/src/Microdown-Tests/MicMicrodownSnippetFactory.class.st b/src/Microdown-Tests/MicMicrodownSnippetFactory.class.st index 606fc4d4..ad3aacc5 100644 --- a/src/Microdown-Tests/MicMicrodownSnippetFactory.class.st +++ b/src/Microdown-Tests/MicMicrodownSnippetFactory.class.st @@ -20,70 +20,72 @@ Internal Representation and Key Implementation Points. This class uses Microdown as parser, but it could be specialized to change the parser class rewriting the initialize method. " Class { - #name : #MicMicrodownSnippetFactory, - #superclass : #Object, + #name : 'MicMicrodownSnippetFactory', + #superclass : 'Object', #instVars : [ 'parserClass' ], #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Snippets' + #category : 'Microdown-Tests-Snippets', + #package : 'Microdown-Tests', + #tag : 'Snippets' } -{ #category : #utilities } +{ #category : 'utilities' } MicMicrodownSnippetFactory class >> buildDocument [ "Answer a with a whole document made up from the receiver's methods containing Microdown samples" - ^ String streamContents: [ : stream | - | factory | - factory := self new. - (self protocols difference: { #initialization . #utilities }) - collect: [ : protoName | self organization listAtCategoryNamed: protoName ] - thenDo: [ : protoCollection | - protoCollection - select: #isUnary - thenDo: [ : elementTypeSelector | - stream - cr; - << (factory perform: elementTypeSelector) ] ] ] -] - -{ #category : #anchor } + ^ String streamContents: [ :stream | + | factory | + factory := self new. + ((self protocols collect: [ :each | each name ]) difference: { #initialization. #utilities }) + collect: [ :proto | self selectorsInProtocol: proto ] + thenDo: [ :protoCollection | + protoCollection + select: #isUnary + thenDo: [ :elementTypeSelector | + stream + cr; + << (factory perform: elementTypeSelector) ] ] ] +] + +{ #category : 'anchor' } MicMicrodownSnippetFactory >> anchorAreTrimedSample [ ^ AnchorMarkup, ' test ' ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> anchorReferenceSample [ ^ '*@Foo@*' ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> anchorSample [ ^ AnchorMarkup, 'test' ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> anchorWithNewLineSample [ ^ AnchorMarkup , 'foo' , self newLine ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> anchorWithSpaceInsideSample [ ^ AnchorMarkup, 'foo bar' ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> annotatedSample [ ^ '!!label Foo _bar_ ' ] -{ #category : #annotations } +{ #category : 'annotations' } MicMicrodownSnippetFactory >> annotationSample [ ^ ' @@ -91,13 +93,13 @@ abc', AnnotationOpenerMarkup , 'Foo | value=aFoo&label=42 ', AnnotationCloserMa ' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockParameterWithLiteralArraySample [ ^ self codeblock: 'foo=#(1 2 true)' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockSampleOnMultipleLines [ ^ self codeblockNoParamBody: 'first line @@ -105,55 +107,55 @@ second line third line **b**' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithLanguageSample [ ^ self codeblock: 'language=smalltalk' body: 'foo' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithNewLineSample [ ^ (self codeblockNoParamBody: 'foo') , self newLine ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithParameterTrueByDefaultSample [ ^ self codeblock: 'foo' body: 'bar' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithParameterWithFloatSample [ ^ self codeblock: 'ratio=0.8' body: 'bar' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithParameterWithLiteralArraySample [ ^ self codeblock: 'foo=#(1 2 true)' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithParameterWithNoValuesSample [ ^ self codeblock: 'foo=' body: 'bar' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithParametersSample [ ^ self codeblock: 'foo=true&bar=2' body: 'bla' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithParametersWithCaptionSample [ ^ self codeblock: 'caption=`Color` is beautifull&bar=2' body: 'bla' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithSpaceAtTheEndSample [ ^ (self codeblockNoParamBody: 'foo'), ' '. @@ -161,31 +163,31 @@ MicMicrodownSnippetFactory >> blockWithSpaceAtTheEndSample [ ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> blockWithSpacedParametersSample [ ^ self codeblock: ' foo = true & bar = 2' body: 'bla' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> boldFormatEmptySample [ ^ self surround: '' withMarkup: BoldMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> boldFormatSample [ ^ self surroundWithMarkup: BoldMarkup ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> codeBlockSample [ ^ ' ```ab``` ' ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> codeblock: param [ ^ String streamContents: [ :st | @@ -197,7 +199,7 @@ MicMicrodownSnippetFactory >> codeblock: param [ ] ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> codeblock: param body: body [ ^ String streamContents: [ :st | @@ -211,7 +213,7 @@ MicMicrodownSnippetFactory >> codeblock: param body: body [ ] ] -{ #category : #'code block' } +{ #category : 'code block' } MicMicrodownSnippetFactory >> codeblockNoParamBody: body [ ^ String streamContents: [ :st | @@ -224,20 +226,20 @@ MicMicrodownSnippetFactory >> codeblockNoParamBody: body [ ] ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> columnSample [ ^ EnvironmentOpeningBlockMarkup, 'column|width=42 this is a **text** ',EnvironmentClosingBlockMarkup ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> columnsSample [ ^ EnvironmentOpeningBlockMarkup, 'columns|width=42 ',EnvironmentClosingBlockMarkup ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> columnsWithChildrenSample [ ^ EnvironmentOpeningBlockMarkup,'columns|width=42 ', self columnSample ,' @@ -245,17 +247,17 @@ MicMicrodownSnippetFactory >> columnsWithChildrenSample [ ',EnvironmentClosingBlockMarkup ] -{ #category : #block } +{ #category : 'block' } MicMicrodownSnippetFactory >> commentSample [ ^ '% Foo' ] -{ #category : #utilities } +{ #category : 'utilities' } MicMicrodownSnippetFactory >> documentFrom: aString [ ^ parserClass new parse: aString ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> environmentSample [ ^ ' @@ -266,7 +268,7 @@ Foo ',EnvironmentClosingBlockMarkup ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> environmentWithInnerBlockSample [ ^ ' ',EnvironmentOpeningBlockMarkup,'Foo|value=aFoo&label=42 @@ -282,7 +284,7 @@ This is a codeBlock ',EnvironmentClosingBlockMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureBoldSample [ ^ ' @@ -290,7 +292,7 @@ MicMicrodownSnippetFactory >> figureBoldSample [ ' ] -{ #category : #figures } +{ #category : 'figures' } MicMicrodownSnippetFactory >> figureGoutDeFraise [ ^ ' @@ -298,7 +300,7 @@ MicMicrodownSnippetFactory >> figureGoutDeFraise [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureItalicSample [ ^ ' @@ -307,7 +309,7 @@ MicMicrodownSnippetFactory >> figureItalicSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureMonospaceSample [ ^ ' @@ -316,7 +318,7 @@ MicMicrodownSnippetFactory >> figureMonospaceSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureNestedSample [ ^ ' @@ -325,7 +327,7 @@ MicMicrodownSnippetFactory >> figureNestedSample [ ' ] -{ #category : #figures } +{ #category : 'figures' } MicMicrodownSnippetFactory >> figureRealSample [ ^ ' @@ -333,7 +335,7 @@ MicMicrodownSnippetFactory >> figureRealSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureSample [ ^ ' @@ -342,7 +344,7 @@ MicMicrodownSnippetFactory >> figureSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureSampleWithoutSizeAndLabel [ ^ ' @@ -351,7 +353,7 @@ MicMicrodownSnippetFactory >> figureSampleWithoutSizeAndLabel [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> figureStrikeSample [ ^ ' @@ -360,7 +362,7 @@ MicMicrodownSnippetFactory >> figureStrikeSample [ ' ] -{ #category : #figures } +{ #category : 'figures' } MicMicrodownSnippetFactory >> figureWithLabelWithoutSizeSample [ ^ ' @@ -369,7 +371,7 @@ MicMicrodownSnippetFactory >> figureWithLabelWithoutSizeSample [ ' ] -{ #category : #figures } +{ #category : 'figures' } MicMicrodownSnippetFactory >> figureWithoutCaptionSample [ ^ ' @@ -378,7 +380,7 @@ MicMicrodownSnippetFactory >> figureWithoutCaptionSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> fileFigureSample [ ^ ' @@ -387,60 +389,60 @@ MicMicrodownSnippetFactory >> fileFigureSample [ ' ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> footnoteSample [ ^ AnnotationOpenerMarkup ,'footnote|note=Pharo is cool', AnnotationCloserMarkup ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerEmptySample [ ^ self newLine , HeaderMarkup ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel1Sample [ ^ self newLine , (self headerLevel: 1) ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel2Sample [ ^ self newLine , (self headerLevel: 2) ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel3Sample [ ^ self newLine , (self headerLevel: 3) ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel3SampleWithNewLine [ ^ self newLine , (self headerLevel: 3) , self newLine ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel4Sample [ ^ self newLine , (self headerLevel: 4) ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel5Sample [ ^ self newLine , (self headerLevel: 5) ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel6Sample [ ^ self newLine , (self headerLevel: 6) ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerLevel: n [ ^ String streamContents: [ :st | @@ -448,121 +450,121 @@ MicMicrodownSnippetFactory >> headerLevel: n [ st nextPutAll: ' Foo'] ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerWithFormatSample [ ^ self newLine , HeaderMarkup , self space , self boldFormatSample ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerWithFormatSampleWithNewLine [ ^ self headerWithFormatSample, self newLine ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerWithNestedFormatSampleWithNewLine [ ^ self newLine , HeaderMarkup , self space , self nestedBoldFormatSample , self newLine ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> headerWithNewLineSample [ ^ self newLine , HeaderMarkup , 'Foo' , self newLine ] -{ #category : #headers } +{ #category : 'headers' } MicMicrodownSnippetFactory >> horizontalLineSample [ ^ HorizontalLineMarkup , self newLine ] -{ #category : #initialization } +{ #category : 'initialization' } MicMicrodownSnippetFactory >> initialize [ super initialize. parserClass := Microdown ] -{ #category : #inputFile } +{ #category : 'inputFile' } MicMicrodownSnippetFactory >> inputfileSample [ ^ EnvironmentOpeningBlockMarkup , 'inputFile | path=Chapters/text.md', EnvironmentClosingBlockMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> italicFormatEmptySample [ ^ self surround: '' withMarkup: ItalicMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> italicFormatSample [ ^ self surroundWithMarkup: ItalicMarkup ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> lineEndSample [ ^ '' ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> lineEndwithNewlineSample [ ^ String lf ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkBoldSample [ ^ ' [**Foo**](/anUrl) ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkHttpSample [ ^ ' [Foo](http://pharo.org/Community/) ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkItalicSample [ ^ ' [_Foo_](/anUrl) ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkMonospaceSample [ ^ ' [`Foo`](/anUrl) ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkNestedSample [ ^ ' [**_Foo_**](/anUrl) ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkSample [ ^ ' [Foo](/anUrl) ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> linkStrikeSample [ ^ ' [~Foo~](/anUrl) ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> listMultiSample [ | unordered | @@ -576,35 +578,35 @@ MicMicrodownSnippetFactory >> listMultiSample [ , unordered , '2. 8' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> listWithCommentSample [ ^ '1. Foo %Comment 2. Bar' ] -{ #category : #math } +{ #category : 'math' } MicMicrodownSnippetFactory >> mathInlineSample [ ^ ' $V_i = C_0 - C_3$ ' ] -{ #category : #math } +{ #category : 'math' } MicMicrodownSnippetFactory >> mathParametersSample [ ^ MathOpeningBlockMarkup, 'label=42 Foo ', MathClosingBlockMarkup ] -{ #category : #math } +{ #category : 'math' } MicMicrodownSnippetFactory >> mathParametersWithCaptionSample [ ^ MathOpeningBlockMarkup, 'caption=`Math` is good&label=42 Foo ', MathClosingBlockMarkup. ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> metaDataSample [ ^ '{ "author": "G. Foo", @@ -613,23 +615,23 @@ MicMicrodownSnippetFactory >> metaDataSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> monospaceFormatEmptySample [ ^ self surround: '' withMarkup: MonospaceMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> monospaceFormatSample [ ^ self surroundWithMarkup: MonospaceMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> nestedBoldFormatSample [ "self new nestedBoldFormatSample" ^ self surround: (self surround: 'Foo' withMarkup: BoldMarkup) withMarkup: ItalicMarkup ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> nestedOrderedList2Sample [ ^ ' - Foo @@ -643,7 +645,7 @@ MicMicrodownSnippetFactory >> nestedOrderedList2Sample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> nestedOrderedListSample [ ^ ' - Foo @@ -654,7 +656,7 @@ MicMicrodownSnippetFactory >> nestedOrderedListSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> nestedUnorderedListSample [ ^ ' - Foo @@ -665,41 +667,41 @@ MicMicrodownSnippetFactory >> nestedUnorderedListSample [ ' ] -{ #category : #utilities } +{ #category : 'utilities' } MicMicrodownSnippetFactory >> newLine [ ^ String cr ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> newlineCRLFSample [ ^ String crlf ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> newlineCRSample [ ^ self newLine ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> newlineLFSample [ ^ String lf ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> newlineSample [ ^ Smalltalk os lineEnding ] -{ #category : #inputFile } +{ #category : 'inputFile' } MicMicrodownSnippetFactory >> oneLineInputFileSample [ ^ EnvironmentOpeningBlockMarkup , 'inputFile | path=Chapters/text.md', EnvironmentClosingBlockMarkup ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> oneSlide [ ^ '> oneSlide [ !>' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListEmptySample [ ^ ' 1. ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListSample [ ^ ' 1. Foo ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListWithTwoItemsBoldFirstSample [ ^ @@ -733,7 +735,7 @@ MicMicrodownSnippetFactory >> orderedListWithTwoItemsBoldFirstSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListWithTwoItemsBoldSample [ ^ @@ -743,7 +745,7 @@ MicMicrodownSnippetFactory >> orderedListWithTwoItemsBoldSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListWithTwoItemsItalicSample [ ^ @@ -753,7 +755,7 @@ MicMicrodownSnippetFactory >> orderedListWithTwoItemsItalicSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListWithTwoItemsMonospaceSample [ ^ @@ -763,7 +765,7 @@ MicMicrodownSnippetFactory >> orderedListWithTwoItemsMonospaceSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListWithTwoItemsSample [ ^ @@ -773,7 +775,7 @@ MicMicrodownSnippetFactory >> orderedListWithTwoItemsSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> orderedListWithTwoItemsStrikeSample [ ^ @@ -783,65 +785,65 @@ MicMicrodownSnippetFactory >> orderedListWithTwoItemsStrikeSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphBoldSample [ ^ ' this is a **paragraph** ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphItalicSample [ ^ ' this is a _paragraph_ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphMonospaceSample [ ^ ' this is a `paragraph` ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphNestedSample [ ^ ' this is a **_paragraph_** ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphOnMultipleLinesSample [ ^ 'Je ne connais pas la peur, car la peur tue l''esprit. La peur est la petite mort qui conduit à l''oblitération totale. J''affonterai ma peur. Je lui permettrais de passer sur moi, au travers de moi. Et lorsqu''elle sera passée, je tournerai mon oeil interieur sur son chemin. Et là où elle sera passée, il n''y aura plus rien, rien que moi.' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphSample [ ^ ' Foo ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> paragraphStrikeSample [ ^ ' this is a ~paragraph~ ' ] -{ #category : #utilities } +{ #category : 'utilities' } MicMicrodownSnippetFactory >> parserClass [ ^ parserClass ] -{ #category : #anchor } +{ #category : 'anchor' } MicMicrodownSnippetFactory >> quoteSample [ ^ '> Foo' ] -{ #category : #figures } +{ #category : 'figures' } MicMicrodownSnippetFactory >> rawFormatInline [ ^ ' @@ -849,21 +851,21 @@ a{{_$Foo_}}b ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> rawFormatSample [ ^ ' a{{Foo}}b ' ] -{ #category : #figures } +{ #category : 'figures' } MicMicrodownSnippetFactory >> realLinkSample [ ^ ' [The Pharo Project](http://www.pharo.org) ' ] -{ #category : #document } +{ #category : 'document' } MicMicrodownSnippetFactory >> rootSample [ | stream | @@ -876,51 +878,51 @@ MicMicrodownSnippetFactory >> rootSample [ ^ stream contents ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParameterEscapeSample [ ^ 'value\==foo' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParameterSample [ ^ 'value=foo' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParameterValueSample [ ^ '=foo' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParameterWithSpacesBeforeAndAfterSample [ ^ ' foo = true & bar = 2 ' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParameterWithoutValueSample [ ^ 'foo' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParametersEscapeSample [ ^ 'value=foo\&&bar ' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptParametersMultipleSample [ ^ 'value=foo&bar ' ] -{ #category : #'code block parameter' } +{ #category : 'code block parameter' } MicMicrodownSnippetFactory >> scriptTwoParametersNoValueSample [ ^ 'foo&bar ' ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> simpleTable [ ^ ' | aaab | jkhjh | @@ -928,7 +930,7 @@ MicMicrodownSnippetFactory >> simpleTable [ | bar | rab |' ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> simpleTableFormat [ ^ ' | **aaab** | jkhjh | @@ -936,7 +938,7 @@ MicMicrodownSnippetFactory >> simpleTableFormat [ | bar | rab |' ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> simpleTableMoreFormat [ ^ ' | **aaab** bbbc _cccd_ | jkhjh | @@ -944,7 +946,7 @@ MicMicrodownSnippetFactory >> simpleTableMoreFormat [ | bar | rab |' ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> simpleTableShortRow [ ^ ' | aaab | jkhjh | @@ -952,40 +954,40 @@ MicMicrodownSnippetFactory >> simpleTableShortRow [ | bar |' ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> simpleTableWithoutHeaderTable [ ^ ' | aaab | jkhjh | | bar | rab |' ] -{ #category : #utilities } +{ #category : 'utilities' } MicMicrodownSnippetFactory >> space [ ^ String space ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> strikethroughFormatEmptySample [ ^ self surround: '' withMarkup: StrikeMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> strikethroughFormatSample [ ^ self surroundWithMarkup: StrikeMarkup ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> surround: aWord withMarkup: aMarkup [ ^ (aMarkup, aWord, aMarkup) asString ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> surroundWithMarkup: aMarkup [ ^ self surround: 'Foo' withMarkup: aMarkup ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> tableSample [ ^ '| aaab | jkhjh | | --- | --- | @@ -993,19 +995,19 @@ MicMicrodownSnippetFactory >> tableSample [ ' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> textSentenceSample [ ^ 'Je ne connaitrais pas la peur' ] -{ #category : #format } +{ #category : 'format' } MicMicrodownSnippetFactory >> textWithChevron [ ^ 'Pilou >> bla' ] -{ #category : #sample } +{ #category : 'sample' } MicMicrodownSnippetFactory >> trySlide [ ^ '> trySlide [ !>' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListEmptySample [ ^ UnorderedListMarkup ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListSample [ ^ ' @@ -1031,7 +1033,7 @@ MicMicrodownSnippetFactory >> unorderedListSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithSubListSample [ | listMarkup | @@ -1040,7 +1042,7 @@ MicMicrodownSnippetFactory >> unorderedListWithSubListSample [ , listMarkup , 'Bar' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithTwoItemsBoldSample [ | listMarkup | @@ -1050,7 +1052,7 @@ MicMicrodownSnippetFactory >> unorderedListWithTwoItemsBoldSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithTwoItemsItalicSample [ | listMarkup | @@ -1060,7 +1062,7 @@ MicMicrodownSnippetFactory >> unorderedListWithTwoItemsItalicSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithTwoItemsMonospaceSample [ | listMarkup | @@ -1070,7 +1072,7 @@ MicMicrodownSnippetFactory >> unorderedListWithTwoItemsMonospaceSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithTwoItemsNestedSample [ | listMarkup | @@ -1080,7 +1082,7 @@ MicMicrodownSnippetFactory >> unorderedListWithTwoItemsNestedSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithTwoItemsSample [ | listMarkup | @@ -1090,7 +1092,7 @@ MicMicrodownSnippetFactory >> unorderedListWithTwoItemsSample [ ' ] -{ #category : #list } +{ #category : 'list' } MicMicrodownSnippetFactory >> unorderedListWithTwoItemsStrikeSample [ | listMarkup | diff --git a/src/Microdown-Tests/MicMicrodownTextualBuilderTest.class.st b/src/Microdown-Tests/MicMicrodownTextualBuilderTest.class.st index de04826e..16a8b8ef 100644 --- a/src/Microdown-Tests/MicMicrodownTextualBuilderTest.class.st +++ b/src/Microdown-Tests/MicMicrodownTextualBuilderTest.class.st @@ -2,8 +2,8 @@ A MicMicrodownTextualBuilderTest is a test class for testing the behavior of MicMicrodownTextualBuilder " Class { - #name : #MicMicrodownTextualBuilderTest, - #superclass : #TestCase, + #name : 'MicMicrodownTextualBuilderTest', + #superclass : 'TestCase', #instVars : [ 'factory', 'builder' @@ -11,35 +11,37 @@ Class { #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Builder' + #category : 'Microdown-Tests-Builder', + #package : 'Microdown-Tests', + #tag : 'Builder' } -{ #category : #'tests - codeblock' } +{ #category : 'tests - codeblock' } MicMicrodownTextualBuilderTest >> exampleMathTextMultipleLines [ ^ 'y = 3 x = 2 + y' ] -{ #category : #'tests - codeblock' } +{ #category : 'tests - codeblock' } MicMicrodownTextualBuilderTest >> exampleTextMultipleLines [ ^ 'Hello Pharo' ] -{ #category : #running } +{ #category : 'running' } MicMicrodownTextualBuilderTest >> setUp [ super setUp. factory := MicMicrodownSnippetFactory new. builder := Microdown builder ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testAnchor [ self assert: (builder anchor: 'Anchor') contents equals: AnchorMarkup, 'Anchor' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testAnchorReference [ self @@ -47,13 +49,13 @@ MicMicrodownTextualBuilderTest >> testAnchorReference [ equals: AnchorReferenceOpenerMarkup, 'AnchorReference', AnchorReferenceCloserMarkup ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testAnnotated [ self assert: (builder annotated: 'anAnnotation' paragraph: [ builder text: 'anAnnotatedParagraph' ]) contents equals: '!!anAnnotation anAnnotatedParagraph', String cr ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testAnnotation [ self @@ -61,7 +63,7 @@ MicMicrodownTextualBuilderTest >> testAnnotation [ equals: AnnotationOpenerMarkup,'anAnnotationName | label=aLabel&value=42', AnnotationCloserMarkup ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testAnnotationNoArgs [ self @@ -69,13 +71,13 @@ MicMicrodownTextualBuilderTest >> testAnnotationNoArgs [ equals: AnnotationOpenerMarkup, 'anAnnotationName', AnnotationCloserMarkup ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicMicrodownTextualBuilderTest >> testBold [ self assert: (builder bold: [builder text: 'Bold']) contents equals: '**Bold**' ] -{ #category : #tests } +{ #category : 'tests' } MicMicrodownTextualBuilderTest >> testCell [ self @@ -86,7 +88,7 @@ MicMicrodownTextualBuilderTest >> testCell [ equals: '| this is **bold** ' ] -{ #category : #'tests - codeblock' } +{ #category : 'tests - codeblock' } MicMicrodownTextualBuilderTest >> testCodeBlock [ "```language2=Pharo&caption=`Color` is cool @@ -112,7 +114,7 @@ MicMicrodownTextualBuilderTest >> testCodeBlock [ ] -{ #category : #'tests - codeblock' } +{ #category : 'tests - codeblock' } MicMicrodownTextualBuilderTest >> testCodeBlockCaptionContainsMonospace [ "```language2=Pharo&caption=`Color` is cool @@ -140,7 +142,7 @@ MicMicrodownTextualBuilderTest >> testCodeBlockCaptionContainsMonospace [ ] -{ #category : #'tests - slides' } +{ #category : 'tests - slides' } MicMicrodownTextualBuilderTest >> testColumns [ self @@ -153,7 +155,7 @@ This is a paragraph in a columns ' ] -{ #category : #'tests - slides' } +{ #category : 'tests - slides' } MicMicrodownTextualBuilderTest >> testColumnsWithChildren [ self @@ -173,13 +175,13 @@ This is a paragraph in a column ' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testComment [ self assert: (builder comment: 'Comment') contents equals: CommentedLineMarkup, ' Comment' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testEnvironment [ self @@ -188,7 +190,7 @@ MicMicrodownTextualBuilderTest >> testEnvironment [ !>' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testEnvironmentWithBody [ self @@ -200,7 +202,7 @@ aText !>' ] -{ #category : #'tests - references' } +{ #category : 'tests - references' } MicMicrodownTextualBuilderTest >> testExternalLink [ self @@ -208,7 +210,7 @@ MicMicrodownTextualBuilderTest >> testExternalLink [ equals: '[aDescription](anUrl)' ] -{ #category : #'tests - references' } +{ #category : 'tests - references' } MicMicrodownTextualBuilderTest >> testExternalLinkWithBold [ self @@ -216,7 +218,7 @@ MicMicrodownTextualBuilderTest >> testExternalLinkWithBold [ equals: '[**aDescription**](anUrl)' ] -{ #category : #'tests - references' } +{ #category : 'tests - references' } MicMicrodownTextualBuilderTest >> testExternalLinkWithItalic [ self @@ -224,7 +226,7 @@ MicMicrodownTextualBuilderTest >> testExternalLinkWithItalic [ equals: '[_aDescription_](anUrl)' ] -{ #category : #'tests - references' } +{ #category : 'tests - references' } MicMicrodownTextualBuilderTest >> testExternalLinkWithMonospace [ self @@ -232,7 +234,7 @@ MicMicrodownTextualBuilderTest >> testExternalLinkWithMonospace [ equals: '[`aDescription`](anUrl)' ] -{ #category : #'tests - references' } +{ #category : 'tests - references' } MicMicrodownTextualBuilderTest >> testExternalLinkWithNested [ self @@ -240,7 +242,7 @@ MicMicrodownTextualBuilderTest >> testExternalLinkWithNested [ equals: '[**_aDescription_**](anUrl)' ] -{ #category : #'tests - references' } +{ #category : 'tests - references' } MicMicrodownTextualBuilderTest >> testExternalLinkWithStrike [ self @@ -248,7 +250,7 @@ MicMicrodownTextualBuilderTest >> testExternalLinkWithStrike [ contents equals: '[~aDescription~](anUrl)' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicMicrodownTextualBuilderTest >> testFigureInPresenceOfParagraph [ | dictionnary | dictionnary := {'label'->'aLabel' . 'size'->'80'} asOrderedDictionary. @@ -264,7 +266,7 @@ MicMicrodownTextualBuilderTest >> testFigureInPresenceOfParagraph [ ![it is a beautifull figure](http://www.pharo.org/files/ouf.png label=aLabel&size=80)' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicMicrodownTextualBuilderTest >> testFigureWithBold [ self @@ -275,7 +277,7 @@ MicMicrodownTextualBuilderTest >> testFigureWithBold [ equals: '![it is a**beautifull**figure](http://www.pharo.org/light.jpeg)' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicMicrodownTextualBuilderTest >> testFigureWithParameters [ | dictionnary | dictionnary := {'label'->'aLabel' . 'size'->'80'} asOrderedDictionary. @@ -288,12 +290,12 @@ MicMicrodownTextualBuilderTest >> testFigureWithParameters [ equals: '![it is a beautifull figure](http://www.pharo.org/flo.png label=aLabel&size=80)' ] -{ #category : #tests } +{ #category : 'tests' } MicMicrodownTextualBuilderTest >> testHeadCell [ self assert: builder headCell contents equals: '| --- ' ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicMicrodownTextualBuilderTest >> testHeaderWithItalic [ self @@ -306,7 +308,7 @@ MicMicrodownTextualBuilderTest >> testHeaderWithItalic [ ' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testHorizontalLine [ self @@ -314,7 +316,7 @@ MicMicrodownTextualBuilderTest >> testHorizontalLine [ equals: HorizontalLineMarkup, String cr ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testInputfile [ self @@ -323,13 +325,13 @@ MicMicrodownTextualBuilderTest >> testInputfile [ ',EnvironmentOpeningBlockMarkup ,'inputFile|path=Chapters/image.png', EnvironmentClosingBlockMarkup ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicMicrodownTextualBuilderTest >> testItalic [ self assert: (builder italic: [ builder text: 'Italic' ]) contents equals: '_Italic_' ] -{ #category : #'tests - codeblock' } +{ #category : 'tests - codeblock' } MicMicrodownTextualBuilderTest >> testMathBlockCaptionContainsMonospace [ "```language2=Pharo&caption=`Color` is cool @@ -354,13 +356,13 @@ MathOpeningBlockMarkup, 'label=Math&caption=`Math` is cool ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testMathInline [ self assert: (builder mathInline: 'x = 2 + y') contents equals: '$x = 2 + y$' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testMetaData [ self @@ -368,13 +370,13 @@ MicMicrodownTextualBuilderTest >> testMetaData [ equals: MetaDataOpeningBlockMarkup , String cr ,'"label" : "aLabel",' , String cr, '"size" : "142"', String cr , MetaDataClosingBlockMarkup ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicMicrodownTextualBuilderTest >> testMonospace [ self assert: (builder monospace: 'Monospace') contents equals: '`Monospace`' ] -{ #category : #'tests - slides' } +{ #category : 'tests - slides' } MicMicrodownTextualBuilderTest >> testOneColumn [ self @@ -389,7 +391,7 @@ This is a paragraph in a column ' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testOrderedListDuring [ self @@ -402,32 +404,32 @@ MicMicrodownTextualBuilderTest >> testOrderedListDuring [ ' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testParagraph [ self assert: (builder paragraph: [ builder text: 'aParagraph' ]) contents equals: 'aParagraph', String cr ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testQuoteBlock [ self assert: (builder quoteBlock: 'aQuote') contents equals: PreformattedMarkup, ' aQuote' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testRawFormat [ self assert: (builder rawFormat: 'aRawFormat') contents equals: RawOpenerMarkup, 'aRawFormat', RawCloserMarkup ] -{ #category : #tests } +{ #category : 'tests' } MicMicrodownTextualBuilderTest >> testRawParametersWithNotStringAtValue [ builder rawParameters: { 'label'->42 . 'size'->MicTextBlock } asDictionary. self assert: builder contents equals: 'label=42&size=MicTextBlock' ] -{ #category : #'tests - slides' } +{ #category : 'tests - slides' } MicMicrodownTextualBuilderTest >> testSimpleSlide [ self @@ -441,13 +443,13 @@ This is a paragraph in a slide ' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicMicrodownTextualBuilderTest >> testStrike [ self assert: (builder strike: [ builder text: 'Strike']) contents equals: '~Strike~' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicMicrodownTextualBuilderTest >> testStrikeInHeader [ self assert: (builder @@ -460,7 +462,7 @@ MicMicrodownTextualBuilderTest >> testStrikeInHeader [ ' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicMicrodownTextualBuilderTest >> testUnorderedList [ self diff --git a/src/Microdown-Tests/MicOrderedListBlockTest.class.st b/src/Microdown-Tests/MicOrderedListBlockTest.class.st index 99031650..2b8bbe90 100644 --- a/src/Microdown-Tests/MicOrderedListBlockTest.class.st +++ b/src/Microdown-Tests/MicOrderedListBlockTest.class.st @@ -2,17 +2,19 @@ I'm a test class for testing the behavior of ordered list blocks " Class { - #name : #MicOrderedListBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicOrderedListBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #factory } +{ #category : 'factory' } MicOrderedListBlockTest >> orderedListBlockClass [ ^ MicOrderedListBlock ] -{ #category : #functions } +{ #category : 'functions' } MicOrderedListBlockTest >> orderedListWithTwoItemsBoldFirstSample [ ^ ' @@ -21,12 +23,12 @@ MicOrderedListBlockTest >> orderedListWithTwoItemsBoldFirstSample [ ' ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> subjectClass [ ^ MicOrderedListBlock ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testEmbeddedUnordered [ | source root list | source := @@ -49,7 +51,7 @@ MicOrderedListBlockTest >> testEmbeddedUnordered [ children second children first text equals: 'sublevel item 1'. ] -{ #category : #'tests - nested' } +{ #category : 'tests - nested' } MicOrderedListBlockTest >> testNestedLevel [ | source root list item1 | source := @@ -77,7 +79,7 @@ MicOrderedListBlockTest >> testNestedLevel [ ] -{ #category : #'tests - nested' } +{ #category : 'tests - nested' } MicOrderedListBlockTest >> testNestedLevel2 [ | source root list item1 sublevelItem | source := @@ -107,7 +109,7 @@ MicOrderedListBlockTest >> testNestedLevel2 [ ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testNotSpawingNewParagraph [ | root list | root := parser @@ -126,7 +128,7 @@ follow up of second item'. ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testSingleLevelList2 [ | source root list | source := @@ -141,7 +143,7 @@ expanded'. self assert: list startIndex equals: 19 ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testSingleLevelList2WithNoIndent [ "when we want a paragraph to be part of an item it should be indented " @@ -163,7 +165,7 @@ expanded as new paragraph part of item2' ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testSingleLevelListWithNormalNumbering [ | root list | root := parser @@ -178,7 +180,7 @@ MicOrderedListBlockTest >> testSingleLevelListWithNormalNumbering [ ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testSingleLevelListWithNormalNumberingWithEmptyLines [ | root list | root := parser @@ -197,7 +199,7 @@ MicOrderedListBlockTest >> testSingleLevelListWithNormalNumberingWithEmptyLines ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testSingleLevelListWithStrangelyNumberedItems [ | root list | root := parser @@ -211,7 +213,7 @@ MicOrderedListBlockTest >> testSingleLevelListWithStrangelyNumberedItems [ self assert: list children second text equals: 'item 2' ] -{ #category : #tests } +{ #category : 'tests' } MicOrderedListBlockTest >> testSpawingNewParagraph [ | root | root := parser @@ -230,7 +232,7 @@ follow up of second item'. ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicOrderedListBlockTest >> testUnOrderedListAPIToAccessText [ | list | diff --git a/src/Microdown-Tests/MicParagraphBlockTest.class.st b/src/Microdown-Tests/MicParagraphBlockTest.class.st index 4066b730..6a65a022 100644 --- a/src/Microdown-Tests/MicParagraphBlockTest.class.st +++ b/src/Microdown-Tests/MicParagraphBlockTest.class.st @@ -2,17 +2,19 @@ I'm is a test class for testing the behavior of paragraph block. " Class { - #name : #MicParagraphBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicParagraphBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> subjectClass [ ^ MicParagraphBlock ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testANewLineCreatesANewParagraph [ "**Hello @@ -28,7 +30,7 @@ a paragraph on two lines**'. ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testBoldMultipleLinesWithNewLine [ | root | @@ -55,7 +57,7 @@ another line** and more'. equals: #basic ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testCanConsumeLine [ "A list item does not force the creation of a new paragraph when the line is correctly indented. currently the implementation does not create a paragraph as a child of list item." @@ -77,7 +79,7 @@ a paragraph in a list item'. ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testCanConsumeLineBasic [ | root paragraph | @@ -95,7 +97,7 @@ MicParagraphBlockTest >> testCanConsumeLineBasic [ Another line'. ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testCanConsumeLineOtherBlocks [ | root paragraph | @@ -113,7 +115,7 @@ MicParagraphBlockTest >> testCanConsumeLineOtherBlocks [ self deny: (paragraph canConsumeLine: '1. '). ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testHandlingSequenceOfBasicLinesProducesAParagraph [ | root paragraph | @@ -127,7 +129,7 @@ And that other line'. self assert: root children size equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testSingleParagraph [ | root | root := parser parse: 'This is @@ -140,7 +142,7 @@ a paragraph on two lines'. ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testSingleParagraphWithIndentedText [ | source root expected | source := 'This is @@ -153,7 +155,7 @@ and one with tabs'. self assert: root children first text equals: expected ] -{ #category : #tests } +{ #category : 'tests' } MicParagraphBlockTest >> testTwoSingleParagraphs [ | root | root := parser parse: 'This is diff --git a/src/Microdown-Tests/MicParserTest.class.st b/src/Microdown-Tests/MicParserTest.class.st index 2f210bed..4ddf27ab 100644 --- a/src/Microdown-Tests/MicParserTest.class.st +++ b/src/Microdown-Tests/MicParserTest.class.st @@ -1,23 +1,25 @@ Class { - #name : #MicParserTest, - #superclass : #TestCase, + #name : 'MicParserTest', + #superclass : 'TestCase', #instVars : [ 'parser' ], #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #running } +{ #category : 'running' } MicParserTest >> setUp [ super setUp. parser := MicrodownParser new. ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testEmpty [ | source root | source := ''. @@ -26,7 +28,7 @@ MicParserTest >> testEmpty [ ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testEmptyOnMultipleLines [ | source root | source := ' @@ -38,42 +40,42 @@ MicParserTest >> testEmptyOnMultipleLines [ ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testIsAListDash [ self assert: (parser isAList: '- one') ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testIsAListNumbered [ self assert: (parser isAList: '11. one') ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testIsAListPlus [ self assert: (parser isAList: '+ one') ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testIsAListStar [ self assert: (parser isAList: '* one') ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testIsAListStar2 [ self assert: (parser isAList: ' * one' trim) ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testOnceParsedCurrentShouldBeTheRootblock [ | source root | @@ -83,7 +85,7 @@ a paragraph on two lines'. self assert: parser current == root ] -{ #category : #tests } +{ #category : 'tests' } MicParserTest >> testParsingLogic [ | source root textBody argument line code | diff --git a/src/Microdown-Tests/MicPharoEvaluatortBlockTest.class.st b/src/Microdown-Tests/MicPharoEvaluatortBlockTest.class.st index 3b72bb03..31365989 100644 --- a/src/Microdown-Tests/MicPharoEvaluatortBlockTest.class.st +++ b/src/Microdown-Tests/MicPharoEvaluatortBlockTest.class.st @@ -1,16 +1,18 @@ Class { - #name : #MicPharoEvaluatortBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Extensions' + #name : 'MicPharoEvaluatortBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicPharoEvaluatortBlockTest >> subjectClass [ ^ MicPharoEvaluatorBlock ] -{ #category : #tests } +{ #category : 'tests' } MicPharoEvaluatortBlockTest >> testScriptBloc [ | doc | diff --git a/src/Microdown-Tests/MicPharoImageResourceReferenceTest.class.st b/src/Microdown-Tests/MicPharoImageResourceReferenceTest.class.st index d33a0df0..0b343477 100644 --- a/src/Microdown-Tests/MicPharoImageResourceReferenceTest.class.st +++ b/src/Microdown-Tests/MicPharoImageResourceReferenceTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicPharoImageResourceReferenceTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Resolution' + #name : 'MicPharoImageResourceReferenceTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #'test support' } +{ #category : 'test support' } MicPharoImageResourceReferenceTest class >> microdownProducingMethod [ ^ Microdown parse: 'I am **bold**' ] -{ #category : #tests } +{ #category : 'tests' } MicPharoImageResourceReferenceTest >> testIcon [ | uri image | @@ -19,7 +21,7 @@ MicPharoImageResourceReferenceTest >> testIcon [ self assert: image equals: (Object iconNamed: #info) ] -{ #category : #tests } +{ #category : 'tests' } MicPharoImageResourceReferenceTest >> testMicrodownImport [ | ref doc | @@ -30,7 +32,7 @@ MicPharoImageResourceReferenceTest >> testMicrodownImport [ self assert: doc children notEmpty ] -{ #category : #tests } +{ #category : 'tests' } MicPharoImageResourceReferenceTest >> testSingleSlash [ | uri | diff --git a/src/Microdown-Tests/MicPharoScriptBlockTest.class.st b/src/Microdown-Tests/MicPharoScriptBlockTest.class.st index 497ce154..24702703 100644 --- a/src/Microdown-Tests/MicPharoScriptBlockTest.class.st +++ b/src/Microdown-Tests/MicPharoScriptBlockTest.class.st @@ -1,16 +1,18 @@ Class { - #name : #MicPharoScriptBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Extensions' + #name : 'MicPharoScriptBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicPharoScriptBlockTest >> subjectClass [ ^ MicPharoScriptBlock ] -{ #category : #tests } +{ #category : 'tests' } MicPharoScriptBlockTest >> testScriptBloc [ | doc | diff --git a/src/Microdown-Tests/MicPropertyError.class.st b/src/Microdown-Tests/MicPropertyError.class.st index 9e43edb4..27d3b353 100644 --- a/src/Microdown-Tests/MicPropertyError.class.st +++ b/src/Microdown-Tests/MicPropertyError.class.st @@ -1,5 +1,7 @@ Class { - #name : #MicPropertyError, - #superclass : #Error, - #category : #'Microdown-Tests-Parser' + #name : 'MicPropertyError', + #superclass : 'Error', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } diff --git a/src/Microdown-Tests/MicQuoteBlockTest.class.st b/src/Microdown-Tests/MicQuoteBlockTest.class.st index 8f29180a..2206d66d 100644 --- a/src/Microdown-Tests/MicQuoteBlockTest.class.st +++ b/src/Microdown-Tests/MicQuoteBlockTest.class.st @@ -2,17 +2,19 @@ I'm a test class for testing the behavior of MicBlockTextBlock " Class { - #name : #MicQuoteBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicQuoteBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicQuoteBlockTest >> subjectClass [ ^ MicQuoteBlock ] -{ #category : #tests } +{ #category : 'tests' } MicQuoteBlockTest >> testBasicQuoteBlock [ | source root | source := '> test1 @@ -26,7 +28,7 @@ test 2'. "note that this is wrong because the body of a quoteblock is a paragraph and can containsTruePositive: formatting else this is just a code block" ] -{ #category : #tests } +{ #category : 'tests' } MicQuoteBlockTest >> testNotLazy [ "the spec says that the last > could be omitted but we do not support it." | source root text | @@ -43,7 +45,7 @@ text3'. - text2' ] -{ #category : #tests } +{ #category : 'tests' } MicQuoteBlockTest >> testQuoteBlockDoesNotInterpretOtherBlockMarkup [ | source root text | source := '> text1 @@ -62,7 +64,7 @@ MicQuoteBlockTest >> testQuoteBlockDoesNotInterpretOtherBlockMarkup [ Yeah cool' ] -{ #category : #tests } +{ #category : 'tests' } MicQuoteBlockTest >> testSingleQuoteBlock [ | source root text | source := '> text1 @@ -77,7 +79,7 @@ MicQuoteBlockTest >> testSingleQuoteBlock [ text2' ] -{ #category : #tests } +{ #category : 'tests' } MicQuoteBlockTest >> testSingleQuoteBlockFollowedByList [ | source root text list | source := '> text1 diff --git a/src/Microdown-Tests/MicRawBlockTest.class.st b/src/Microdown-Tests/MicRawBlockTest.class.st index 38bf7151..4692d388 100644 --- a/src/Microdown-Tests/MicRawBlockTest.class.st +++ b/src/Microdown-Tests/MicRawBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicRawBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicRawBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicRawBlockTest >> subjectClass [ ^ MicRawBlock ] -{ #category : #tests } +{ #category : 'tests' } MicRawBlockTest >> testRaw [ | root | diff --git a/src/Microdown-Tests/MicRelativeResourceReferenceTest.class.st b/src/Microdown-Tests/MicRelativeResourceReferenceTest.class.st index 188c343b..63525838 100644 --- a/src/Microdown-Tests/MicRelativeResourceReferenceTest.class.st +++ b/src/Microdown-Tests/MicRelativeResourceReferenceTest.class.st @@ -2,12 +2,14 @@ A MicRelativeResourceReferenceTest is a test class for testing the behavior of MicRelativeResourceReference " Class { - #name : #MicRelativeResourceReferenceTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Resolution' + #name : 'MicRelativeResourceReferenceTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #tests } +{ #category : 'tests' } MicRelativeResourceReferenceTest >> testIsRelative [ | mic ref | mic := Microdown parse: '[look here](../images/rudolf.png)'. @@ -15,7 +17,7 @@ MicRelativeResourceReferenceTest >> testIsRelative [ self assert: ref reference isRelative ] -{ #category : #tests } +{ #category : 'tests' } MicRelativeResourceReferenceTest >> testPath [ self assert: 'figures/foo.png' asMicResourceReference path equals: 'figures/foo.png'. @@ -25,7 +27,7 @@ MicRelativeResourceReferenceTest >> testPath [ self assert: '../figures/foo.png' asMicResourceReference path equals: '../figures/foo.png' ] -{ #category : #tests } +{ #category : 'tests' } MicRelativeResourceReferenceTest >> testPrintOn [ | mic ref print | mic := Microdown parse: '[look here](../images/rudolf.png)'. @@ -34,7 +36,7 @@ MicRelativeResourceReferenceTest >> testPrintOn [ self assert: print equals: 'a MicRelativeResourceReference(../images/rudolf.png)' ] -{ #category : #tests } +{ #category : 'tests' } MicRelativeResourceReferenceTest >> testRelativePath [ | mic ref| mic := Microdown parse: '[look here](../images/rudolf.png)'. diff --git a/src/Microdown-Tests/MicResourceReferenceTest.class.st b/src/Microdown-Tests/MicResourceReferenceTest.class.st index 978697fe..b5dabf34 100644 --- a/src/Microdown-Tests/MicResourceReferenceTest.class.st +++ b/src/Microdown-Tests/MicResourceReferenceTest.class.st @@ -1,16 +1,18 @@ Class { - #name : #MicResourceReferenceTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Resolution' + #name : 'MicResourceReferenceTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #helper } +{ #category : 'helper' } MicResourceReferenceTest >> resourceClass [ ^ MicResourceReference ] -{ #category : #tests } +{ #category : 'tests' } MicResourceReferenceTest >> testHttpRecognized [ |uri ref| uri := 'https://raw.githubusercontent.com/pillar-markup/Microdown/dev/doc/testMicrodown/readme.md'. @@ -19,7 +21,7 @@ MicResourceReferenceTest >> testHttpRecognized [ self assert: ref class equals: MicHTTPResourceReference. ] -{ #category : #tests } +{ #category : 'tests' } MicResourceReferenceTest >> testIsDirectory [ | ref | @@ -27,7 +29,7 @@ MicResourceReferenceTest >> testIsDirectory [ self deny: ref isDirectory ] -{ #category : #tests } +{ #category : 'tests' } MicResourceReferenceTest >> testParseFullUrl [ | mf | @@ -36,7 +38,7 @@ MicResourceReferenceTest >> testParseFullUrl [ ] -{ #category : #'tests - file reference conversion' } +{ #category : 'tests - file reference conversion' } MicResourceReferenceTest >> testPurePathInterpretedAsFile [ | mf | mf := self resourceClass fromUri: '/chapter1/figures/m.md'. @@ -45,7 +47,7 @@ MicResourceReferenceTest >> testPurePathInterpretedAsFile [ ] -{ #category : #tests } +{ #category : 'tests' } MicResourceReferenceTest >> testPurePathIsRelativeFile [ | mf | @@ -55,7 +57,7 @@ MicResourceReferenceTest >> testPurePathIsRelativeFile [ ] -{ #category : #tests } +{ #category : 'tests' } MicResourceReferenceTest >> testRelativeFileRecognized [ | mf | @@ -65,7 +67,7 @@ MicResourceReferenceTest >> testRelativeFileRecognized [ ] -{ #category : #tests } +{ #category : 'tests' } MicResourceReferenceTest >> testStringExtensionMethod [ | ref | ref := 'http://somewhere.org/path/to/image.png' asMicResourceReference. diff --git a/src/Microdown-Tests/MicResourceSettingsTest.class.st b/src/Microdown-Tests/MicResourceSettingsTest.class.st index 371b8c0f..e976b97d 100644 --- a/src/Microdown-Tests/MicResourceSettingsTest.class.st +++ b/src/Microdown-Tests/MicResourceSettingsTest.class.st @@ -2,17 +2,19 @@ My tests leave the Microdown settings intact " Class { - #name : #MicResourceSettingsTest, - #superclass : #TestCase, + #name : 'MicResourceSettingsTest', + #superclass : 'TestCase', #instVars : [ 'subject', 'offlineSetting', 'isCachingRessourcesSetting' ], - #category : #'Microdown-Tests-Resolution' + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #utilities } +{ #category : 'utilities' } MicResourceSettingsTest >> cacheAt: aUrl [ | cache | cache := MicHTTPResourceReference resourcesCache. @@ -22,12 +24,12 @@ MicResourceSettingsTest >> cacheAt: aUrl [ ifFalse: [ nil ] ] -{ #category : #utilities } +{ #category : 'utilities' } MicResourceSettingsTest >> imageUrl [ ^ 'https://raw.githubusercontent.com/pillar-markup/Microdown/dev/doc/testMicrodown/toplevel.png' ] -{ #category : #running } +{ #category : 'running' } MicResourceSettingsTest >> setUp [ super setUp. @@ -36,7 +38,7 @@ MicResourceSettingsTest >> setUp [ isCachingRessourcesSetting := subject isCachingResources. ] -{ #category : #running } +{ #category : 'running' } MicResourceSettingsTest >> tearDown [ subject offline: offlineSetting. subject isCachingResources: isCachingRessourcesSetting. @@ -44,7 +46,7 @@ MicResourceSettingsTest >> tearDown [ super tearDown. ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsCashingResourcesFalse [ "Check that resources are cached when they should not be" | sample | @@ -55,7 +57,7 @@ MicResourceSettingsTest >> testIsCashingResourcesFalse [ self assert: (self cacheAt: self imageUrl asZnUrl ) isNil. ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsCashingResourcesTrue [ "Check that resources are cached when they should be" | sample | @@ -68,7 +70,7 @@ MicResourceSettingsTest >> testIsCashingResourcesTrue [ ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsOfflineAndResourceFound [ "Check that resources are found in the cache when offline" | sample | @@ -86,7 +88,7 @@ MicResourceSettingsTest >> testIsOfflineAndResourceFound [ self assert: (sample beginsWith: 'FooBarRules') not ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsOfflineFalse [ "Check that resources are not cached when they should not be" | sample | @@ -97,7 +99,7 @@ MicResourceSettingsTest >> testIsOfflineFalse [ self assert: (self cacheAt: self imageUrl asZnUrl ) isNil. ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsOfflineTrueAndResourceFound [ "Check that resources are found in the cache when offline" | sample | @@ -115,7 +117,7 @@ MicResourceSettingsTest >> testIsOfflineTrueAndResourceFound [ self assert: (sample beginsWith: 'FooBarRules') not ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsOfflineTrueAndResourceNotFound [ "Check that resources are found in the cache when offline" | sample | @@ -126,7 +128,7 @@ MicResourceSettingsTest >> testIsOfflineTrueAndResourceNotFound [ self assert: (sample asString beginsWith: 'FooBarRules') ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testIsOfflineTrueNotFound [ "Check that resources are cached when they should not be" | sample | @@ -137,7 +139,7 @@ MicResourceSettingsTest >> testIsOfflineTrueNotFound [ self assert: (self cacheAt: self imageUrl asZnUrl ) isNil ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testOnlyOneMethodInMicrodownDefinesSettings [ | all | all :=(Pragma allNamed: #systemsettings) @@ -146,7 +148,7 @@ MicResourceSettingsTest >> testOnlyOneMethodInMicrodownDefinesSettings [ self assert: all size equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } MicResourceSettingsTest >> testThereAreTwoSettings [ "I am an approximation, just making sure the two class variables exist" self assert: subject classVarNames equals: #(IsCachingResources Offline) diff --git a/src/Microdown-Tests/MicRootBlockTest.class.st b/src/Microdown-Tests/MicRootBlockTest.class.st index f5ad5123..f48a8c7c 100644 --- a/src/Microdown-Tests/MicRootBlockTest.class.st +++ b/src/Microdown-Tests/MicRootBlockTest.class.st @@ -2,17 +2,19 @@ I'm a test class for testing the behavior of MicRootBlock " Class { - #name : #MicRootBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicRootBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicRootBlockTest >> subjectClass [ ^ MicRootBlock ] -{ #category : #tests } +{ #category : 'tests' } MicRootBlockTest >> testRootCanConsumeLine [ "a root block can consume anything" diff --git a/src/Microdown-Tests/MicScriptBlockExtensionForTest.class.st b/src/Microdown-Tests/MicScriptBlockExtensionForTest.class.st index b426427e..9d8d19be 100644 --- a/src/Microdown-Tests/MicScriptBlockExtensionForTest.class.st +++ b/src/Microdown-Tests/MicScriptBlockExtensionForTest.class.st @@ -2,12 +2,14 @@ I am used in the MathBlockExtensionTest " Class { - #name : #MicScriptBlockExtensionForTest, - #superclass : #MicScriptBlock, - #category : #'Microdown-Tests-Extensions' + #name : 'MicScriptBlockExtensionForTest', + #superclass : 'MicScriptBlock', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #accessing } +{ #category : 'accessing' } MicScriptBlockExtensionForTest class >> tag [ ^#scriptBlockExtentionTest ] diff --git a/src/Microdown-Tests/MicScriptBlockExtensionTest.class.st b/src/Microdown-Tests/MicScriptBlockExtensionTest.class.st index 2a107a15..ee95544a 100644 --- a/src/Microdown-Tests/MicScriptBlockExtensionTest.class.st +++ b/src/Microdown-Tests/MicScriptBlockExtensionTest.class.st @@ -1,13 +1,15 @@ Class { - #name : #MicScriptBlockExtensionTest, - #superclass : #TestCase, + #name : 'MicScriptBlockExtensionTest', + #superclass : 'TestCase', #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Extensions' + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicScriptBlockExtensionTest >> testExtension [ "test that codeblock syntax be extended. The helper class MicScriptBlockExtensionForTest has extension tag scriptBlockExtentionTest" @@ -23,7 +25,7 @@ stuff which is left for the extension to handle self assert: extension body equals: 'stuff which is left for the extension to handle' ] -{ #category : #tests } +{ #category : 'tests' } MicScriptBlockExtensionTest >> testExtensionWithArguments [ "test that script interpret the arguments correctly" @@ -39,13 +41,13 @@ stuff which is left for the extension to handle assert: (extension arguments at: 'foe') equals: '42' ] -{ #category : #tests } +{ #category : 'tests' } MicScriptBlockExtensionTest >> testExtensionsAreNotDoneToCodeBlock [ "One should not make subclasses of codeblock, but script block" self assert: MicCodeBlock allSubclasses isEmpty ] -{ #category : #tests } +{ #category : 'tests' } MicScriptBlockExtensionTest >> testUndefinedExtensionIsCodeblock [ "test that unknown script extensions result in codeblock" diff --git a/src/Microdown-Tests/MicSlideBlockTest.class.st b/src/Microdown-Tests/MicSlideBlockTest.class.st index 953093e7..2f4bf43e 100644 --- a/src/Microdown-Tests/MicSlideBlockTest.class.st +++ b/src/Microdown-Tests/MicSlideBlockTest.class.st @@ -1,15 +1,17 @@ Class { - #name : #MicSlideBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Extensions' + #name : 'MicSlideBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Extensions', + #package : 'Microdown-Tests', + #tag : 'Extensions' } -{ #category : #tests } +{ #category : 'tests' } MicSlideBlockTest >> subjectClass [ ^ MicSlideBlock ] -{ #category : #tests } +{ #category : 'tests' } MicSlideBlockTest >> testSlideBloc [ | doc | @@ -24,7 +26,7 @@ MicSlideBlockTest >> testSlideBloc [ self assert: doc children first title equals: 'This is a cool title' ] -{ #category : #tests } +{ #category : 'tests' } MicSlideBlockTest >> testSlideBlocIsParsed [ | doc | diff --git a/src/Microdown-Tests/MicStringExtensionTest.class.st b/src/Microdown-Tests/MicStringExtensionTest.class.st index 3890794e..ffc05ccc 100644 --- a/src/Microdown-Tests/MicStringExtensionTest.class.st +++ b/src/Microdown-Tests/MicStringExtensionTest.class.st @@ -2,12 +2,14 @@ I test the string extensions made by Microdown " Class { - #name : #MicStringExtensionTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Parser' + #name : 'MicStringExtensionTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicStringExtensionTest >> testStripNTabs [ | one five | one := String tab. @@ -25,7 +27,7 @@ MicStringExtensionTest >> testStripNTabs [ assert: (five,'a' stripNtabs: 8) equals: 'a' ] -{ #category : #tests } +{ #category : 'tests' } MicStringExtensionTest >> testWithoutPreTabs [ | one five | one := String tab. diff --git a/src/Microdown-Tests/MicUnknownResourceUriTest.class.st b/src/Microdown-Tests/MicUnknownResourceUriTest.class.st index f84e26be..c74f6bf8 100644 --- a/src/Microdown-Tests/MicUnknownResourceUriTest.class.st +++ b/src/Microdown-Tests/MicUnknownResourceUriTest.class.st @@ -2,12 +2,14 @@ A MicUnknownResourceUriTest is a test class for testing the behavior of MicUnknownResourceUri " Class { - #name : #MicUnknownResourceUriTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Resolution' + #name : 'MicUnknownResourceUriTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #tests } +{ #category : 'tests' } MicUnknownResourceUriTest >> testBinaryStream [ | ref errorUri | errorUri := 'sqaf://foo/bar'. @@ -16,7 +18,7 @@ MicUnknownResourceUriTest >> testBinaryStream [ self assert: ref loadImage class equals: Form ] -{ #category : #tests } +{ #category : 'tests' } MicUnknownResourceUriTest >> testContents [ | ref errorUri | errorUri := 'sqaf://foo/bar'. @@ -24,7 +26,7 @@ MicUnknownResourceUriTest >> testContents [ self assert: (ref contents includesSubstring: errorUri) ] -{ #category : #tests } +{ #category : 'tests' } MicUnknownResourceUriTest >> testIsCatchAll [ | ref | ref := MicResourceReference fromUri: 'sqaf://foo/bar'. diff --git a/src/Microdown-Tests/MicUnorderedListBlockTest.class.st b/src/Microdown-Tests/MicUnorderedListBlockTest.class.st index 14f866cc..05d19d83 100644 --- a/src/Microdown-Tests/MicUnorderedListBlockTest.class.st +++ b/src/Microdown-Tests/MicUnorderedListBlockTest.class.st @@ -2,17 +2,19 @@ I'm a test class for testing the behavior of MicUnorderedListBlock " Class { - #name : #MicUnorderedListBlockTest, - #superclass : #MicBlockTest, - #category : #'Microdown-Tests-Parser' + #name : 'MicUnorderedListBlockTest', + #superclass : 'MicBlockTest', + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> subjectClass [ ^ MicUnorderedListBlock ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testEmbeddedOrdered [ | source root list | source := @@ -30,7 +32,7 @@ MicUnorderedListBlockTest >> testEmbeddedOrdered [ text equals: 'sublevel item 2' ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testEmbeddedOrderedWithFormatting [ | source root list item4 | source := @@ -54,7 +56,7 @@ MicUnorderedListBlockTest >> testEmbeddedOrderedWithFormatting [ self assert: item4 textElements third substring equals: 'item 24'. ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testMixing2 [ | source root list1 list2 | source := @@ -80,7 +82,7 @@ MicUnorderedListBlockTest >> testMixing2 [ self assert: list2 children second text equals: 'item 2'. ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testMixingOrderedInsideUnorderedWithParagraph [ | source root list1 | source := @@ -105,7 +107,7 @@ multiple lines 3. sub item 2'. ] -{ #category : #'tests - nested' } +{ #category : 'tests - nested' } MicUnorderedListBlockTest >> testNestedLevel [ | source root list item1| source := @@ -133,7 +135,7 @@ MicUnorderedListBlockTest >> testNestedLevel [ ] -{ #category : #'tests - nested' } +{ #category : 'tests - nested' } MicUnorderedListBlockTest >> testNestedLevel2 [ | source root list item1 sublevelItem| source := @@ -161,7 +163,7 @@ MicUnorderedListBlockTest >> testNestedLevel2 [ self assert: sublevelItem children second children first text equals: 'subsublevel'. ] -{ #category : #'tests - list' } +{ #category : 'tests - list' } MicUnorderedListBlockTest >> testOrderedListAPIToAccessText [ | list | @@ -171,7 +173,7 @@ MicUnorderedListBlockTest >> testOrderedListAPIToAccessText [ self assert: list text equals: '2.b' ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelList [ | source root list | source := @@ -183,7 +185,7 @@ MicUnorderedListBlockTest >> testSingleLevelList [ self assert: list children second text equals: 'item 2' ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelList2 [ | source root list | source := @@ -199,7 +201,7 @@ MicUnorderedListBlockTest >> testSingleLevelList2 [ expanded' ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelList2WithFormatting [ | source root list | source := @@ -217,7 +219,7 @@ expanded'. self assert: list children first textElements third substring equals: 'expanded'. ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListAllBulletTypes [ | source root list | source := @@ -229,7 +231,7 @@ MicUnorderedListBlockTest >> testSingleLevelListAllBulletTypes [ self assert: list children size equals: 2.] ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListSplitWithEmptyLine [ | source root list | source := @@ -249,7 +251,7 @@ MicUnorderedListBlockTest >> testSingleLevelListSplitWithEmptyLine [ ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListSplitWithMultipleEmptyLines [ | source root list | source := @@ -272,7 +274,7 @@ MicUnorderedListBlockTest >> testSingleLevelListSplitWithMultipleEmptyLines [ ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListStartingWithoutSpaceSplitParagraph [ | source root list | source := @@ -293,7 +295,7 @@ expanded'. ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListStartingWithoutSpaceSplitParagraph2 [ | source root list | source := @@ -315,7 +317,7 @@ same indentation no new paragraph'. ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListWithItemSpawning [ | root list | root := parser @@ -332,7 +334,7 @@ follow up of second item'. ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelListWithStar [ | source root list | source := @@ -344,7 +346,7 @@ MicUnorderedListBlockTest >> testSingleLevelListWithStar [ self assert: list children second text equals: 'item 2' ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testSingleLevelMixedList [ | source root list | source := @@ -357,7 +359,7 @@ MicUnorderedListBlockTest >> testSingleLevelMixedList [ self assert: list children second text equals: 'item 2' ] -{ #category : #tests } +{ #category : 'tests' } MicUnorderedListBlockTest >> testTwoLevelList [ | source root list | source := diff --git a/src/Microdown-Tests/MicZincPathResolverTest.class.st b/src/Microdown-Tests/MicZincPathResolverTest.class.st index afe14a10..e4ea15ab 100644 --- a/src/Microdown-Tests/MicZincPathResolverTest.class.st +++ b/src/Microdown-Tests/MicZincPathResolverTest.class.st @@ -2,12 +2,14 @@ A MicZincPathResolverTest is a test class for testing the behavior of MicZincPathResolver " Class { - #name : #MicZincPathResolverTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Resolution' + #name : 'MicZincPathResolverTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Resolution', + #package : 'Microdown-Tests', + #tag : 'Resolution' } -{ #category : #tests } +{ #category : 'tests' } MicZincPathResolverTest >> testVisitFileImage [ | doc imageNode absoluteFile | doc := Microdown parse: '![alttext](images/pharo.png)'. @@ -24,7 +26,7 @@ MicZincPathResolverTest >> testVisitFileImage [ self assert: imageNode reference filesystem equals: #Bogus ] -{ #category : #tests } +{ #category : 'tests' } MicZincPathResolverTest >> testVisitHttpImage [ | doc imageNode | doc := Microdown parse: '![alttext](images/pharo.png)'. @@ -37,7 +39,7 @@ MicZincPathResolverTest >> testVisitHttpImage [ self assert: imageNode reference uriString equals: 'http://nowhere/my/deep/directory/images/pharo.png'. ] -{ #category : #tests } +{ #category : 'tests' } MicZincPathResolverTest >> testVisitHttpInput [ | doc inputNode | doc := Microdown parse: ''. @@ -50,7 +52,7 @@ MicZincPathResolverTest >> testVisitHttpInput [ self assert: inputNode reference uriString equals: 'http://nowhere/my/deep/directory/otherFile.md'. ] -{ #category : #tests } +{ #category : 'tests' } MicZincPathResolverTest >> testVisitHttpInput_WithReference [ | doc inputNode | doc := Microdown parse: ''. @@ -63,7 +65,7 @@ MicZincPathResolverTest >> testVisitHttpInput_WithReference [ self assert: inputNode reference uriString equals: 'http://nowhere/my/deep/directory/otherFile.md'. ] -{ #category : #tests } +{ #category : 'tests' } MicZincPathResolverTest >> testVisitHttpLink [ | doc linkNode | doc := Microdown parse: '[follow me](otherFile.md)'. diff --git a/src/Microdown-Tests/MicrodownInlineParserTest.class.st b/src/Microdown-Tests/MicrodownInlineParserTest.class.st index 732da24b..abc09603 100644 --- a/src/Microdown-Tests/MicrodownInlineParserTest.class.st +++ b/src/Microdown-Tests/MicrodownInlineParserTest.class.st @@ -2,22 +2,24 @@ The logic is to call the main parser so that the inline elements are in the blocks as after the closeMe phase of a Block (this is where the inline block are parsed). " Class { - #name : #MicrodownInlineParserTest, - #superclass : #TestCase, + #name : 'MicrodownInlineParserTest', + #superclass : 'TestCase', #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #parsing } +{ #category : 'parsing' } MicrodownInlineParserTest >> parse: aString [ "self new parse: 'foo_abbb_zz' " ^ self parserClass parse: aString ] -{ #category : #parsing } +{ #category : 'parsing' } MicrodownInlineParserTest >> parseAndReturnElementsOfParagraphFor: aString [ "self new parse: 'foo_abbb_zz' " @@ -25,17 +27,17 @@ MicrodownInlineParserTest >> parseAndReturnElementsOfParagraphFor: aString [ ] -{ #category : #parsing } +{ #category : 'parsing' } MicrodownInlineParserTest >> parser [ ^ self parserClass new ] -{ #category : #parsing } +{ #category : 'parsing' } MicrodownInlineParserTest >> parserClass [ ^ Microdown ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> rawTestingFor: aString [ | elements | @@ -48,7 +50,7 @@ MicrodownInlineParserTest >> rawTestingFor: aString [ self assert: elements second closingDelimiter equals: '}}' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testAPIToAccessChildrenOfNestedElements [ | elements bold | @@ -68,7 +70,7 @@ MicrodownInlineParserTest >> testAPIToAccessChildrenOfNestedElements [ self assert: bold children second class equals: MicTextBlock. ] -{ #category : #'tests - anchors' } +{ #category : 'tests - anchors' } MicrodownInlineParserTest >> testAnchorReferenceWithoutClosure [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc*@anchorsdef'). @@ -76,7 +78,7 @@ MicrodownInlineParserTest >> testAnchorReferenceWithoutClosure [ self assert: elements first substring equals: 'abc*@anchorsdef' ] -{ #category : #'tests - anchors' } +{ #category : 'tests - anchors' } MicrodownInlineParserTest >> testAnchorRefernce [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc*@anchors@*def'). @@ -88,7 +90,7 @@ MicrodownInlineParserTest >> testAnchorRefernce [ self assert: elements second closingDelimiter equals: '@*' ] -{ #category : #'tests - annotations' } +{ #category : 'tests - annotations' } MicrodownInlineParserTest >> testAnnotationBasic [ | elements annotation | elements := self parseAndReturnElementsOfParagraphFor: 'needed ', AnnotationOpenerMarkup ,'footnote | value=A foonote is annotation.', AnnotationCloserMarkup. @@ -103,7 +105,7 @@ MicrodownInlineParserTest >> testAnnotationBasic [ ] -{ #category : #'tests - annotations' } +{ #category : 'tests - annotations' } MicrodownInlineParserTest >> testAnnotationPrintString [ | elements | @@ -113,7 +115,7 @@ MicrodownInlineParserTest >> testAnnotationPrintString [ self assert: elements second name equals: 'footnote' ] -{ #category : #'tests - annotations' } +{ #category : 'tests - annotations' } MicrodownInlineParserTest >> testAnnotations [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc', AnnotationOpenerMarkup,'footnote | value=A foonote is annotation.', AnnotationCloserMarkup,'def'. @@ -126,7 +128,7 @@ MicrodownInlineParserTest >> testAnnotations [ ] -{ #category : #'tests - annotations' } +{ #category : 'tests - annotations' } MicrodownInlineParserTest >> testAnnotationsWithoutClosure [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc> testAnnotationsWithoutClosure [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testBold [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc**bolds**def'. @@ -152,7 +154,7 @@ MicrodownInlineParserTest >> testBold [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testBoldsAndCorrectNestedItalics [ | elements bold italic | @@ -173,7 +175,7 @@ MicrodownInlineParserTest >> testBoldsAndCorrectNestedItalics [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testBoldsAndNestedItalics [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc**_bolds_**def'). @@ -185,7 +187,7 @@ MicrodownInlineParserTest >> testBoldsAndNestedItalics [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testBoldsAndNestedItalicsWithClosureAfterOpenItalics [ | elements | @@ -199,7 +201,7 @@ MicrodownInlineParserTest >> testBoldsAndNestedItalicsWithClosureAfterOpenItalic ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testBoldsWithoutClosure [ | elements | @@ -209,7 +211,7 @@ MicrodownInlineParserTest >> testBoldsWithoutClosure [ ] -{ #category : #'tests - others' } +{ #category : 'tests - others' } MicrodownInlineParserTest >> testEscape [ | elements | @@ -220,7 +222,7 @@ MicrodownInlineParserTest >> testEscape [ ] -{ #category : #tests } +{ #category : 'tests' } MicrodownInlineParserTest >> testEscapeAsLastCharacterDoesNotBreak [ | elts | @@ -240,7 +242,7 @@ MicrodownInlineParserTest >> testEscapeAsLastCharacterDoesNotBreak [ self assert: elts first substring equals: 'cha'. ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicrodownInlineParserTest >> testFigure [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc![caption](http://www.pharo.org?parameters=value)def'. @@ -252,7 +254,7 @@ MicrodownInlineParserTest >> testFigure [ self assert: elements second closingDelimiter equals: ')' ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicrodownInlineParserTest >> testFigureWithParameters [ | elements figure | @@ -265,7 +267,7 @@ MicrodownInlineParserTest >> testFigureWithParameters [ self assert: figure arguments keys size equals: 2 ] -{ #category : #'tests - figure' } +{ #category : 'tests - figure' } MicrodownInlineParserTest >> testFigureWithParameters_withoutQuotes [ | elements figure | @@ -278,7 +280,7 @@ MicrodownInlineParserTest >> testFigureWithParameters_withoutQuotes [ self assert: figure arguments keys size equals: 2 ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testItalic [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc_italics_def'. @@ -289,7 +291,7 @@ MicrodownInlineParserTest >> testItalic [ self assert: elements second openingDelimiter equals: '_' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testItalicsAndNestedBolds [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc_**italics**_def'). @@ -300,7 +302,7 @@ MicrodownInlineParserTest >> testItalicsAndNestedBolds [ self assert: elements second openingDelimiter equals: '_' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testItalicsAndNestedBoldsWithClosureAfterOpenBolds [ | elements | @@ -314,7 +316,7 @@ MicrodownInlineParserTest >> testItalicsAndNestedBoldsWithClosureAfterOpenBolds ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testItalicsWithoutClosure [ | elements | @@ -323,7 +325,7 @@ MicrodownInlineParserTest >> testItalicsWithoutClosure [ self assert: elements first substring equals: 'abc_italicsdef' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicrodownInlineParserTest >> testLink [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc[Pharo.Org](http://www.pharo.org)def'). @@ -339,7 +341,7 @@ MicrodownInlineParserTest >> testLink [ self assert: elements second closingDelimiter equals: ')' ] -{ #category : #'tests - link' } +{ #category : 'tests - link' } MicrodownInlineParserTest >> testLinkWithParameters [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc[GH Ducasse](https://github.com/Ducasse?tab=repositories)def'). @@ -354,7 +356,7 @@ MicrodownInlineParserTest >> testLinkWithParameters [ self assert: elements second closingDelimiter equals: ')' ] -{ #category : #'tests - others' } +{ #category : 'tests - others' } MicrodownInlineParserTest >> testMath [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: 'abc$V_i = C_0 - C_3$def'). @@ -365,7 +367,7 @@ MicrodownInlineParserTest >> testMath [ self assert: elements second openingDelimiter equals: '$' ] -{ #category : #'tests - others' } +{ #category : 'tests - others' } MicrodownInlineParserTest >> testMathBackslash [ | elements | elements := (self parseAndReturnElementsOfParagraphFor: '$ f(a) = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z - a} dz $'). @@ -373,7 +375,7 @@ MicrodownInlineParserTest >> testMathBackslash [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testMonospace [ | elements | @@ -386,7 +388,7 @@ MicrodownInlineParserTest >> testMonospace [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testMonospacesWithBackQuote [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc`foo\`bar`def'. @@ -395,7 +397,7 @@ MicrodownInlineParserTest >> testMonospacesWithBackQuote [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testMonospacesWithBackSlash [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc`foo\bar`def'. @@ -404,7 +406,7 @@ MicrodownInlineParserTest >> testMonospacesWithBackSlash [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testMonospacesWithDoubleBackSlash [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc`foo\\bar`def'. @@ -413,7 +415,7 @@ MicrodownInlineParserTest >> testMonospacesWithDoubleBackSlash [ ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testMonospacesWithTwoBackslashes [ | elements | elements := self parseAndReturnElementsOfParagraphFor: '`\a+\b`'. @@ -421,7 +423,7 @@ MicrodownInlineParserTest >> testMonospacesWithTwoBackslashes [ self assert: elements first substring equals: '\a+\b' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testMonospacesWithoutClosure [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc`monospacesdef'. @@ -430,7 +432,7 @@ MicrodownInlineParserTest >> testMonospacesWithoutClosure [ ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawWitoutClosure [ | elements | @@ -439,12 +441,12 @@ MicrodownInlineParserTest >> testRawWitoutClosure [ self assert: elements first substring equals: 'abc{{rawsdef' ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRaws [ self rawTestingFor: 'anything' ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawsDoesNotHandleWellCurly [ | elements | elements := self parseAndReturnElementsOfParagraphFor: 'abc{{', 'anything}', '}}def'. @@ -458,43 +460,43 @@ MicrodownInlineParserTest >> testRawsDoesNotHandleWellCurly [ ] -{ #category : #'tests - escape' } +{ #category : 'tests - escape' } MicrodownInlineParserTest >> testRawsDoesNotHandleWellEscape [ "Well, actually it does" self rawTestingFor: 'anything\*foo'. ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawsHandleWellCurlyIfNotLast [ self rawTestingFor: 'anything}88'. ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawsWithBold [ self rawTestingFor: '**bold**' ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawsWithItalic [ self rawTestingFor: '_italic_' ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawsWithMonospace [ self rawTestingFor: '`monononono`' ] -{ #category : #'tests - raw' } +{ #category : 'tests - raw' } MicrodownInlineParserTest >> testRawsWithStrike [ self rawTestingFor: '~strikkkkk~' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testStrike [ | elements | @@ -506,7 +508,7 @@ MicrodownInlineParserTest >> testStrike [ self assert: elements second openingDelimiter equals: '~' ] -{ #category : #'tests - format' } +{ #category : 'tests - format' } MicrodownInlineParserTest >> testStrikesWithoutClosure [ | elements | @@ -516,7 +518,7 @@ MicrodownInlineParserTest >> testStrikesWithoutClosure [ ] -{ #category : #'tests - structure' } +{ #category : 'tests - structure' } MicrodownInlineParserTest >> testStructureOfAnchorReference [ | element | @@ -526,7 +528,7 @@ MicrodownInlineParserTest >> testStructureOfAnchorReference [ ] -{ #category : #'tests - structure' } +{ #category : 'tests - structure' } MicrodownInlineParserTest >> testStructureOfAnnotation [ | element | @@ -537,7 +539,7 @@ MicrodownInlineParserTest >> testStructureOfAnnotation [ ] -{ #category : #'tests - structure' } +{ #category : 'tests - structure' } MicrodownInlineParserTest >> testStructureOfBoldNestedText [ | element | @@ -553,7 +555,7 @@ MicrodownInlineParserTest >> testStructureOfBoldNestedText [ ] -{ #category : #'tests - structure' } +{ #category : 'tests - structure' } MicrodownInlineParserTest >> testStructureOfBoldSimpleText [ | element | @@ -565,7 +567,7 @@ MicrodownInlineParserTest >> testStructureOfBoldSimpleText [ ] -{ #category : #'tests - structure' } +{ #category : 'tests - structure' } MicrodownInlineParserTest >> testStructureOfPlainText [ | element | diff --git a/src/Microdown-Tests/MicrodownParserTest.class.st b/src/Microdown-Tests/MicrodownParserTest.class.st index d36d4c7d..27555113 100644 --- a/src/Microdown-Tests/MicrodownParserTest.class.st +++ b/src/Microdown-Tests/MicrodownParserTest.class.st @@ -1,22 +1,24 @@ Class { - #name : #MicrodownParserTest, - #superclass : #TestCase, + #name : 'MicrodownParserTest', + #superclass : 'TestCase', #instVars : [ 'parser' ], #pools : [ 'MicMicrodownSharedPool' ], - #category : #'Microdown-Tests-Parser' + #category : 'Microdown-Tests-Parser', + #package : 'Microdown-Tests', + #tag : 'Parser' } -{ #category : #running } +{ #category : 'running' } MicrodownParserTest >> parser [ "for now this reference is needed and cannot be changed into Microdown" ^ MicrodownParser new ] -{ #category : #running } +{ #category : 'running' } MicrodownParserTest >> setUp [ "Hooks that subclasses may override to define the fixture of test." @@ -24,7 +26,7 @@ MicrodownParserTest >> setUp [ parser := self parser ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicrodownParserTest >> stestMathBlockWithArguments [ | source root math | @@ -39,7 +41,7 @@ MicrodownParserTest >> stestMathBlockWithArguments [ self assert: (math arguments at: 'caption') first substring equals: 'doNiceMath' ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicrodownParserTest >> testAnchorBlock [ | source root annotated | source := AnchorMarkup, 'label1'. @@ -51,7 +53,7 @@ MicrodownParserTest >> testAnchorBlock [ ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicrodownParserTest >> testAnchorBlockFollowingEachOther [ | source root annotated | @@ -68,7 +70,7 @@ MicrodownParserTest >> testAnchorBlockFollowingEachOther [ ] -{ #category : #'tests - anchor' } +{ #category : 'tests - anchor' } MicrodownParserTest >> testAnchorMarkupInsideLine [ | source root paragraph | @@ -82,7 +84,7 @@ MicrodownParserTest >> testAnchorMarkupInsideLine [ ] -{ #category : #'tests - annotated-paragraph' } +{ #category : 'tests - annotated-paragraph' } MicrodownParserTest >> testAnnotatedBlock [ | source root annotated | @@ -96,7 +98,7 @@ MicrodownParserTest >> testAnnotatedBlock [ ] -{ #category : #'tests - annotated-paragraph' } +{ #category : 'tests - annotated-paragraph' } MicrodownParserTest >> testAnnotatedBlockOnMultipleLinesParserLogic [ | source root annotated line | @@ -125,7 +127,7 @@ important point because...!'. ] -{ #category : #'tests - annotated-paragraph' } +{ #category : 'tests - annotated-paragraph' } MicrodownParserTest >> testAnnotatedBlockOnTwoLines [ | source root annotated | source := AnnotatedParagraphMarkup , 'important this is an important @@ -139,7 +141,7 @@ paragraph on two lines.' ] -{ #category : #'tests - annotated-paragraph' } +{ #category : 'tests - annotated-paragraph' } MicrodownParserTest >> testAnnotatedBlockOnTwoLinesWithFormatting [ | source root annotated | source := AnnotatedParagraphMarkup , 'important **this** is an _important_ @@ -154,7 +156,7 @@ paragraph on two lines.'. self assert: annotated textElements third kind equals: 'italic'. ] -{ #category : #'tests - annotated-paragraph' } +{ #category : 'tests - annotated-paragraph' } MicrodownParserTest >> testAnnotatedBlockTextElements [ | source root annotated | @@ -169,7 +171,7 @@ MicrodownParserTest >> testAnnotatedBlockTextElements [ ] -{ #category : #'tests - annotated-paragraph' } +{ #category : 'tests - annotated-paragraph' } MicrodownParserTest >> testAnnotatedBlockWithListParserLogic [ "The test does not test what we want. We want a listblock inside the annotatedBlock" | source root annotated line | @@ -204,7 +206,7 @@ MicrodownParserTest >> testAnnotatedBlockWithListParserLogic [ ] -{ #category : #'tests - comments' } +{ #category : 'tests - comments' } MicrodownParserTest >> testCommentOnMultipleLines [ | source root comment | @@ -218,7 +220,7 @@ a second comment' ] -{ #category : #'tests - comments' } +{ #category : 'tests - comments' } MicrodownParserTest >> testCommentOnMultipleLinesWithASingleMarkup [ | source root comment | @@ -234,7 +236,7 @@ MicrodownParserTest >> testCommentOnMultipleLinesWithASingleMarkup [ ] -{ #category : #'tests - comments' } +{ #category : 'tests - comments' } MicrodownParserTest >> testCommentSimple [ | source root comment | @@ -246,7 +248,7 @@ MicrodownParserTest >> testCommentSimple [ ] -{ #category : #'tests - comments' } +{ #category : 'tests - comments' } MicrodownParserTest >> testCommentedLineMarkupInsideLine [ | source root paragraph | @@ -259,7 +261,7 @@ MicrodownParserTest >> testCommentedLineMarkupInsideLine [ ] -{ #category : #tests } +{ #category : 'tests' } MicrodownParserTest >> testEnvironmentCitationWithArguments [ | source root environmentName contents child | environmentName := 'cite'. @@ -278,7 +280,7 @@ Pharo'. self assert: (child arguments at: 'c') equals: nil ] -{ #category : #'tests - environment' } +{ #category : 'tests - environment' } MicrodownParserTest >> testEnvironmentEatsNonClosedCodeMarkup [ | source root env environmentName contents | environmentName := 'card'. @@ -298,7 +300,7 @@ this is the end.'. ] -{ #category : #tests } +{ #category : 'tests' } MicrodownParserTest >> testHandlePrefixTabs [ | source tree columns column codeBlock | source := ' @@ -324,7 +326,7 @@ MicrodownParserTest >> testHandlePrefixTabs [ self assert: codeBlock body lines second equals: (String tab, 'ifHuge: [ "Well, it is not" ]'). ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicrodownParserTest >> testHeaderLevel4 [ | source root | source := (HeaderMarkup repeat: 4), ' Level four'. @@ -334,7 +336,7 @@ MicrodownParserTest >> testHeaderLevel4 [ self assert: root children first level equals: 4 ] -{ #category : #'tests - header' } +{ #category : 'tests - header' } MicrodownParserTest >> testHeaderLevel4WithBold [ | source root | @@ -349,7 +351,7 @@ MicrodownParserTest >> testHeaderLevel4WithBold [ self assert: root children first level equals: 4. ] -{ #category : #'tests - horizontal' } +{ #category : 'tests - horizontal' } MicrodownParserTest >> testHorizontalBlock [ | source root horizontal | @@ -361,7 +363,7 @@ MicrodownParserTest >> testHorizontalBlock [ ] -{ #category : #'tests - horizontal' } +{ #category : 'tests - horizontal' } MicrodownParserTest >> testHorizontalBlockFollowedByList [ | source root horizontal | @@ -374,7 +376,7 @@ MicrodownParserTest >> testHorizontalBlockFollowedByList [ ] -{ #category : #'tests - horizontal line' } +{ #category : 'tests - horizontal line' } MicrodownParserTest >> testHorizontalLineBlock [ | source root horizontal | source := HorizontalLineMarkup, 'label1'. @@ -390,7 +392,7 @@ MicrodownParserTest >> testHorizontalLineBlock [ ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicrodownParserTest >> testMathBlock [ | source root math | @@ -406,7 +408,7 @@ MicrodownParserTest >> testMathBlock [ ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicrodownParserTest >> testMathBlockOnMulitpleLines [ | source root math | @@ -423,7 +425,7 @@ support(I) \geq minsup \}' ] -{ #category : #'tests - math' } +{ #category : 'tests - math' } MicrodownParserTest >> testMathBlockWithArguments [ | source root math | @@ -438,7 +440,7 @@ MicrodownParserTest >> testMathBlockWithArguments [ self assert: (math arguments at: 'caption') first substring equals: 'doNiceMath' ] -{ #category : #'tests - path' } +{ #category : 'tests - path' } MicrodownParserTest >> testParseEmpty [ | file system mic | @@ -452,7 +454,7 @@ MicrodownParserTest >> testParseEmpty [ self assert: (mic isKindOf: MicRootBlock) ] -{ #category : #'tests - horizontal line' } +{ #category : 'tests - horizontal line' } MicrodownParserTest >> testParseLineWithOneCharacter [ | document | @@ -463,7 +465,7 @@ a'. ] -{ #category : #'tests - horizontal line' } +{ #category : 'tests - horizontal line' } MicrodownParserTest >> testParseLineWithThreeCharacters [ | document | @@ -474,7 +476,7 @@ a`a'. ] -{ #category : #'tests - horizontal line' } +{ #category : 'tests - horizontal line' } MicrodownParserTest >> testParseLineWithTwoCharacters [ | document | @@ -485,7 +487,7 @@ aa'. ] -{ #category : #tests } +{ #category : 'tests' } MicrodownParserTest >> testParseText [ | mic | @@ -500,7 +502,7 @@ this is a code block self assert: mic children second body equals: 'this is a code block' ] -{ #category : #'tests - table' } +{ #category : 'tests - table' } MicrodownParserTest >> testPipeEscape [ | tableBlock firstElementOfSecondRowAsString| @@ -514,7 +516,7 @@ MicrodownParserTest >> testPipeEscape [ self assert: firstElementOfSecondRowAsString equals: '12|3' ] -{ #category : #'tests - breaking class comments' } +{ #category : 'tests - breaking class comments' } MicrodownParserTest >> testRBPatternVariableNode [ | paragraph1 paragraph2 paragraph3 | @@ -532,7 +534,7 @@ MicrodownParserTest >> testRBPatternVariableNode [ ' ] -{ #category : #'tests - table' } +{ #category : 'tests - table' } MicrodownParserTest >> testSimpleTable [ | mic | @@ -549,7 +551,7 @@ MicrodownParserTest >> testSimpleTable [ self assert: mic rows first first first class equals: MicTextBlock ] -{ #category : #'tests - error' } +{ #category : 'tests - error' } MicrodownParserTest >> testSimpleTableNoError [ "Microdown allows jagged tables - as implemented in MicTableBlock>>closeMe" self shouldnt: [ parser parse: ' @@ -563,7 +565,7 @@ MicrodownParserTest >> testSimpleTableNoError [ ] -{ #category : #'tests - table' } +{ #category : 'tests - table' } MicrodownParserTest >> testSimpleTableWithFormatting [ | mic | @@ -580,7 +582,7 @@ MicrodownParserTest >> testSimpleTableWithFormatting [ self assert: mic rows first first first class equals: MicBoldFormatBlock ] -{ #category : #'tests - table' } +{ #category : 'tests - table' } MicrodownParserTest >> testSimpleTableWithFormattingWithSomeElements [ | mic | @@ -603,7 +605,7 @@ MicrodownParserTest >> testSimpleTableWithFormattingWithSomeElements [ equals: MicItalicFormatBlock ] -{ #category : #'tests - table' } +{ #category : 'tests - table' } MicrodownParserTest >> testSimpleTableWithMoreLongRow [ | mic | @@ -620,7 +622,7 @@ MicrodownParserTest >> testSimpleTableWithMoreLongRow [ self assert: mic rows first first first class equals: MicTextBlock ] -{ #category : #'tests - table' } +{ #category : 'tests - table' } MicrodownParserTest >> testSimpleTableWithShortRow [ | mic | @@ -637,7 +639,7 @@ MicrodownParserTest >> testSimpleTableWithShortRow [ self assert: mic rows first first first class equals: MicTextBlock ] -{ #category : #'tests - comments' } +{ #category : 'tests - comments' } MicrodownParserTest >> testTwoCommentBlock [ | source root | source := '% test1 diff --git a/src/Microdown-Tests/MicrodownTest.class.st b/src/Microdown-Tests/MicrodownTest.class.st index dc009308..ce45e2b4 100644 --- a/src/Microdown-Tests/MicrodownTest.class.st +++ b/src/Microdown-Tests/MicrodownTest.class.st @@ -2,12 +2,14 @@ A MicrodownTest is a test class for testing the behavior of Microdown " Class { - #name : #MicrodownTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Core' + #name : 'MicrodownTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Core', + #package : 'Microdown-Tests', + #tag : 'Core' } -{ #category : #tests } +{ #category : 'tests' } MicrodownTest >> testMicrodownSpelledCorrect [ self assert: (Object allSubclasses select: [ :c | c name beginsWith: 'MicroDown' ]) isEmpty ] diff --git a/src/Microdown-Tests/MicrodownVisitorTest.class.st b/src/Microdown-Tests/MicrodownVisitorTest.class.st index 675ac82f..2f7dcb69 100644 --- a/src/Microdown-Tests/MicrodownVisitorTest.class.st +++ b/src/Microdown-Tests/MicrodownVisitorTest.class.st @@ -2,12 +2,14 @@ A MicrodownVisitorTest is a test class for testing the behavior of MicrodownVisitor " Class { - #name : #MicrodownVisitorTest, - #superclass : #TestCase, - #category : #'Microdown-Tests-Visitor' + #name : 'MicrodownVisitorTest', + #superclass : 'TestCase', + #category : 'Microdown-Tests-Visitor', + #package : 'Microdown-Tests', + #tag : 'Visitor' } -{ #category : #tests } +{ #category : 'tests' } MicrodownVisitorTest >> testAllVisitMethodsExists [ "Check that all visitSomeBlockType: used in an accept: method are implemented in MicrodownVisitor. See Issue https://github.com/pillar-markup/Microdown/issues/533" diff --git a/src/Microdown-Tests/package.st b/src/Microdown-Tests/package.st index 31693ac4..93e8ae93 100644 --- a/src/Microdown-Tests/package.st +++ b/src/Microdown-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-Tests' } +Package { #name : 'Microdown-Tests' } From 0f52991492d6b276c4a4131603779a522eb58acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Fri, 16 Feb 2024 12:12:06 +0100 Subject: [PATCH 4/5] Fix styler --- src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st b/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st index 90bd7e4c..1360f729 100644 --- a/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st +++ b/src/Microdown-RichTextComposer/MicSmalltalkTextStyler.class.st @@ -29,7 +29,7 @@ MicSmalltalkTextStyler class >> initialize [ "do not super initialize, that whould interfer with settings" styleTable := SHRBTextStyler styleTable. "Not super, as that would just refer to my class-side variables" formatIncompleteIdentifiers := false. - textAttributesByPixelHeight := nil. + ] { #category : 'instance creation' } From 30842a20a2be7909d8519831a9e196b20cce402e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Fri, 16 Feb 2024 12:25:50 +0100 Subject: [PATCH 5/5] Removing isRootSection because it is defined in the DocumentBrowser --- src/Microdown/MicAbstractBlock.class.st | 5 ----- src/Microdown/MicAbstractBlock.extension.st | 6 ------ 2 files changed, 11 deletions(-) delete mode 100644 src/Microdown/MicAbstractBlock.extension.st diff --git a/src/Microdown/MicAbstractBlock.class.st b/src/Microdown/MicAbstractBlock.class.st index 143694fd..51dcc051 100644 --- a/src/Microdown/MicAbstractBlock.class.st +++ b/src/Microdown/MicAbstractBlock.class.st @@ -102,11 +102,6 @@ MicAbstractBlock >> initialize [ children := OrderedCollection new. ] -{ #category : '*Microdown-DocumentBrowser' } -MicAbstractBlock >> isRootSection [ - ^ false -] - { #category : 'testing' } MicAbstractBlock >> listItemBlockClass [ ^ MicListItemBlock diff --git a/src/Microdown/MicAbstractBlock.extension.st b/src/Microdown/MicAbstractBlock.extension.st deleted file mode 100644 index d1da7125..00000000 --- a/src/Microdown/MicAbstractBlock.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'MicAbstractBlock' } - -{ #category : '*Microdown-DocumentBrowser' } -MicAbstractBlock >> isRootSection [ - ^ false -]