Skip to content

Instantly share code, notes, and snippets.

@robotlolita
Last active December 16, 2015 04:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robotlolita/5379617 to your computer and use it in GitHub Desktop.
Save robotlolita/5379617 to your computer and use it in GitHub Desktop.
Elegance. A pure, declarative language for writing documents (HTML/XML/etc.)
uses html;
uses prelude;
let style-sheets { |...xs|
map xs { |x| link href: x/url rel: x/kind type: "text/css" };
};
let search-panel {
uses jumper-skirt as jsk;
div#search-panel
jsk/search placeholder: "Search a project by name...";
};
let navigation {
div#header
search-panel
h1#logo > DONT PANIC
}
let contents { |xs| match xs
| Project x => x/name
| _ x => ":("
}
let layout { |*k ...items|
html-5
head
title > [[k/title]] - DONT PANIC
style-sheets resources/css
body.foo id: k/kind
navigation
contents k/items
footer >
Hacked together while drinking something *not entirely unlike* tea.
Don't forget your towel
}
uses html
uses prelude
let style-sheets = { |...xs|
<map xs>{ |x| <link href: x/url rel: x/kind type: "text/css" /> }</map>
}
let search-panel = {
uses jumper-skirt as jsk
<div#search-panel>
<jsk/search placeholder: "Search a project by name..." />
</div#search-panel>
}
let navigation = {
<div#header>
<search-panel />
<h1#logo>DONT PANIC</h1>
</div#header>
}
let contents = {
:| (Project x) => x/name
:| (_ x) => ":("
}
let layout = { |*k ...items|
<html-5>
<head>
<title>k/title <text>- DONT PANIC</text></title>
<style-sheets resources/css />
</head>
<body.foo id: k/kind>
<navigation />
<contents items />
<footer><markdown>
Hacked while drinking something *not entirely unlike* tea, by [Sorella][].
Don't forget your towel.
</markdown></footer>
</body>
</html-5>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment