This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ceylon.html { Html, html5, Head, Body, P, H2, Ul, Li } | |
/** | |
Remark: Don't forget to import the html module in your module !! | |
import ceylon.html "1.0.0"; | |
Output of program: | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> | |
Hello Ceylon | |
</title> | |
</head> | |
<body> | |
<h2> | |
Introduction | |
</h2> | |
<ul> | |
<li> | |
Basics | |
</li> | |
<li> | |
Classes | |
</li> | |
</ul> | |
</body> | |
</html> | |
**/ | |
void htmlDemo() { | |
Html html = Html { | |
doctype = html5; | |
head = Head { title = "Hello Ceylon"; }; | |
body = Body { | |
H2 { text = "Introduction";}, | |
Ul { | |
Li {text = "Basics";}, | |
Li {text = "Classes";} | |
} | |
}; | |
}; | |
print(html); | |
} |
No comments:
Post a Comment