Implementing components. #defaultView needs to be debugged.
This commit is contained in:
parent
c609595272
commit
a8d12ec46f
@ -5,7 +5,7 @@ Class {
|
||||
'name',
|
||||
'folder',
|
||||
'server',
|
||||
'body'
|
||||
'componets'
|
||||
],
|
||||
#category : #Brea
|
||||
}
|
||||
@ -23,8 +23,26 @@ BreaApp >> appName [
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaApp >> body [
|
||||
^ body ifNil: [ body := '' writeStream ]
|
||||
BreaApp >> at: key put: anObject [
|
||||
self components at: key put: anObject.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaApp >> components [
|
||||
^ componets ifNil: [ componets := OrderedDictionary new]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaApp >> componentsWebView [
|
||||
| response |
|
||||
response := '' writeStream.
|
||||
self components ifEmpty: [ ^ response contents ].
|
||||
self components valuesDo: [ :component |
|
||||
response
|
||||
nextPutAll: component webView; cr
|
||||
].
|
||||
^ response contents
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -40,7 +58,7 @@ BreaApp >> defaultView [
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
', self body contents, '
|
||||
', self componentsWebView,'
|
||||
</main>
|
||||
</body>
|
||||
</html>'
|
||||
|
6
repository/Brea/String.extension.st
Normal file
6
repository/Brea/String.extension.st
Normal file
@ -0,0 +1,6 @@
|
||||
Extension { #name : #String }
|
||||
|
||||
{ #category : #'*Brea' }
|
||||
String >> webView [
|
||||
^ Pandoc htmlStringToMarkdown: self
|
||||
]
|
Loading…
Reference in New Issue
Block a user