annotate website/src/lib/Shared.luan @ 1652:d5779a264a4a

docs work
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 31 Mar 2022 19:04:59 -0600
parents 5b8f056527a3
children 418b610e887b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1651
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local ipairs = Luan.ipairs or error()
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local Shared = {}
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 function Shared.head()
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 %>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 <meta name="viewport" content="width=device-width, initial-scale=1">
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 <style>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 @import "/site.css";
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 </style>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <%
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 end
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16
1652
d5779a264a4a docs work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1651
diff changeset
17 local function header(crumbs)
1651
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 %>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 <div header>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 <a href="/">Luan</a>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 <% for _, crumb in ipairs(crumbs or {}) do %>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 / <%=crumb%>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 <% end %>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 </div>
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 <%
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 end
1652
d5779a264a4a docs work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1651
diff changeset
27 Shared.header = header
d5779a264a4a docs work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1651
diff changeset
28
d5779a264a4a docs work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1651
diff changeset
29 function Shared.docs_header()
d5779a264a4a docs work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1651
diff changeset
30 header{[[<a href="/docs.html">Documentation</a>]]}
d5779a264a4a docs work
Franklin Schmidt <fschmidt@gmail.com>
parents: 1651
diff changeset
31 end
1651
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32
5b8f056527a3 docs work
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 return Shared