Skip to content

Commit

Permalink
Merge pull request #662 from MarcusDenker/Fix-deprecated-isForWorkspace
Browse files Browse the repository at this point in the history
Fix deprecated is for #isWorkspace
  • Loading branch information
jecisc authored Oct 10, 2023
2 parents dd28ddc + af22a29 commit 07fe3d4
Show file tree
Hide file tree
Showing 28 changed files with 316 additions and 272 deletions.
4 changes: 2 additions & 2 deletions src/Microdown-RichTextComposer/Form.extension.st
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
12 changes: 7 additions & 5 deletions src/Microdown-RichTextComposer/MicCenterAlignmentBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
37 changes: 19 additions & 18 deletions src/Microdown-RichTextComposer/MicDocumentHierarchyBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ SpDocumentHierarchyBuilder new
```
"
Class {
#name : #MicDocumentHierarchyBuilder,
#superclass : #Object,
#name : 'MicDocumentHierarchyBuilder',
#superclass : 'Object',
#instVars : [
'topClass',
'flattenTree',
Expand All @@ -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 |
Expand Down Expand Up @@ -61,7 +62,7 @@ MicDocumentHierarchyBuilder >> addLevel: level from: aClass [
from: each ]
]

{ #category : #private }
{ #category : 'private' }
MicDocumentHierarchyBuilder >> addLevel: level from: aClass to: stream [
"'├ ─ ╰ │'"
| path |
Expand Down Expand Up @@ -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.
Expand All @@ -106,7 +107,7 @@ MicDocumentHierarchyBuilder >> buildFor: aClass [
from: self fromClass
]

{ #category : #building }
{ #category : 'building' }
MicDocumentHierarchyBuilder >> buildStringFor: aClass [

self fillTreeOf: aClass.
Expand All @@ -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.
Expand All @@ -134,15 +135,15 @@ MicDocumentHierarchyBuilder >> fillTreeOf: aClass [
^ flattenTree
]

{ #category : #private }
{ #category : 'private' }
MicDocumentHierarchyBuilder >> fillTreeWithSubclassesOf: aClass [

flattenTree at: aClass put: (self applyFilterTo: aClass subclasses).
aClass subclasses do: [ :each |
self fillTreeWithSubclassesOf: each ]
]

{ #category : #private }
{ #category : 'private' }
MicDocumentHierarchyBuilder >> fillTreeWithSuperclassesOf: aClass [
| superclasses |

Expand All @@ -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 |

Expand All @@ -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
Expand Down
50 changes: 26 additions & 24 deletions src/Microdown-RichTextComposer/MicDynamicTextStyler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ and very small body
- back to first
"
Class {
#name : #MicDynamicTextStyler,
#superclass : #MicTextStyler,
#name : 'MicDynamicTextStyler',
#superclass : 'MicTextStyler',
#instVars : [
'bullets',
'counters',
Expand All @@ -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: $;).
Expand All @@ -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, "
Expand All @@ -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)"
Expand All @@ -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)
Expand All @@ -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.
Expand All @@ -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'"
Expand All @@ -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 ].
Expand Down
Loading

0 comments on commit 07fe3d4

Please sign in to comment.