pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Standalone html builder (a la seaside without seaside?)

TM
Tim Mackinnon
Mon, Sep 28, 2020 5:28 PM

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?

This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.

Tim

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. Tim
SV
Sven Van Caekenberghe
Mon, Sep 28, 2020 6:10 PM

Hi Tim,

On 28 Sep 2020, at 19:28, Tim Mackinnon tim@testit.works wrote:

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?

This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.

Tim

There is a minimal HTML builder to be found in ZnHtmlOutputStream. It is used for a couple of examples and default functionality of ZnServer. There are even unit tests.

It is not the same as the Seaside HTML approach though.

Sven

Hi Tim, > On 28 Sep 2020, at 19:28, Tim Mackinnon <tim@testit.works> wrote: > > Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? > > I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? > > This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. > > Tim There is a minimal HTML builder to be found in ZnHtmlOutputStream. It is used for a couple of examples and default functionality of ZnServer. There are even unit tests. It is not the same as the Seaside HTML approach though. Sven
EG
Eric Gade
Mon, Sep 28, 2020 6:25 PM

On 28 Sep 2020, at 19:28, Tim Mackinnon tim@testit.works wrote:

I often find I want to build some HTML, but don’t want the full seaside

  • and was wondering if anyone has managed to extract it, or have something
    similar?

I had a similar thought a few months back when I was looking for libraries
to build a lightweight static site generator for personal use (I gave up
due to time constraints)

Hi - has anyone ever managed to extract the html builder out of seaside -
or written something equivalent?

You might want to dip into the code for Amber Smalltalk. From what I
recall, that system was able to extract the TagBrush and related classes

--
Eric

> On 28 Sep 2020, at 19:28, Tim Mackinnon <tim@testit.works> wrote: > > > I often find I want to build some HTML, but don’t want the full seaside > - and was wondering if anyone has managed to extract it, or have something > similar? > I had a similar thought a few months back when I was looking for libraries to build a lightweight static site generator for personal use (I gave up due to time constraints) > Hi - has anyone ever managed to extract the html builder out of seaside - > or written something equivalent? > You might want to dip into the code for Amber Smalltalk. From what I recall, that system was able to extract the TagBrush and related classes -- Eric
FJ
Franz Josef Konrad
Mon, Sep 28, 2020 6:35 PM

Am 28.09.2020 um 19:28 schrieb Tim Mackinnon:

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?

This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.

Tim

Some years ago I was looking for something for the same purpose and
looked at this library
http://smalltalkhub.com/PierceNg/WaterMint-HTML/index.html
http://forum.world.st/Standalone-HTML-Model-td4967128.html . I don't
know if this helps. I also just loaded WaterMint and looked at the code.
Other than that I had no experience.

Franz Josef

Am 28.09.2020 um 19:28 schrieb Tim Mackinnon: > Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? > > I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? > > This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. > > Tim > Some years ago I was looking for something for the same purpose and looked at this library <http://smalltalkhub.com/PierceNg/WaterMint-HTML/index.html> <http://forum.world.st/Standalone-HTML-Model-td4967128.html> . I don't know if this helps. I also just loaded WaterMint and looked at the code. Other than that I had no experience. Franz Josef
EM
Esteban Maringolo
Mon, Sep 28, 2020 6:46 PM

I've been playing with something like that, but still using Seaside.

I was calling it "WAStatelessApplication", which is nothing but a way
to route requests to components, and have these components not using
callbacks nor continuations.

I'm really comfortable with the Seaside canvas way of doing HTML, so
I'll eventually end up building it, but currently it is just another
abandoned project.

For a very few specific things, I used a RESTful handler and a
WABuilder to generate the HTML output, using regular components to
render it.

Regards!

Esteban A. Maringolo

On Mon, Sep 28, 2020 at 2:28 PM Tim Mackinnon tim@testit.works wrote:

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?

This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.

Tim

I've been playing with something like that, but still using Seaside. I was calling it "WAStatelessApplication", which is nothing but a way to route requests to components, and have these components not using callbacks nor continuations. I'm really comfortable with the Seaside canvas way of doing HTML, so I'll eventually end up building it, but currently it is just another abandoned project. For a very few specific things, I used a RESTful handler and a WABuilder to generate the HTML output, using regular components to render it. Regards! Esteban A. Maringolo On Mon, Sep 28, 2020 at 2:28 PM Tim Mackinnon <tim@testit.works> wrote: > > Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? > > I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? > > This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. > > Tim
OV
Offray Vladimir Luna Cárdenas
Mon, Sep 28, 2020 7:19 PM

Hi,

I know this is not what you're asking for, but maybe some lateral
thinking could help with your need. Jump to the end for the TL;DR
suggestion or bear with me some paragraphs for a practical example.

In our project about "IndieWeb with Brea", we use Pandoc and some
external tools to produce the web site you see in [1] from Markdown
files in [2] combining them with templates done is Mustache[3], as the
one in [3a]. Everything is orchestrated  by the minimalist Pharo based
Brea CMS[4] and produced using interactive Grafoscopio[5] notebooks and
stored in Fossil[6] SCM, which proves timelines[6a], user management,
permissions and wiki like views of each page (click on the top right
corner Icons of each page to see it). It has been a pretty agile
experience and kind of our "pocket infrastructures" approach to
decoupled/headless CMS, even before we knew about them (and their rising).

[1] https://mutabit.com/repos.fossil/indieweb/
[2] https://mutabit.com/repos.fossil/indieweb/tree?type=tree&name=docs/es
[3] https://github.com/noha/mustache
[3a]
https://mutabit.com/repos.fossil/indieweb/doc/trunk/docs/es/pagina.mus.html
[4] https://mutabit.com/repos.fossil/brea/
[5] https://mutabit.com/grafoscopio/en.html
[6] https://fossil-scm.org/
[6a] https://mutabit.com/repos.fossil/indieweb/timeline
[7] https://github.com/pillar-markup/MicroDown

We use Pandoc because of historical reasons and because we need YAML
metadata headers, multiformat support including PDF export with custom
pre-processors (Pandoc filters). But, at some point I would like to use
Microdown[7] as a pure Pharo native format when Pandoc is not available
or as a replacement/complement for Pandoc filters.

So, my lateral thinking suggestion is why not to avoid HTML altogether?
Mustache and Microdown could take you far regarding light web deployment
and development.

Cheers,

Offray

On 28/09/20 12:28 p. m., Tim Mackinnon wrote:

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?

This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.

Tim

Hi, I know this is not what you're asking for, but maybe some lateral thinking could help with your need. Jump to the end for the TL;DR suggestion or bear with me some paragraphs for a practical example. In our project about "IndieWeb with Brea", we use Pandoc and some external tools to produce the web site you see in [1] from Markdown files in [2] combining them with templates done is Mustache[3], as the one in [3a]. Everything is orchestrated  by the minimalist Pharo based Brea CMS[4] and produced using interactive Grafoscopio[5] notebooks and stored in Fossil[6] SCM, which proves timelines[6a], user management, permissions and wiki like views of each page (click on the top right corner Icons of each page to see it). It has been a pretty agile experience and kind of our "pocket infrastructures" approach to decoupled/headless CMS, even before we knew about them (and their rising). [1] https://mutabit.com/repos.fossil/indieweb/ [2] https://mutabit.com/repos.fossil/indieweb/tree?type=tree&name=docs/es [3] https://github.com/noha/mustache [3a] https://mutabit.com/repos.fossil/indieweb/doc/trunk/docs/es/pagina.mus.html [4] https://mutabit.com/repos.fossil/brea/ [5] https://mutabit.com/grafoscopio/en.html [6] https://fossil-scm.org/ [6a] https://mutabit.com/repos.fossil/indieweb/timeline [7] https://github.com/pillar-markup/MicroDown We use Pandoc because of historical reasons and because we need YAML metadata headers, multiformat support including PDF export with custom pre-processors (Pandoc filters). But, at some point I would like to use Microdown[7] as a pure Pharo native format when Pandoc is not available or as a replacement/complement for Pandoc filters. So, my lateral thinking suggestion is why not to avoid HTML altogether? Mustache and Microdown could take you far regarding light web deployment and development. Cheers, Offray On 28/09/20 12:28 p. m., Tim Mackinnon wrote: > Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? > > I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? > > This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. > > Tim
TM
Tim Mackinnon
Mon, Sep 28, 2020 8:25 PM

Lots of good tips in this thread to explore - thanks everyone, I’ll report back on what I find works best…

To Offray - with a template approach, I have often been tempted with that too but I like the idea of autocompletion and easier refactoring capabilities in Pharo… but you never know.

Tim

On 28 Sep 2020, at 19:35, Franz Josef Konrad franzl@fjkonrad.de wrote:

Am 28.09.2020 um 19:28 schrieb Tim Mackinnon:

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?
I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?
This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.
Tim

Some years ago I was looking for something for the same purpose and looked at this library http://smalltalkhub.com/PierceNg/WaterMint-HTML/index.html http://forum.world.st/Standalone-HTML-Model-td4967128.html . I don't know if this helps. I also just loaded WaterMint and looked at the code. Other than that I had no experience.

Franz Josef

Lots of good tips in this thread to explore - thanks everyone, I’ll report back on what I find works best… To Offray - with a template approach, I have often been tempted with that too but I like the idea of autocompletion and easier refactoring capabilities in Pharo… but you never know. Tim > On 28 Sep 2020, at 19:35, Franz Josef Konrad <franzl@fjkonrad.de> wrote: > > Am 28.09.2020 um 19:28 schrieb Tim Mackinnon: >> Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? >> I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? >> This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. >> Tim > > Some years ago I was looking for something for the same purpose and looked at this library <http://smalltalkhub.com/PierceNg/WaterMint-HTML/index.html> <http://forum.world.st/Standalone-HTML-Model-td4967128.html> . I don't know if this helps. I also just loaded WaterMint and looked at the code. Other than that I had no experience. > > Franz Josef
S
Smalltalk@JGFoster.net
Tue, Sep 29, 2020 6:36 AM

Hi Tim,

To build HTML I use the HtmlElement in https://github.com/jgfoster/WebGS https://github.com/jgfoster/WebGS.

James

On Sep 28, 2020, at 10:28 AM, Tim Mackinnon tim@testit.works wrote:

Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar?

This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc.

Tim

Hi Tim, To build HTML I use the HtmlElement in https://github.com/jgfoster/WebGS <https://github.com/jgfoster/WebGS>. James > On Sep 28, 2020, at 10:28 AM, Tim Mackinnon <tim@testit.works> wrote: > > Hi - has anyone ever managed to extract the html builder out of seaside - or written something equivalent? > > I often find I want to build some HTML, but don’t want the full seaside - and was wondering if anyone has managed to extract it, or have something similar? > > This combined with Renoir from BA-ST would give a good little light weight web potential to run with Zinc. > > Tim
JB
Jan Blizničenko
Tue, Sep 29, 2020 8:37 AM

Hello,

I am using https://github.com/JanBliznicenko/eleven for one of my projects.
It is also a full framework, yet much simplier than Seaside and stateless
and I believe only the HTML building functionality can be used indpendently.

Example:
htmlObject := HtmlBody
with:
(HtmlDiv
class: 'content'
with:
(HtmlAnchor new
href: 'https://pharo.org';
targetBlank;
with: 'Pharo website';
yourself)).
String streamContents: [:stream | htmlObject renderFor: nil on: stream]

The nil I am passing in the last line is there in place of an ELRequest
entity and is not needed for simple HTML tags without custom components. You
might check it out. Be aware that my former colleague created it for our
specific project and I have never used it in any other place, so I just HOPE
it would work like I imagine. It is also not documented or tested at all.

Best regards,
Jan

Tim Mackinnon wrote

Hi - has anyone ever managed to extract the html builder out of seaside -
or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside -
and was wondering if anyone has managed to extract it, or have something
similar?

This combined with Renoir from BA-ST would give a good little light weight
web potential to run with Zinc.

Tim

Hello, I am using https://github.com/JanBliznicenko/eleven for one of my projects. It is also a full framework, yet much simplier than Seaside and stateless and I believe only the HTML building functionality can be used indpendently. Example: htmlObject := HtmlBody with: (HtmlDiv class: 'content' with: (HtmlAnchor new href: 'https://pharo.org'; targetBlank; with: 'Pharo website'; yourself)). String streamContents: [:stream | htmlObject renderFor: nil on: stream] The nil I am passing in the last line is there in place of an ELRequest entity and is not needed for simple HTML tags without custom components. You might check it out. Be aware that my former colleague created it for our specific project and I have never used it in any other place, so I just HOPE it would work like I imagine. It is also not documented or tested at all. Best regards, Jan Tim Mackinnon wrote > Hi - has anyone ever managed to extract the html builder out of seaside - > or written something equivalent? > > I often find I want to build some HTML, but don’t want the full seaside - > and was wondering if anyone has managed to extract it, or have something > similar? > > This combined with Renoir from BA-ST would give a good little light weight > web potential to run with Zinc. > > Tim -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
EM
Esteban Maringolo
Tue, Sep 29, 2020 12:03 PM

Hi Jan,

Nice work, the "Eleven" framework goes in the direction of what I was
experimenting with for Seaside, but instead of trying to introduce that in
Seaside without breaking everything else (as I failed to some extent) you
went directly to replace and redo most of the stuff there (some with
simplifications).

It's nice to see that you have ideas like OneTimeCallback and a FormHandler
in it, because I had something similar going on.
I didn't understand why you have a CSRF list of tokens in the Session.

Thinking of Seaside, I think this would be something nice to introduce in
Seaside 4.0 :-)

Regards!

El mar., 29 de septiembre de 2020 05:38, Jan Blizničenko <
jan.bliznicenko@fit.cvut.cz> escribió:

Hello,

I am using https://github.com/JanBliznicenko/eleven for one of my
projects.
It is also a full framework, yet much simplier than Seaside and stateless
and I believe only the HTML building functionality can be used
indpendently.

Example:
htmlObject := HtmlBody
with:
(HtmlDiv
class: 'content'
with:
(HtmlAnchor new
href: 'https://pharo.org';
targetBlank;
with: 'Pharo website';
yourself)).
String streamContents: [:stream | htmlObject renderFor: nil on: stream]

The nil I am passing in the last line is there in place of an ELRequest
entity and is not needed for simple HTML tags without custom components.
You
might check it out. Be aware that my former colleague created it for our
specific project and I have never used it in any other place, so I just
HOPE
it would work like I imagine. It is also not documented or tested at all.

Best regards,
Jan

Tim Mackinnon wrote

Hi - has anyone ever managed to extract the html builder out of seaside -
or written something equivalent?

I often find I want to build some HTML, but don’t want the full seaside -
and was wondering if anyone has managed to extract it, or have something
similar?

This combined with Renoir from BA-ST would give a good little light

weight

web potential to run with Zinc.

Tim

Hi Jan, Nice work, the "Eleven" framework goes in the direction of what I was experimenting with for Seaside, but instead of trying to introduce that in Seaside without breaking everything else (as I failed to some extent) you went directly to replace and redo most of the stuff there (some with simplifications). It's nice to see that you have ideas like OneTimeCallback and a FormHandler in it, because I had something similar going on. I didn't understand why you have a CSRF list of tokens in the Session. Thinking of Seaside, I think this would be something nice to introduce in Seaside 4.0 :-) Regards! El mar., 29 de septiembre de 2020 05:38, Jan Blizničenko < jan.bliznicenko@fit.cvut.cz> escribió: > Hello, > > I am using https://github.com/JanBliznicenko/eleven for one of my > projects. > It is also a full framework, yet much simplier than Seaside and stateless > and I believe only the HTML building functionality can be used > indpendently. > > Example: > htmlObject := HtmlBody > with: > (HtmlDiv > class: 'content' > with: > (HtmlAnchor new > href: 'https://pharo.org'; > targetBlank; > with: 'Pharo website'; > yourself)). > String streamContents: [:stream | htmlObject renderFor: nil on: stream] > > The nil I am passing in the last line is there in place of an ELRequest > entity and is not needed for simple HTML tags without custom components. > You > might check it out. Be aware that my former colleague created it for our > specific project and I have never used it in any other place, so I just > HOPE > it would work like I imagine. It is also not documented or tested at all. > > Best regards, > Jan > > > Tim Mackinnon wrote > > Hi - has anyone ever managed to extract the html builder out of seaside - > > or written something equivalent? > > > > I often find I want to build some HTML, but don’t want the full seaside - > > and was wondering if anyone has managed to extract it, or have something > > similar? > > > > This combined with Renoir from BA-ST would give a good little light > weight > > web potential to run with Zinc. > > > > Tim > > > > > > -- > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html >