Implementing components. #defaultView needs to be debugged.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-03-30 13:40:50 -05:00
parent c609595272
commit a8d12ec46f
2 changed files with 28 additions and 4 deletions

View File

@ -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>'

View File

@ -0,0 +1,6 @@
Extension { #name : #String }
{ #category : #'*Brea' }
String >> webView [
^ Pandoc htmlStringToMarkdown: self
]