
Sweet
is a pre-compiled language based on Ruby and Python. Sweet makes possible to use all the class, defs, conditionals, global and local variables power of server-side languages, defining blocks by indentation like Python in your Sweet HTML markup. It comes with a SIC ( Sweet Interactive Console ) the you can test your code and ideas before really right and compile it.
html
head
title
'A Sweet basic demostration'
body
h1 #title
'Welcome to Sweet'
h2 .subtitle
'Hope you enjoy it'
head
title
'A Sweet basic demostration'
body
h1 #title
'Welcome to Sweet'
h2 .subtitle
'Hope you enjoy it'
A Sweet basic demostration
Welcome to Sweet
Hope you enjoy it
Features:
- Clear and simple syntax
- Defining blocks using indentation
-
Support to Class, Def, Conditionals, Constants and Variables
- Just If conditional for now ( whitout else )
- Local and Global Variables ( down / uppercase eg. lol / Lol )
- Constants ( TRUE, FALSE, NIL )
- SIC ( Sweet Interactive Console )
- Automaticly return of the last value of Def
- Multiple scopes
- A small and cool extension '.s'
Hard Usage:
class Sweet
def get_user(admin)
if admin
'Jonh Doe'
def get_status(usr)
if usr
'Logged'
Sweet = Sweet.new
Var1 = 'A Sweet hard demostration'
Var2 = 'Welcome to Sweet'
Var3 = 'Hope you keep enjoing it'
html
head
title
print( Var1 )
body
h1 #title
print( Var2 )
h2 .subtitle
print( Var3 )
div #user
ul #container
li .name
code_def = Sweet.get_user(true)
print (code_def)
li .status
code_def = Sweet.get_status(code_def)
print (code_def)
div #logout
a href=logout
'Do you wanna logout'
div #login
form action=login #form
input type=text #email
def get_user(admin)
if admin
'Jonh Doe'
def get_status(usr)
if usr
'Logged'
Sweet = Sweet.new
Var1 = 'A Sweet hard demostration'
Var2 = 'Welcome to Sweet'
Var3 = 'Hope you keep enjoing it'
html
head
title
print( Var1 )
body
h1 #title
print( Var2 )
h2 .subtitle
print( Var3 )
div #user
ul #container
li .name
code_def = Sweet.get_user(true)
print (code_def)
li .status
code_def = Sweet.get_status(code_def)
print (code_def)
div #logout
a href=logout
'Do you wanna logout'
div #login
form action=login #form
input type=text #email
Comparison:
CoffeeKup
html - >
head - >
title 'A Sweet basic demostration'
body - >
h1 id:title, - >
'Welcome to Sweet'
h2 class:subtitle, - >
'Hope you enjoy it'
head - >
title 'A Sweet basic demostration'
body - >
h1 id:title, - >
'Welcome to Sweet'
h2 class:subtitle, - >
'Hope you enjoy it'
Jade
html
head
title A Sweet basic demostration
body
h1(id='title')
Welcome to Sweet
h2(class='subtitle')
Hope you enjoy it
head
title A Sweet basic demostration
body
h1(id='title')
Welcome to Sweet
h2(class='subtitle')
Hope you enjoy it
Sweet
html
head
title
'A Sweet basic demostration'
body
h1 #title
'Welcome to Sweet'
h2 #subtitle
'Hope you enjoy it'
head
title
'A Sweet basic demostration'
body
h1 #title
'Welcome to Sweet'
h2 #subtitle
'Hope you enjoy it'