Re: [ceylon-dev] ceylon-html and ceylon-style

82 views
Skip to first unread message

Tako Schotanus

unread,
May 18, 2013, 8:06:23 AM5/18/13
to ceylon-dev
Hi Daniel,

with respect to

Apparently I've problems with my dist, but no clue so far of which problem

could you give a bit more information? What is it that is not working, what problems/errors are you seeing?

Cheers,
-Tako



-Tako


On Sat, May 18, 2013 at 9:15 AM, Daniel Rochetti <daniel....@gmail.com> wrote:
Hey guys!

Some of you might remember the ceylon-syle, a CSS Ceylon module I've posted here some weeks ago (https://github.com/drochetti/ceylon-style). After that I had a conversation with Gavin and he asked me if I want to give a hand begining the Html Ceylon module, a critical module to proof some Ceylon capabilities, features and expressiveness. Well, I love new challenges and the most important thing is this is a great opportunity to contribute to something with a true meaning and great people that inspired my career so far working on it.

So, I've initiated the ceylon-html module and I already got some code working. That piece of Html on the Ceylon website home page is working and a lot of more complex stuff too. =)
I've also implemented a few improvements on ceylon-style, mainly a static typed DSL for the selectors.

I'll try to briefly show some of the work I've done on ceylon-html so far and where do I need some help.


ceylon-html

A module to provide Html templating in plain good Ceylon. The idea is that mixing the powerful Ceylon type system with the expressive tree-like syntax is possible to build a powerful and simple Html template engine using only simple language features, such as comprehensions and expressions. So, to make that happen what I did so far:

- A Node type hierarchy
To represent Html node I've created some interfaces in order to represent different html nodes, so far I have:
TextNode -> nodes that have text content in their body (https://github.com/drochetti/ceylon-html/blob/master/source/ceylon/html/TextNode.ceylon)
This way we can specify all different kinds of Html elements, such as:

shared class Div(...) satisfies TextNode & ParentNode { ... }

Because we all know that divs can hold both text and children. =)

- Snippet (aka NodeFactory)
In order to have reusable Html blocks, parts and utilities I've created a simple Node factory interface, called Snippet, because that what we want, Html snippets that we can reuse. Since we're talking about full Ceylon, we don't need custom tags or magical injected template helpers and dozen of implicit variables. All we need is to produce some nice and easy reusable piece of Html content, some snippets. https://github.com/drochetti/ceylon-html/blob/master/source/ceylon/html/Snippet.ceylon 

- An important design decision I've made (I need feedback) was to introduce HtmlNode, which is an alias for Node|{Node*}|[Node*]|Snippet. This way I can write Html trees using then/else expressions and comprehensions. But is this flexible and maintanable enough? I'm asking that cause I've already faced a limitation.


- Layout engine. Since we're talking about full Ceylon (again), a layout engine seems pretty straightforward. So I've tried a basic impl of a ready "boilerplate" layout inside the module, useful already and also a guideline to create custom layouts:

Main problem right now is:

- Gavin asked me to integrate both ceylon-html and ceylon-style into ceyon-sdk and make a pull request. However I'm trying to integrate with the recent M6 stuff and both the modules stop working (it's working great on M5). Apparently I've problems with my dist, but no clue so far of which problem, so the pull request is delayed, help is appreciated.

I've some doubts and need feedback on the work so far. I've been discussing some simple early module decisions with Gavin and now we've reached a point where the community can help improve the whole stuff.

The other specific matters and discussions about ceylon-html and ceylon-style I suggest we create specific topics for each matter, this way we can begin to organize GitHub issues and distribute work for those interest in contribute with code.

Waiting for your feedbacks and for someone to make the whole thing run on recent M6 stuff so we can organize the SDK integration as the first step as asked by Gavin.

Cheers!

Daniel Rochetti

--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-dev+...@googlegroups.com.
To post to this group, send email to ceylo...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Daniel Rochetti

unread,
May 19, 2013, 1:03:50 AM5/19/13
to ceylo...@googlegroups.com, ta...@codejive.org
Hey Tako,

So sorry about the lack of information on the first post, I'm in the middle of a huge and sudden country moving.

At the time of the post I was really clueless, because the IDE was hanging and crashing a lot.
Then today I was able to track down to a incompatibility between the IDE build and the ceylon.language build. I've decided to rebuild everything from zero again, the last IDE commit and so on then I got it working. Sorry about that. =) 

I'll organize the modules and sdk merge, the pull request, catch a flight and then I'll get in touch with details about the modules todos, issues, etc in a few days. Meanwhile, I hope to get some feedback of the initial work.

Cheers!
Reply all
Reply to author
Forward
0 new messages