Skip to content

Commit

Permalink
Merge 17a32d1 into 43f08d5
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianKleissl committed Jul 5, 2020
2 parents 43f08d5 + 17a32d1 commit 9853f69
Show file tree
Hide file tree
Showing 31 changed files with 123 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
type

^ 'LinkDelimiter'
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
"linkFrom:to:" : "hsl 5/17/2020 16:05",
"linkStartingAt:" : "hsl 5/17/2020 16:03",
"matches:" : "hsl 5/17/2020 18:10",
"setPreceding:following:" : "hsl 5/17/2020 13:16" } }
"setPreceding:following:" : "hsl 5/17/2020 13:16",
"type" : "MK 7/5/2020 20:50" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
type

^ 'UrlDelimiter'
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
"isExtendableWith:" : "hsl 5/19/2020 11:17",
"isOpener" : "hsl 5/19/2020 11:16",
"matches:" : "hsl 5/19/2020 11:20",
"setPreceding:following:" : "hsl 5/19/2020 11:25" } }
"setPreceding:following:" : "hsl 5/19/2020 11:25",
"type" : "MK 7/5/2020 20:50" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,5 @@ buildEditorMenuBarWith: aBuilder

^ aBuilder pluggablePanelSpec new
layout: #horizontal;
children: {
aBuilder pluggableButtonSpec new
label: 'New';
model: self;
enabled: true;
action: #createNewInstance;
yourself.
aBuilder pluggableButtonSpec new
label: 'Convert to Html';
model: self;
enabled: true;
action: #convertToHTML;
yourself.
aBuilder pluggableButtonSpec new
label: 'Options';
model: self;
action: #openSettings;
enabled: true;
yourself };
children: (self menubarContent: aBuilder);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
building
menubarContent: aBuilder
^ {
aBuilder pluggableButtonSpec new
label: 'New';
model: self;
enabled: true;
action: #createNewInstance;
yourself.
aBuilder pluggableButtonSpec new
label: 'Convert to Html';
model: self;
enabled: true;
action: #convertToHTML;
yourself.
aBuilder pluggableButtonSpec new
label: 'Options';
model: self;
action: #openSettings;
enabled: true;
yourself }
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"open" : "kgr 4/29/2019 13:18" },
"instance" : {
"blockTextStyler" : "azi 6/4/2020 11:00",
"buildEditorMenuBarWith:" : "cg 7/5/2020 11:57",
"buildEditorMenuBarWith:" : "MK 7/5/2020 20:19",
"buildEditorTextMorphWith:" : "azi 6/1/2020 15:57",
"buildWith:" : "cg 7/5/2020 12:20",
"convertToHTML" : "mas 6/28/2020 13:08",
"createNewInstance" : "MK 6/21/2020 17:51",
"markdownText" : "lpf 6/13/2019 15:26",
"markdownText:" : "cg 7/5/2020 12:20",
"menuBarHeight" : "azi 6/1/2020 16:13",
"menubarContent:" : "MK 7/5/2020 20:18",
"openSettings" : "cg 7/5/2020 12:02",
"refreshText" : "azi 6/1/2020 17:21",
"settingsMenu" : "cg 7/5/2020 12:01",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
type

^ 'EmphasisDelimiter'
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
"matches:" : "MK 7/3/2020 21:06",
"punctuationCharacters" : "MK 7/3/2020 21:06",
"setPreceding:following:" : "jst 6/29/2019 16:11",
"type" : "MK 7/5/2020 20:50",
"whitespaceCharacters" : "MK 7/3/2020 21:07" } }
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ convertBlockquote: aBlockquote
content := aBlockquote croppedContent.
content := self convertInlines: aBlockquote.

^ openingTag, Character cr, content, closingTag, Character cr.
^ openingTag, Character cr, content, closingTag, Character cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ convertCodeBlock: aCodeBlock
closingTag := '</code>'.
content := aCodeBlock codeContent.

^ openingTag, Character cr, content, closingTag, Character cr.
^ openingTag, Character cr, content, closingTag, Character cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ convertHeading: aHeading
content := aHeading content copyFrom: (aHeading level + 2) to: (aHeading content size).
content := self convertInlines: aHeading.

^ openingTag, content, closingTag, Character cr.
^ openingTag, content, closingTag, Character cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ convertParagraph: aParagraph
html := html, (self convertInlines: aParagraph).
html := html, '</p>', Character cr.

^ html.
^ html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
},
"instance" : {
"convert:with:" : "hsl 6/27/2020 15:49",
"convertBlockquote:" : "cg 6/29/2020 23:32",
"convertBlockquote:" : "MK 7/5/2020 20:10",
"convertBold:" : "cg 6/29/2020 23:34",
"convertCodeBlock:" : "cg 6/29/2020 18:49",
"convertCodeBlock:" : "MK 7/5/2020 20:11",
"convertColorToRGBA:" : "hsl 6/27/2020 16:38",
"convertCommentBlock:" : "MK 6/21/2020 17:45",
"convertHeading:" : "cg 6/29/2020 22:18",
"convertHeading:" : "MK 7/5/2020 20:10",
"convertInlines:" : "hsl 7/3/2020 12:17",
"convertItalic:" : "cg 6/29/2020 22:01",
"convertLink:" : "cg 6/29/2020 21:42",
"convertList:withTag:" : "cg 6/29/2020 22:20",
"convertOrderedList:" : "cg 6/29/2020 17:58",
"convertParagraph:" : "cg 6/29/2020 22:21",
"convertParagraph:" : "MK 7/5/2020 20:11",
"convertStyleSettings:" : "hsl 6/27/2020 15:50",
"convertUnorderedList:" : "cg 6/29/2020 17:57" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
accessing
addTo: aText

aText
addAttribute: self textAttribute
from: self startPosition
to: self endPosition.

aText
addAttribute: self colorAttribute
from: self startPosition
to: self endPosition
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
content

^ content
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
},
"instance" : {
"=" : "cg 6/29/2020 20:24",
"addTo:" : "MK 7/5/2020 21:00",
"colorAttribute" : "cg 6/29/2020 19:25",
"colorAttribute:" : "cg 6/29/2020 19:27",
"content" : "cg 6/29/2020 19:25",
"content" : "MK 7/5/2020 20:27",
"content:" : "cg 6/29/2020 19:27",
"convertWith:" : "cg 6/29/2020 21:36",
"endPosition" : "cg 6/29/2020 19:25",
"endPosition:" : "cg 6/29/2020 23:05",
"hash" : "cg 6/29/2020 20:23",
"hash" : "MK 7/5/2020 20:38",
"setFrom:to:" : "cg 6/29/2020 19:26",
"startPosition" : "cg 6/29/2020 19:24",
"textAttribute" : "cg 6/29/2020 19:25",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
styling
add: aCollectionOfMarkdownInlineElements to: aText

aCollectionOfMarkdownInlineElements do: [:element |
aText
addAttribute: element textAttribute
from: element startPosition
to: element endPosition.

aText
addAttribute: element colorAttribute
from: element startPosition
to: element endPosition].
aCollectionOfMarkdownInlineElements do: [:element | element addTo: aText]
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
parsing
process: opener and: closer

| length nextToken |
(opener class = MarkdownOpeningLinkDelimiter and: [closer class = MarkdownClosingLinkDelimiter])
ifTrue: [ self inlineElements add: (self createLinkFrom: opener and: closer).
length := 1.
nextToken := self followingTokenOf: closer.
self processOpeningURLDelimiter: nextToken.
self cutOpener: opener to: length.
^ self cutCloser: closer to: length].
(opener class = MarkdownEmphasisDelimiter and: [closer class = MarkdownEmphasisDelimiter])
ifTrue: [ self inlineElements add: (self createEmphasisFrom: opener and: closer).
self removeDelimitersBetween: opener and: closer.
length := closer delimiterLengthForEmphasisWith: opener.
self cutOpener: opener to: length.
^ self cutCloser: closer to: length]
(opener type = 'LinkDelimiter' and: [closer type = 'LinkDelimiter'])
ifTrue: [ ^ self processLink: opener and: closer].
(opener type = 'EmphasisDelimiter' and: [closer type = 'EmphasisDelimiter'])
ifTrue: [^ self processEmphasis: opener and: closer]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
parsing
processEmphasis: opener and: closer

| length |
self inlineElements add: (self createEmphasisFrom: opener and: closer).
self removeDelimitersBetween: opener and: closer.
length := closer delimiterLengthForEmphasisWith: opener.
self cutOpener: opener to: length.
^ self cutCloser: closer to: length
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parsing
processLink: opener and: closer

| length nextToken |
self inlineElements add: (self createLinkFrom: opener and: closer).
length := 1.
nextToken := self followingTokenOf: closer.
self processOpeningURLDelimiter: nextToken.
self cutOpener: opener to: length.
^ self cutCloser: closer to: length
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"class" : {
},
"instance" : {
"add:to:" : "cg 6/29/2020 21:35",
"add:to:" : "MK 7/5/2020 21:00",
"clean" : "hsl 5/19/2020 22:42",
"content" : "hsl 5/19/2020 15:11",
"content:" : "hsl 5/19/2020 15:11",
"createEmphasisFrom:and:" : "cg 6/29/2020 23:12",
"createLinkFrom:and:" : "cg 6/29/2020 22:52",
"createTokensFrom:" : "hsl 5/19/2020 17:51",
"createTokensFrom:" : "MK 7/5/2020 20:41",
"cutCloser:to:" : "hsl 5/17/2020 18:18",
"cutOpener:to:" : "lpf 5/23/2019 10:28",
"findCloserFor:ifFound:" : "hsl 5/19/2020 17:27",
Expand All @@ -26,8 +26,10 @@
"precedingTokenOf:" : "hsl 5/19/2020 13:26",
"privateFormat:" : "jst 6/28/2019 14:02",
"privateStyle:" : "jko 6/25/2019 22:04",
"process:and:" : "cg 6/29/2020 21:08",
"process:and:" : "MK 7/5/2020 20:53",
"processAdjacentTokens" : "jst 6/29/2019 16:11",
"processEmphasis:and:" : "MK 7/5/2020 20:44",
"processLink:and:" : "MK 7/5/2020 20:44",
"processOpeningURLDelimiter:" : "cg 6/29/2020 23:04",
"removeDelimitersBetween:and:" : "lpf 5/23/2019 10:28",
"reset" : "jst 6/28/2019 14:03",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
type

^ 'LinkDelimiter'
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
"isDelimiter" : "hsl 5/17/2020 13:03",
"isExtendableWith:" : "hsl 5/19/2020 14:36",
"isOpener" : "hsl 5/17/2020 13:26",
"setPreceding:following:" : "hsl 5/17/2020 13:15" } }
"setPreceding:following:" : "hsl 5/17/2020 13:15",
"type" : "MK 7/5/2020 20:50" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
type

^ 'UrlDelimiter'
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
"isDelimiter" : "hsl 5/19/2020 11:33",
"isExtendableWith:" : "hsl 5/19/2020 11:33",
"isOpener" : "hsl 5/19/2020 11:33",
"setPreceding:following:" : "hsl 5/19/2020 11:33" } }
"setPreceding:following:" : "hsl 5/19/2020 11:33",
"type" : "MK 7/5/2020 20:50" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
type

^ 'String'
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
"isDelimiter" : "jko 5/6/2019 14:52",
"isExtendableWith:" : "hsl 5/19/2020 15:45",
"isOpener" : "MK 6/19/2020 18:26",
"setPreceding:following:" : "jst 6/29/2019 16:11" } }
"setPreceding:following:" : "jst 6/29/2019 16:11",
"type" : "MK 7/5/2020 20:56" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
matches: aMarkdownToken

^ self type = aMarkdownToken type
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
type

self subclassResponsibility
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"isExtendableWith:" : "jst 6/28/2019 15:15",
"isOpener" : "hsl 5/19/2020 11:12",
"length" : "jko 5/6/2019 14:36",
"matches:" : "MK 7/5/2020 20:51",
"setPreceding:following:" : "jst 6/29/2019 16:12",
"startPosition" : "fgo 5/21/2019 15:22",
"startPosition:" : "fgo 5/21/2019 15:22" } }
"startPosition:" : "fgo 5/21/2019 15:22",
"type" : "MK 7/5/2020 20:49" } }

0 comments on commit 9853f69

Please sign in to comment.