Skip to content

Commit

Permalink
Merge pull request #140 from SWTI2014/parsing/different-tags
Browse files Browse the repository at this point in the history
Parsing/different tags
  • Loading branch information
PFischbeck committed Jun 30, 2014
2 parents 871f3b7 + 6e916ed commit ed0ae86
Show file tree
Hide file tree
Showing 37 changed files with 184 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fontMap
'cursive' -> 'URWChanceryL'.
'URW Chancery L' -> 'URWChanceryL'.
'monospace' -> 'NimbusMonoL'.
'Courier New' -> 'NimubsMonoL'.
'Courier New' -> 'NimbusMonoL'.
'Nimbus Mono L' -> 'NimbusMonoL'.
'Trebuchet MS' -> 'TrebuchetMS'.
'Andale Mono' -> 'AndaleMono'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"instance" : {
"attributeMap" : "SN 6/11/2014 22:54",
"factorForNamedSize:" : "SN 6/21/2014 12:13",
"fontMap" : "SN 6/12/2014 14:31",
"fontMap" : "SS 6/28/2014 19:59",
"isValidStyleValue:" : "rs 5/21/2014 15:44:29.914",
"isValidWeightValue:" : "rs 5/21/2014 15:43:47.846",
"parseTextAttributesFrom:into:" : "SN 6/12/2014 22:14",
Expand Down
3 changes: 3 additions & 0 deletions packages/HTML.package/HtmlANode.class/instance/target.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
target
^ self attributes at: 'target' ifAbsent: [nil]
3 changes: 2 additions & 1 deletion packages/HTML.package/HtmlANode.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
"endStyles:" : "rs 6/7/2014 18:33:42.305",
"href" : "rs 6/7/2014 19:16:14.784",
"startStyles:" : "rs 6/7/2014 18:33:14.832",
"tag" : "" } }
"tag" : "",
"target" : "SS 6/28/2014 18:02" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-family' -> 'Courier New'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/28/2014 20:47",
"tag" : "" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-style' -> 'italic'.
'font-family' -> 'Times'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/28/2014 18:42",
"tag" : "" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-style' -> 'italic'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/28/2014 18:35",
"tag" : "" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-family' -> 'TrebuchetMS'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/29/2014 18:13",
"tag" : "" } }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
htmlFormatter: anObject

htmlFormatter := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
htmlFormatter

^ htmlFormatter
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
setUp
self timeout: 300.
self htmlFormatter: DHtmlFormatter new.
self styleResolver: CSSStyleResolver new
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
styleResolver: anObject

styleResolver := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
styleResolver

^ styleResolver
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
test01EmphasizedTextShouldBeItalic
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<em>emphasized text</em>').
node := document children first.
self assert: (self styleResolver getStyle: #italic for: node) equals: true.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
test02StrongTextShouldBeBold
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<strong>strong text</strong>').
node := document children first.
self assert: (self styleResolver getStyle: #bold for: node) equals: true.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
accessing
test03DefinitionShouldBeItalicAndTimes
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<dfn>definition</dfn>').
node := document children first.
self assert: (self styleResolver getStyle: #italic for: node) equals: true.
self assert: (self styleResolver getStyle: #family for: node)
equals: (TextStyle named: 'NimbusRomanNo9L').
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
test04CodeShouldBeCourierNew
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<code>computer code</code>').
node := document children first.
self assert: (self styleResolver getStyle: #family for: node)
equals: (TextStyle named: 'NimbusMonoL').
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
test05OutputShouldBeGeorgia
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<samp>sample output</samp>').
node := document children first.
self assert: (self styleResolver getStyle: #family for: node)
equals: (TextStyle named: 'Georgia').
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
test06InputShouldBeTrebuchetMS
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<kbd>sample input</kbd>').
node := document children first.
self assert: (self styleResolver getStyle: #family for: node)
equals: (TextStyle named: 'TrebuchetMS').
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
test07TeletypeShouldBeTrebuchetMS
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<tt>teletype text</tt>').
node := document children first.
self assert: (self styleResolver getStyle: #family for: node)
equals: (TextStyle named: 'TrebuchetMS').
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
test08VariableShouldBeCourierNew
| document node |
document := HtmlDocument new.
document parseContents: (ReadStream on: '<var>sample variable</var>').
node := document children first.
self assert: (self styleResolver getStyle: #family for: node)
equals: (TextStyle named: 'NimbusMonoL').
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"class" : {
},
"instance" : {
"htmlFormatter" : "SS 6/28/2014 19:37",
"htmlFormatter:" : "SS 6/28/2014 19:37",
"setUp" : "SS 6/28/2014 19:38",
"styleResolver" : "SS 6/28/2014 19:38",
"styleResolver:" : "SS 6/28/2014 19:38",
"test01EmphasizedTextShouldBeItalic" : "SS 6/28/2014 19:41",
"test02StrongTextShouldBeBold" : "SS 6/28/2014 19:42",
"test03DefinitionShouldBeItalicAndTimes" : "SS 6/28/2014 19:53",
"test04CodeShouldBeCourierNew" : "SS 6/28/2014 20:50",
"test05OutputShouldBeGeorgia" : "SS 6/28/2014 20:49",
"test06InputShouldBeTrebuchetMS" : "SS 6/29/2014 18:14",
"test07TeletypeShouldBeTrebuchetMS" : "SS 6/29/2014 18:15",
"test08VariableShouldBeCourierNew" : "SS 6/29/2014 18:15" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category" : "HTML-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"htmlFormatter",
"styleResolver" ],
"name" : "HtmlNodeDefaultStyleTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-family' -> 'Georgia'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/28/2014 20:49",
"tag" : "" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-family' -> 'TrebuchetMS'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/29/2014 18:13",
"tag" : "" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
addDefaultStyle
| styles |
styles := Dictionary newFrom: {
'font-style' -> 'italic'.
'font-family' -> 'Courier New'.
}.
self addStyle: (CSSStyleRule fromDictionary: styles)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"addDefaultStyle" : "SS 6/28/2014 20:47",
"tag" : "" } }
2 changes: 1 addition & 1 deletion packages/HTML.package/monticello.meta/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a9c1b4cd-3f84-8344-a94e-e1f22e4351f8
fea643b6-5bbb-4b70-9584-e8f6b9377725
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(name 'HTML-SS.111'message 'change TT, VAR, CODE so that it looks more like it should.'id '496850ef-58a0-4f71-b120-ab36520a38c2'date '28 June 2014'time '8:51:30.179 pm'author 'SS'ancestors ((id 'a9c1b4cd-3f84-8344-a94e-e1f22e4351f8'))stepChildren ())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(name 'HTML-SS.112'message 'Use only Scamper fonts as default'id 'fea643b6-5bbb-4b70-9584-e8f6b9377725'date '29 June 2014'time '6:16:15.985 pm'author 'SS'ancestors ((id '496850ef-58a0-4f71-b120-ab36520a38c2'))stepChildren ())
Expand Down

0 comments on commit ed0ae86

Please sign in to comment.