Skip to content

Instantly share code, notes, and snippets.

View jeshan's full-sized avatar
🏠
Working from home

Jeshan Giovanni BABOOA jeshan

🏠
Working from home
  • Independent
  • Mauritius
View GitHub Profile
@jeshan
jeshan / angular-intro-11.html
Last active August 29, 2015 14:15
angular-intro-11; internationalisation
<!DOCTYPE html>
<html ng-app='angularApp'>
<head>
<meta name="description" content="angular-intro-11; internationalisation">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="//code.angularjs.org/1.3.2/i18n/angular-locale_da-dk.js"></script>
<!--<script src="//code.angularjs.org/1.3.2/i18n/angular-locale_en-gb.js"></script>-->
<script src="script.js">
</script>
{
"plugins": [
{
"pluginId": "AceJump",
"pluginName": "AceJump",
"downloadUrl": "https://github.com/johnlindquist/AceJump",
"dependencyPluginIds": [
"com.intellij",
"com.intellij.modules.platform"
],
// hello world
html()
.body()
.heading(Heading.Level.ONE, "Hello, world!");
public String getMeSomeHtml() {
Html html = new Html();
Head head = html.getHead();
head.addMeta("charset", "UTF-8");
head.addMeta("viewport", "width=device-width");
Body body = html.getBody();
body.addParagraph("hello, world!");
body.addHeading(Heading.Level.ONE, "Level one text");
return body.toString();
// keep the reference which will allow us to walk through the structure
Html html = html();
// creating a meta tag and navigating down the tree
html
.head()
.meta("charset", "UTF-8");
/*
<html>
// Creating the document, with some headings and a paragraph
html
.body()
.heading(Heading.Level.ONE, "Hello h1")
.heading(Heading.Level.TWO, "level 2")
.paragraph("Some text in a paragraph goes here");
/*
<html>
<body>
// .get() because meta(String) returns an Optional<Meta>
// and since null references suck
html
.head()
.meta("charset").get()
.head()
.html(); // back to the html object reference!
public class Html {
private Body body = Body.create(this);
private Head head = Head.create(this);
public static Html html() { return new Html(); }
public Head head() { return head; }
public Body body() { return body; }
import static com.methodicalprogrammer.fluent.htmlgenerator.Html.html;
html()
.head()
.title("Insert page title here.");
/*
<html>
<head>
<title>Insert page title here.</title>
</head>
</html>