HTML5 Generation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML5 Generation

statonjr
I’m writing an implementation of Webmachine[1] in Pharo and I’m at the point where I need to generate some resources. Webmachine does not care how you represent your resources, so I’m looking for a way to represent my resources in text/html (or application/xml+xhtml). In Ruby, I use ROAR[2] with Webmachine to represent my resources[3]. I really like how Seaside lets you programmatically construct HTML, but I’m not sure if I can just pull in the HTML generation and leave out the rest. Is this possible or do I have to recreate ROAR in Smalltalk (which isn’t a bad idea!)?

Thanks!

/ls

[1] http://smalltalkhub.com/#!/~statonjr/DLWebmachine
[2] https://github.com/apotonick/roar
[3] https://speakerdeck.com/statonjr/hypermedia-apis-with-webmachine-and-roar


Larry Staton Jr.

https://keybase.io/statonjr




signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 Generation

Damien Cassou

On Mon, Jun 2, 2014 at 1:42 PM, Larry Staton Jr. <[hidden email]> wrote:
> I’m not sure if I can just pull in the HTML generation and leave out the rest.


I tried for a minute or two and this is not that simple. What I did is reimplementing something much less powerful (but that was ok for my use case):

canvas tag
    name: 'a';
    parameterAt: 'href' put: href;
    with: [
           isAnchor ifTrue: [ ... ].
           super visitInternalLink: anInternalLink ]


If this is enough for you, we can extract this from my code (http://www.smalltalkhub.com/#!/~Pier/Pillar)

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing enthusiasm."
Winston Churchill
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 Generation

Esteban A. Maringolo
In reply to this post by statonjr
You can get an HTML canvas to render on it.

WAHtmlCanvas builder render: [:html |
  html heading
    level: 1;
    with: 'Hello world!'
]

This will output a string the html document.

Regards!




Esteban A. Maringolo


2014-06-02 8:42 GMT-03:00 Larry Staton Jr. <[hidden email]>:

> I’m writing an implementation of Webmachine[1] in Pharo and I’m at the point where I need to generate some resources. Webmachine does not care how you represent your resources, so I’m looking for a way to represent my resources in text/html (or application/xml+xhtml). In Ruby, I use ROAR[2] with Webmachine to represent my resources[3]. I really like how Seaside lets you programmatically construct HTML, but I’m not sure if I can just pull in the HTML generation and leave out the rest. Is this possible or do I have to recreate ROAR in Smalltalk (which isn’t a bad idea!)?
>
> Thanks!
>
> /ls
>
> [1] http://smalltalkhub.com/#!/~statonjr/DLWebmachine
> [2] https://github.com/apotonick/roar
> [3] https://speakerdeck.com/statonjr/hypermedia-apis-with-webmachine-and-roar
>
>
> Larry Staton Jr.
>
> https://keybase.io/statonjr
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: HTML5 Generation

stepharo
Now it would be really nice to have the seaside canvas as a separate
component. So may be trying for a couple of day
should work. I do not see why you would not succeed.

Stef


On 2/6/14 14:43, Esteban A. Maringolo wrote:

> You can get an HTML canvas to render on it.
>
> WAHtmlCanvas builder render: [:html |
>    html heading
>      level: 1;
>      with: 'Hello world!'
> ]
>
> This will output a string the html document.
>
> Regards!
>
>
>
>
> Esteban A. Maringolo
>
>
> 2014-06-02 8:42 GMT-03:00 Larry Staton Jr. <[hidden email]>:
>> I’m writing an implementation of Webmachine[1] in Pharo and I’m at the point where I need to generate some resources. Webmachine does not care how you represent your resources, so I’m looking for a way to represent my resources in text/html (or application/xml+xhtml). In Ruby, I use ROAR[2] with Webmachine to represent my resources[3]. I really like how Seaside lets you programmatically construct HTML, but I’m not sure if I can just pull in the HTML generation and leave out the rest. Is this possible or do I have to recreate ROAR in Smalltalk (which isn’t a bad idea!)?
>>
>> Thanks!
>>
>> /ls
>>
>> [1] http://smalltalkhub.com/#!/~statonjr/DLWebmachine
>> [2] https://github.com/apotonick/roar
>> [3] https://speakerdeck.com/statonjr/hypermedia-apis-with-webmachine-and-roar
>>
>>
>> Larry Staton Jr.
>>
>> https://keybase.io/statonjr
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: HTML5 Generation

Sean P. DeNigris
Administrator
stepharo wrote
Now it would be really nice to have the seaside canvas as a separate
component
After working a bunch with Amber, I really wanted to extract HTML tags in general, since it's a well-known domain independent of any particular framework, and then each framework could add its own rendering behavior. As it is, each framework uses its own proprietary base class for tags, so things like the cool Seaside Bootstrap wrapper have to be re-implemented for each framework. This could be so much simpler and magnify our efforts!!
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 Generation

LogiqueWerks
Because I use MIT Curl as markup instead of HTML, this has also been an interest of mine.

( Curl declarative and PL as in www.curl.com  and not cURL )


On 4 June 2014 08:59, Sean P. DeNigris <[hidden email]> wrote:
stepharo wrote
> Now it would be really nice to have the seaside canvas as a separate
> component

After working a bunch with Amber, I really wanted to extract HTML tags in
general, since it's a well-known domain independent of any particular
framework, and then each framework could add its own rendering behavior. As
it is, each framework uses its own proprietary base class for tags, so
things like the cool Seaside Bootstrap wrapper have to be re-implemented for
each framework. This could be so much simpler and magnify our efforts!!



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/HTML5-Generation-tp4761273p4761605.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.