-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
90 lines (64 loc) · 3.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<html>
<head>
<title>Simplates</title>
<link rel="stylesheet" type="text/css"
href="/style.css" />
<link rel="stylesheet" type="text/css"
href="//cloud.typography.com/6540672/777924/css/fonts.css" />
<style>
body { font: normal 16px/20px 'Sentinel SSm A', 'Sentinel SSm B'; }
h1 { font: bold 36px/42px 'Sentinel SSm A', 'Sentinel SSm B'; margin: 72px 0 0; }
h2 { font: bold 20px/24px 'Sentinel SSm A', 'Sentinel SSm B'; margin: 40px 0 0;}
.content { max-width: 500px; margin: 40px auto; padding: 0 20px; }
pre { border-left: 4px solid #CCC; padding-left: 20px; }
</style>
</head>
<body><div class="content">
<h1>Simplates</h1>
<p>Simplates are a file format for server-side web programming.</p>
<h2>Why Simplates?</h2>
<p>Mixing code into templates leads to unmaintainable spaghetti. On the
other hand, putting closely-related templates and code in completely
separate subdirectories makes it painful to switch back and forth.</p>
<p>Simplates improve web development by bringing code and templates as
close together as possible, <i>without</i> mixing them.</p>
<p>We're using simplates successfully in <a
href="http://aspen.io/">Aspen</a>, the web framework behind <a
href="https://gratipay.com/">Gratipay</a>. We like the pattern. It
works for us. Can it also work for other teams using other languages
and templating systems and web frameworks? Let's find out. :-)</p>
<h2>What Does a Simplate Look Like?</h2>
<p>Here's an example:</p>
<pre>
import random
[----]
program = request.qs['program']
excitement = "!" * random.randint(1, 10)
[----] text/html via stdlib_format
<h1>Greetings, {program}{excitement}</h1>
[----] text/plain via stdlib_format
Greetings, {program}{excitement}
[----] application/json via json_dump
{ "program": program
, "excitement": excitement
}</pre>
<h2>Implementations and Tools</h2>
<ul>
<li><a href="http://aspen.io/">Aspen</a>—a Python web framework that uses simplates with filesystem routing</li>
<li><a href="https://github.com/AspenWeb/simplate.vim">simplate.vim</a>—simplates support for Vim</li>
<li><a href="https://github.com/Changaco/kate-highlightings/blob/master/simplate.xml">simplate.xml</a>—simplates support for Kate</li>
<li><a href="https://github.com/rohitpaulk/sublime-simplates">sublime-simplates</a>—simplates support for Sublime Text</li>
</ul>
<a href="https://github.com/AspenWeb/simplates.org"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<h2>Similar Formats</h2>
<ul>
<li><a href="https://web.archive.org/web/20150716125225/https://www.sics.se/~joe/ml9/doc.html">Markup Language
9 (ml9)</a>—a simple markup language handling many
different types of data in a single unified framework</li>
</ul>
<h2>Feedback? Questions?</h2>
<p>Start a <a
href="https://github.com/AspenWeb/simplates.org/issues/new">conversation
on GitHub</a>.</p>
</div></body>
</html>