annotate src/lib/Shared.luan @ 16:bac9577e951b

add python
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 10 May 2022 16:20:41 -0600
parents da780d885325
children f92034a190d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
3 local ipairs = Luan.ipairs or error()
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local Shared = {}
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 function Shared.head()
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 %>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 <meta name="viewport" content="width=device-width, initial-scale=1">
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 <style>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 @import "/site.css";
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 </style>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <%
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 end
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
17 local function header(crumbs)
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 %>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 <div header>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 <a href="/">Reactionary Software</a>
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
21 <% for _, crumb in ipairs(crumbs or {}) do %>
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
22 / <%=crumb%>
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
23 <% end %>
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 </div>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 <%
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 end
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
27 Shared.header = header
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
28
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
29 function Shared.existing_header()
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
30 header{[[<a href="/existing.html">Existing</a>]]}
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
31 end
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
32
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
33 function Shared.needed_header()
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
34 header{[[<a href="/needed.html">Needed</a>]]}
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
35 end
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
36
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37 return Shared