没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
oss.trustie.net/open_source_projects | 主页 > 开源项目社区 > lymon |
lymon
|
0 | 0 | 63 |
贡献者 | 讨论 | 代码提交 |
Lymon Project A Humans friendly Web Development Toolkit
To get involve on this project you are invited to collaborate in our Google Groups mailing list at:
http://groups.google.com/group/lymon
Revision Count: 65Lymon Test Coverage -r65
Lymon Templates EngineThe first low level component for Lymon is finished, actually this is a Fully capable and dynamic Templates Engine.
With this tool you can create a Dynamic version of any template you like, you just need to learn a simple Python syntax and you are ready to power your site with this useful engine.
The idea behind it is to provide Dynamic Templates, this mean that you can have a Main template and add different parts to it in different parts of the site on the fly.
This is accomplished using Documents Inheritance: You first define your Main template then you create a new document and add the new parts to it, then you can inherit the Main template structure to the new one, and all html tags will be inherited and mixed.
The goal of all this is to be able to have a Data Base driven template engine, where you can modify and create new templates online for your app, or add components to it.
The data base and components is in development for now, and i will be working hard to get this going.
Screen shot
In a NutshellLymon's Documents Syntax in a Nutshellfrom lymon.core import Document
- This example shows how to create an HTML document
- Fisrt we add some Tags ( you can create any tag you like )
html = Document()
html.div(slot = 'site.header', html='Welcome !',attrs = {'class':'header'})
html.h6(slot = 'site.content.title', id = False, html='Write Your Name !',attrs = {'class':'title'})
html.input(slot = 'site.content.your_name', id = False, attrs = {'type':'text', 'name':'your_name'})
print html(render=True)
Welcome !
Write Your Name !
- Inheritance mechanism on a new Document
- First we difine the new tags
- Then we call the inerit method with the parent Document as a parameter
new_html = Document()
new_html.span(slot = 'site.header.new', html = "I've been added to the firt Document !")
new_html.h1(slot = 'site.content.who', html = "Who are you dude ?", attrs={'class': 'no_class'})
new_html.inherit(html)
print new_html(render=True)
I've been added to the firt Document !
Welcome !
Write Your Name !
Who are you dude ?
By Laureano Arcanio