-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into refactor-model
- Loading branch information
Showing
361 changed files
with
1,558 additions
and
767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Styleguide | ||
|
||
In this document the group of 2020 has formulated the idioms and general styling decisions which should be adhered to while coding on the RichTextEditor project. | ||
|
||
### Methods | ||
Style methods like: | ||
```smalltalk | ||
methodName: aParameter | ||
"Here is a comment stating some useful information" | ||
self doSomething. | ||
^ returnValue | ||
``` | ||
#### Naming | ||
Indicate the type of parameter with the parameter name, use *a* and *an* if applicable. Use `camelCase` when naming methods. | ||
|
||
When using multiple parameters, make sure to name the method in a way that indicates which kind of parameter should follow. | ||
|
||
### Cascades | ||
When calling the same object at least three times, use a cascade. | ||
```smalltalk | ||
object | ||
method; | ||
anotherMethod | ||
``` | ||
Make sure to start each method on a newline and indent each by one. | ||
|
||
### Blocks | ||
Don't put spaces in between the blocks content and its paranthesis. | ||
```smalltalk | ||
self do: [:each | each doSomething] | ||
``` | ||
When using loops that have only one iterator, use `each` as variable name. Loops that have multiple iterators should name each variable according to its meaning. | ||
If the block is spanned over multiple lines indent as follows: | ||
```smalltalk | ||
self submorphs do: [:each | | ||
code] | ||
``` | ||
### Categorization | ||
**Always** categorize new methods according to their function. Don't leave methods in the `yet unclassified` category. | ||
|
||
### Commenting | ||
|
||
Comment classes according to the Squeak standard class comments so start with `I am a ...` and write from the perspective of the class. Use `you` when adressing the developer. | ||
If you want to comment a method, first consider rewriting it so that it needs no explanation. Consult others. | ||
|
||
### Reuse | ||
|
||
If you write the same code twice in similar situations, encapsulate it into a method. | ||
|
||
### Misc | ||
|
||
Use a newline after a super statement. | ||
```smalltalk | ||
super initialize. | ||
self doSomethingWonderful | ||
``` | ||
|
||
Write points as follows (using spaces): | ||
```smalltalk | ||
42 @ 42 | ||
``` | ||
|
||
Make sure that the last line of a method does not end with a dot. | ||
Avoid null checks if possible. Use the NullObject pattern instead. | ||
|
||
Avoid hardcoded constants and magic numbers. Instead create new methods on class site containing those with a readable name. | ||
|
||
### Writing tests | ||
Write tests. Do not merge when your code is not tested. | ||
|
||
Tests should be specific. The title should relay what the test does. To achieve this goal only use one assertion or two assertions when checking before and after. | ||
Try to place all non essential code outside of the test. Use utility methods for that, if applicable in parent classes. | ||
Write tests that test unusual input/behaviour to make sure the system is well tested and edge cases are safe. |
6 changes: 6 additions & 0 deletions
6
...aselineOfRichTextEditing.package/BaselineOfRichTextEditing.class/instance/projectClass.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
baseline | ||
projectClass | ||
|
||
^ Smalltalk | ||
at: #MetacelloCypressBaselineProject | ||
ifAbsent: [super projectClass] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/RichTextEditing-Core.package/NullTextStructure.class/instance/add..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
adding | ||
add: aTextAttribute |
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/NullTextStructure.class/instance/includes..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
includes: aTextAttribute | ||
|
||
^ false |
2 changes: 2 additions & 0 deletions
2
packages/RichTextEditing-Core.package/NullTextStructure.class/instance/remove..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
removing | ||
remove: aTextAttribute |
4 changes: 0 additions & 4 deletions
4
packages/RichTextEditing-Core.package/NullTextStructure.class/instance/resetColor.st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...TextEditing-Core.package/NullTextStructure.class/instance/resetColorOfCurrentStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
color | ||
resetColorOfCurrentStructure | ||
|
||
self noCurrentStructureWarning |
4 changes: 0 additions & 4 deletions
4
packages/RichTextEditing-Core.package/NullTextStructure.class/instance/resetFont.st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...hTextEditing-Core.package/NullTextStructure.class/instance/resetFontOfCurrentStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
font | ||
resetFontOfCurrentStructure | ||
|
||
self noCurrentStructureWarning |
2 changes: 2 additions & 0 deletions
2
...ges/RichTextEditing-Core.package/NullTextStructure.class/instance/structureIdentifier..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
accessing | ||
structureIdentifier: aSymbol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/RichTextDefaultTemplate.class/class/identifier.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
identifier | ||
|
||
^ #default |
6 changes: 6 additions & 0 deletions
6
.../RichTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialBoldStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialBoldStructure | ||
|
||
^ TextStructure | ||
new: #bold | ||
from: {TextStructure bold} |
6 changes: 6 additions & 0 deletions
6
...hTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialFootnoteStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialFootnoteStructure | ||
|
||
^ TextStructure | ||
new: #footnote | ||
from: {TextStructure fromFont: (StrikeFont createDejaVuDark: 9)} |
6 changes: 6 additions & 0 deletions
6
...hTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialHeading1Structure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialHeading1Structure | ||
|
||
^ TextStructure | ||
new: #heading1 | ||
from: {TextStructure fromFont: (StrikeFont createDejaVuDark: 20). TextStructure bold} |
6 changes: 6 additions & 0 deletions
6
...hTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialHeading2Structure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialHeading2Structure | ||
|
||
^ TextStructure | ||
new: #heading2 | ||
from: {TextStructure fromFont: (StrikeFont createDejaVuDark: 17). TextStructure bold} |
6 changes: 6 additions & 0 deletions
6
...hTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialHeading3Structure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialHeading3Structure | ||
|
||
^ TextStructure | ||
new: #heading3 | ||
from: {TextStructure fromFont: (StrikeFont createDejaVuDark: 14). TextStructure bold} |
6 changes: 6 additions & 0 deletions
6
...ichTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialItalicStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialItalicStructure | ||
|
||
^ TextStructure | ||
new: #italic | ||
from: {TextStructure italic} |
6 changes: 6 additions & 0 deletions
6
.../RichTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialListStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialListStructure | ||
|
||
^ TextStructure | ||
new: #list | ||
from: {TextStructure indented} |
12 changes: 12 additions & 0 deletions
12
...RichTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialTextStructures.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
initial structures | ||
initialTextStructures | ||
|
||
^ {self initialBoldStructure. | ||
self initialItalicStructure. | ||
self initialUnderlinedStructure. | ||
self initialHeading1Structure. | ||
self initialHeading2Structure. | ||
self initialHeading3Structure. | ||
self initialFootnoteStructure. | ||
self initialListStructure. | ||
self initialURLStructure} asOrderedCollection |
6 changes: 6 additions & 0 deletions
6
...s/RichTextEditing-Core.package/RichTextDefaultTemplate.class/class/initialURLStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialURLStructure | ||
|
||
^ TextStructure | ||
new: #url | ||
from: {TextStructure autohyperlink. TextStructure underlined. TextStructure notExtendable} |
6 changes: 6 additions & 0 deletions
6
...extEditing-Core.package/RichTextDefaultTemplate.class/class/initialUnderlinedStructure.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initial structures | ||
initialUnderlinedStructure | ||
|
||
^ TextStructure | ||
new: #underlined | ||
from: {TextStructure underlined} |
15 changes: 15 additions & 0 deletions
15
packages/RichTextEditing-Core.package/RichTextDefaultTemplate.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"class" : { | ||
"identifier" : "JEH 7/4/2020 11:17", | ||
"initialBoldStructure" : "JEH 7/4/2020 11:15", | ||
"initialFootnoteStructure" : "JEH 7/4/2020 11:15", | ||
"initialHeading1Structure" : "JEH 7/4/2020 11:15", | ||
"initialHeading2Structure" : "JEH 7/4/2020 11:15", | ||
"initialHeading3Structure" : "JEH 7/4/2020 11:15", | ||
"initialItalicStructure" : "JEH 7/4/2020 11:16", | ||
"initialListStructure" : "JEH 7/4/2020 11:16", | ||
"initialTextStructures" : "JEH 7/4/2020 11:16", | ||
"initialURLStructure" : "JEH 7/4/2020 11:16", | ||
"initialUnderlinedStructure" : "JEH 7/4/2020 11:16" }, | ||
"instance" : { | ||
} } |
14 changes: 14 additions & 0 deletions
14
packages/RichTextEditing-Core.package/RichTextDefaultTemplate.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "RichTextEditing-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "RichTextDefaultTemplate", | ||
"pools" : [ | ||
], | ||
"super" : "RichTextStructureTemplate", | ||
"type" : "normal" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/RichTextDocument.class/class/commonStructures.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
constants | ||
commonStructures | ||
|
||
^ {} asSet |
4 changes: 0 additions & 4 deletions
4
packages/RichTextEditing-Core.package/RichTextDocument.class/class/defaultStyles.st
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
packages/RichTextEditing-Core.package/RichTextDocument.class/class/initialBoldStructure.st
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...ges/RichTextEditing-Core.package/RichTextDocument.class/class/initialFootnoteStructure.st
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...ges/RichTextEditing-Core.package/RichTextDocument.class/class/initialHeading1Structure.st
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...ges/RichTextEditing-Core.package/RichTextDocument.class/class/initialHeading2Structure.st
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...ges/RichTextEditing-Core.package/RichTextDocument.class/class/initialHeading3Structure.st
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
packages/RichTextEditing-Core.package/RichTextDocument.class/class/initialItalicStructure.st
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
packages/RichTextEditing-Core.package/RichTextDocument.class/class/initialListStructure.st
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.