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', 'name',
'folder', 'folder',
'server', 'server',
'body' 'componets'
], ],
#category : #Brea #category : #Brea
} }
@ -23,8 +23,26 @@ BreaApp >> appName [
] ]
{ #category : #accessing } { #category : #accessing }
BreaApp >> body [ BreaApp >> at: key put: anObject [
^ body ifNil: [ body := '' writeStream ] 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 } { #category : #accessing }
@ -40,7 +58,7 @@ BreaApp >> defaultView [
</head> </head>
<body> <body>
<main class="container"> <main class="container">
', self body contents, ' ', self componentsWebView,'
</main> </main>
</body> </body>
</html>' </html>'

View File

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