Repository navigation
Expand file tree
/
Copy pathsamples.html
More file actions
51 lines (50 loc) · 1.5 KB
/
Copy pathsamples.html
File metadata and controls
51 lines (50 loc) · 1.5 KB
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
<div class="article">
<h1>Samples</h1>
{%
githost = "https://raw.githubusercontent.com/smallbasic/smallbasic.samples"
sections = ["getting started",
"applications",
"business",
"easter calculators",
"code demos",
"network",
"games 1",
"games 2",
"games 3",
"geometry",
"graphics 1",
"graphics 2",
"graphics 3",
"graphics 4",
"mathematics",
"mechanics",
"physics",
"sound",
"system",
"units",
"utilities" ]
const samplesPath = trim(env("SAMPLES"))
func sortFunc(l, r)
local f1 = lower(l)
local f2 = lower(r)
return iff(f1 == f2, 0, iff(f1 > f2, 1, -1))
end
func sortedFiles(section)
local result = files(samplesPath + "/" + section + "/*.bas")
sort result use sortFunc(x, y)
return result
end
for section in sections %}
<div class="lavenderBox">
<div class="header">{{ ucase(section) }}</div>
<div class="linklist">
{% for filename in sortedFiles(section) %}
<a target="_github" href="{{ githost }}/master/{{ section + "/" + filename }}">{{ filename }} </a>
{% next filename %}
</div>
</div>
{% next section %}
<br>
Found a bug? Please report on Github <a href="https://github.com/smallbasic/smallbasic.samples/issues" target="_blank">Issues</a>
</div>
</div>