-
Notifications
You must be signed in to change notification settings - Fork 23
Description
I personally don't like (In fact I hate) the XML based syntax of HTML.
QML (https://www.youtube.com/watch?v=_6_F6Kpjd-Q, http://qt-project.org/doc/qt-5/qtqml-index.html) for example, a long time ago used to have a XML based syntax as well, however, nowadays QML looks more like jSON and honestly speaking is much more readable. Kivy, a python framework for Mobile Apps (http://kivy.org/#home, http://kivy.org/docs/gettingstarted/rules.html) has followed the same philosophy as QtQuick/QML (http://qt-project.org/doc/qt-5/qtquick-index.html) for the User Interface as well.
I don't know why HTML is still too old school.
I know it is going to be challenging to all of a sudden change the syntax but I reckon it completely worth it. At least for the client side web developers it is going to be heaps easier to read and write the User Interfaces.
// File name = main.html
import main.js
import main.css
from model import nav, slider as nav_model, slider_model
from delegate import nav, slider as nav_delegate, slider_delegate
Html
name: house_keeping
title: "True HTML6++ Sample"
meta.title: "Page Title"
meta.description: "This is an example of HTML6++ with namespaces"
Body
Header
id: page_header
width: 100%; height: 200
Image
id: logo
src: "images/logo.png"
alt: "This is a logo"
Navview
model: nav_model
delegate: nav_delegate
Content
Sliderview
model: slider_model
delegate: slider_delegate
speed: 27
effect: fadein_fadeout
Article
h1: "This is my main article head"
h2: "This is my sub head"
p: "This is a paragraph"
p: "This is a paragraph"
Article
h1: "A cool video!"
h2: "Pay attetion to the media elements"
p: "This is a paragraph"
video
src: "vids/funny-cat.mp4"
autostart: true
controls: standard
p: "Man, that was a stupid cat."
Label
id: footer
text: "This site is © to Oscar Godson 2009"
// File name = model/nav (Fetch it from a database and make it dynamic instead)
ListModel
Item
menu_name: "Cats"
menu_link: "/cats"
active: true
Item
menu_name: "Dogs"
menu_link: "/dogs"
active: false
Item
menu_name: "Rain"
menu_link: "/rain"
active: false
// File name = delegate/nav.html (Delegate describes how each item in the view looks like)
Anchor
text: menu_name
link: menu_link
if active:
class: active
// File name = model/slider (Fetch it from a database and make it dynamic instead)
ListModel
Item
source: "cats.png"
caption: "Funny cats are awesome"
Item
source: "dogs.png"
caption: "Wild dogs are aweful"
Item
source: "rain.png"
caption: "Where is my rain coat?"
// File name = delegate/slider.html (Delegate describes how each item in the view looks like)
Rectangle
class: slider
Image
src: source
alt: caption
Label
text: caption