Hello Esteban,
Thank you for the Seaside snipet 😊
Now first of all the main difference is formatting right ! There is maybe a different way to do it but evaluating your snipet came out with no formatting at all ?? 😳
So now if I do the following:
esteban:=Seaside.WAHtmlCanvas builder render: [:html |
html div
class: 'text-center';
with: [
html heading
level2;
class: 'h4';
with: [
html text: 'Timline yes'.
html span
class: 'g-color-primary g-ml-5';
with: '#02 yes yes '
]
]
].
maarten := ((Div class: 'text-center g-mb-50')
addChild: ((H2 class: 'h4' text: 'Timline yes')
addChild: (Span class: 'g-color-primary g-ml-5' text: '#02 yes yes ')))
resolve.
———————-
endEsteban := (Article class: 'g-pos-rel g-bg-gray-light-v5 g-pa-30' comment:'Estaban''s way')
addChild: esteban;
addChild: (H3 text: 'French classes' class: 'g-font-weight-300');
resolve.
endMaarten := (Article class: 'g-pos-rel g-bg-gray-light-v5 g-pa-30' comment:'Maarten''s way')
addChild: maarten;
addChild: (H3 text: 'French classes' class: 'g-font-weight-300');
resolve.
I get for you:
<!-- Estaban's way -->
<article class="g-pos-rel g-bg-gray-light-v5 g-pa-30">
<div class=« text-center"><h2 class="h4">Timline yes<span class="g-color-primary g-ml-5">#02 yes yes </span></h2></div
<h3 class="g-font-weight-300">French classes</h3>
</article>
<!-- End Estaban's way -->
End for me:
<!-- Maarten's way -->
<article class="g-pos-rel g-bg-gray-light-v5 g-pa-30">
<div class="text-center g-mb-50">
<h2 class="h4">Timline yes
<span class="g-color-primary g-ml-5">#02 yes yes </span>
</h2>
</div
<h3 class="g-font-weight-300">French classes</h3>
</article>
<!-- End Maarten's way -->
As you can see even if the Seaside rendering comes without formatting the end results remains somewhat readable which makes copying and pasting way more easy to verify.
Now maybe the better question is how you guys work ???
It has over 1750 reusable components and this is why it has some many funny css classes as you noticed.
If you want to rebuild the entire template into seaside code you probably have for over a year of work, and I can’t really believe anyone does that ?
On my pages basically 90% of the code is copied and then modified and adapted, which means that verifying combining formatting and readability really is a major issue.
Doing so and using bootstrap consistency it is actually not so complicated to create some good looking pages in a couple of hours.
However maybe the real time saver would be to actually parse existing html into compiled smalltalk methods 😉 html is a kind of xml ins’t it ? And we do have a very nice XML parser in VW 😇
Regards,
Maarten,
PS1 I’ll see what I do about the name 😅