Skip to content

Commit

Permalink
Merge pull request #79 from hpi-swa-teaching/style-extensions
Browse files Browse the repository at this point in the history
Style extensions + prettier options
  • Loading branch information
MaximilianKleissl committed Jun 29, 2020
2 parents 46e3c2f + 384e1a8 commit 794a064
Show file tree
Hide file tree
Showing 127 changed files with 380 additions and 183 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
{
"class" : {
"defaultFontColors" : "azi 6/12/2020 13:11",
"defaultFontSizes" : "azi 6/12/2020 00:50",
"labels" : "hsl 6/18/2020 15:26",
"mayBeginWith:" : "hsl 6/18/2020 15:12",
"newFrom:" : "azi 6/1/2020 15:42" },
"instance" : {
"append:" : "jko 7/4/2019 16:17",
"asText" : "jst 6/10/2019 12:12",
"colorAttribute" : "azi 6/12/2020 16:16",
"content" : "jko 7/4/2019 16:09",
"firstLine" : "jst 6/10/2019 11:18",
"font" : "MK 6/19/2020 18:44",
"fontColor" : "azi 6/12/2020 00:40",
"fontSize" : "azi 6/12/2020 00:39",
"initialize" : "azi 6/12/2020 12:57",
"isExtendableWith:" : "jko 7/4/2019 17:02",
"lastLine" : "jst 6/10/2019 11:34",
"lines" : "jko 7/4/2019 18:03",
"lines:" : "jko 7/4/2019 16:12",
"styleSettings" : "azi 6/1/2020 15:42",
"styleSettings:" : "azi 6/1/2020 15:42",
"styler" : "fgo 6/14/2019 14:29",
"styler:" : "jst 6/19/2019 16:05",
"textAttribute" : "azi 6/12/2020 16:17" } }
"styler:" : "jst 6/19/2019 16:05" } }
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"commentStamp" : "jst 7/10/2019 15:46",
"instvars" : [
"lines",
"styleSettings",
"styler" ],
"name" : "MarkdownBlock",
"pools" : [
],
"super" : "Object",
"super" : "MarkdownStyleElement",
"type" : "normal" }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
as yet unclassified
for: aClassLabel with: canChangeFontSize and: canChangeFontColor and: aClassCategory

^ self new
classLabel: aClassLabel;
classCategory: aClassCategory;
initializeWith: canChangeFontSize and: canChangeFontColor;
addLabelMorph;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ initialize
addLabelMorph

self addMorph: (TextMorph new
"fit text to width (see unordered list"
width: 80;
height: 20;
position: 0@20;
contents: self classLabel;
rightFlush;
lock;
yourself).
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
classCategory: anObject
classCategory := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
classCategory
^ classCategory
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
initialize
initialize
initializeWith: canChangeFontSize and: canChangeFontColor

super initialize.
self color: Color transparent;
width: 450;
height: 70.
self fontSizeSlider: (SimpleSliderMorph new
target: self;
actionSelector: #handleSliderChangeTo:;
"arguments: {};"
minVal: MarkdownStyleSettings minFontSize;
maxVal: MarkdownStyleSettings maxFontSize;
position: 80@10;
position: 90@10;
orientation: #horizontal;
height: 40;
width: 100;
yourself).
self sliderLabel: (TextMorph new
position: 185@20;
position: 195@20;
height: 20;
width: 20;
lock;
yourself).
self fontColorPicker: (ColorPickerMorph new
target: self;
selector: #handleColorPickerChangeTo:with:;
"argument: headerLevel;"
position: 220@0;
position: 230@0;
height: 60;
width: 190;
yourself).

self addMorph: self fontSizeSlider.
self addMorph: self sliderLabel.
self addMorph: self fontColorPicker.
canChangeFontSize ifTrue: [
self addMorph: self fontSizeSlider.
self addMorph: self sliderLabel].
canChangeFontColor ifTrue: [self addMorph: self fontColorPicker].
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"class" : {
"for:" : "azi 6/12/2020 02:55" },
"for:with:and:and:" : "azi 6/29/2020 02:13" },
"instance" : {
"addLabelMorph" : "azi 6/12/2020 16:02",
"addLabelMorph" : "azi 6/28/2020 21:25",
"adjustTo:" : "azi 6/12/2020 02:44",
"classCategory" : "azi 6/29/2020 02:12",
"classCategory:" : "azi 6/29/2020 02:12",
"classLabel" : "azi 6/12/2020 01:52",
"classLabel:" : "azi 6/12/2020 01:52",
"fontColorPicker" : "azi 6/12/2020 01:52",
Expand All @@ -12,7 +14,7 @@
"fontSizeSlider:" : "azi 6/12/2020 01:52",
"handleColorPickerChangeTo:with:" : "azi 6/12/2020 15:21",
"handleSliderChangeTo:" : "azi 6/12/2020 16:01",
"initialize" : "azi 6/12/2020 15:13",
"initializeWith:and:" : "azi 6/28/2020 17:09",
"sliderLabel" : "azi 6/12/2020 01:52",
"sliderLabel:" : "azi 6/12/2020 01:52",
"styleSettings" : "azi 6/12/2020 01:52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"commentStamp" : "azi 6/13/2020 03:22",
"instvars" : [
"classLabel",
"classCategory",
"fontSizeSlider",
"sliderLabel",
"fontColorPicker",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
defaultFontSizes

^ {10}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ asText

| text |
text := self content asText.
Transcript show: self content, Character cr.
self styler privateStyle: text.
text addAttribute: self textAttribute.
text addAttribute: self colorAttribute.
self addAttributesTo: text.
^ text
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"class" : {
"defaultFontColors" : "MK 6/21/2020 20:48",
"defaultFontSize" : "MK 6/21/2020 20:48",
"defaultFontSizes" : "azi 6/28/2020 15:42",
"labels" : "MK 6/21/2020 20:47",
"mayBeginWith:" : "MK 6/21/2020 21:04" },
"instance" : {
"asText" : "MK 6/21/2020 20:51",
"asText" : "azi 6/28/2020 15:58",
"isExtendableWith:" : "MK 6/21/2020 21:01" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
canChangeFontColor

^ false
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ asText
result := self firstLine asText, code.
self isClosed
ifTrue: [result := result, self lastLine asText].
self addAttributesTo: result.
^ result
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"class" : {
"canChangeFontColor" : "azi 6/28/2020 15:54",
"labels" : "azi 6/12/2020 00:22",
"mayBeginWith:" : "jko 7/4/2019 16:39",
"shoutParserClass" : "mas 5/17/2020 21:47" },
"instance" : {
"asText" : "jst 6/25/2019 12:19",
"asText" : "azi 6/28/2020 16:51",
"codeContent" : "jst 6/10/2019 11:23",
"convertWith:" : "MK 6/21/2020 17:49",
"initialize" : "fgo 7/1/2019 16:40",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ asText

| text |
text := self content asText.
text
addAttribute: self textAttribute from: self commentStart to: self commentEnd;
addAttribute: self colorAttribute from: self commentStart to: self commentEnd.
self addAttributesTo: text from: self commentStart to: self commentEnd.
^ text
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mayBeginWith:" : "jko 7/4/2019 16:46",
"openingTag" : "jko 6/27/2019 21:40" },
"instance" : {
"asText" : "MK 6/19/2020 18:44",
"asText" : "azi 6/28/2020 16:27",
"closingTag" : "jko 6/29/2019 00:16",
"commentEnd" : "jko 7/1/2019 10:45",
"commentStart" : "jko 7/4/2019 17:30",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildEditorMenuBarWith: aBuilder
label: 'New';
model: self;
enabled: true;
action: #createNewInstancel;
action: #createNewInstance;
yourself.
aBuilder pluggableButtonSpec new
label: 'Convert to Html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ as yet unclassified
openOptions

self textMorph accept.
self optionsMenu openInWorld.
^ self optionsMenu open
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"open" : "kgr 4/29/2019 13:18" },
"instance" : {
"blockTextStyler" : "azi 6/4/2020 11:00",
"buildEditorMenuBarWith:" : "MK 6/21/2020 18:01",
"buildEditorMenuBarWith:" : "azi 6/28/2020 20:00",
"buildEditorTextMorphWith:" : "azi 6/1/2020 15:57",
"buildWith:" : "azi 6/12/2020 01:28",
"convertToHTML" : "mas 6/28/2020 13:08",
"createNewInstance" : "MK 6/21/2020 17:51",
"markdownText" : "lpf 6/13/2019 15:26",
"markdownText:" : "azi 6/1/2020 17:33",
"menuBarHeight" : "azi 6/1/2020 16:13",
"openOptions" : "azi 6/12/2020 01:28",
"openOptions" : "azi 6/29/2020 16:44",
"optionsMenu" : "azi 6/12/2020 01:25",
"optionsMenu:" : "azi 6/12/2020 01:25",
"refreshText" : "azi 6/1/2020 17:21",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
blockCategory

^ 'Headings'
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ asText
| text |
text := self content asText.
self styler privateStyle: text.
text addAttribute: self textAttribute.
text addAttribute: self colorAttribute.
self addAttributesTo: text.
^ text
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
as yet unclassified
export
convertWith: aConverter

^ aConverter convertHeading: self
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
accessing
fontSize

"Transcript show: (self styleSettings fontSizes at: (self class labels at: self level)); cr."
^ self styleSettings fontSizes at: (self class labels at: self level)
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"class" : {
"blockCategory" : "azi 6/29/2020 02:29",
"defaultFontColors" : "azi 6/13/2020 03:51",
"defaultFontSizes" : "azi 6/12/2020 00:55",
"labels" : "azi 6/12/2020 14:18",
"mayBeginWith:" : "jko 7/4/2019 16:36" },
"instance" : {
"asText" : "azi 6/12/2020 14:12",
"asText" : "azi 6/28/2020 15:58",
"convertWith:" : "MK 6/21/2020 17:51",
"fontColor" : "azi 6/12/2020 13:38",
"fontSize" : "azi 6/12/2020 13:13",
"fontSize" : "azi 6/28/2020 14:35",
"isExtendableWith:" : "jko 7/4/2019 17:03",
"level" : "jst 5/13/2019 15:24",
"prefix" : "jst 5/13/2019 15:29" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
blockCategory

^ 'Lists'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
defaultFontColors

^ MarkdownListItem defaultFontColors
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
defaultFontSizes

^ MarkdownListItem defaultFontSizes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
testing
mayBeginWith: aMarkdownLine

^ false
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"class" : {
"labels" : "hsl 6/18/2020 15:37",
"mayBeginWith:" : "hsl 6/18/2020 15:20" },
"blockCategory" : "azi 6/29/2020 02:29",
"defaultFontColors" : "azi 6/28/2020 14:53",
"defaultFontSizes" : "azi 6/28/2020 14:53",
"mayBeginWith:" : "azi 6/28/2020 15:46" },
"instance" : {
"asText" : "hsl 6/18/2020 13:16",
"initialize" : "hsl 6/18/2020 13:17",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
blockCategory

^ MarkdownList blockCategory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
defaultFontColors

^ {Color black. Color black. Color black}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
defaultFontSizes

^ {14. 12. 10}
Loading

0 comments on commit 794a064

Please sign in to comment.