Skip to content

Commit b1da5d5

Browse files
committed
DOC: update reference index
1 parent d723145 commit b1da5d5

File tree

5 files changed

+99
-163
lines changed

5 files changed

+99
-163
lines changed

_build/Makefile

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mkdir = @mkdir -p $(dir $@)
2020
out = _out
2121
pandoc_options=--smart --to html5
2222
bas = $(patsubst layouts/%.html, $(out)/%.bas, $(wildcard layouts/*.html))
23-
pages = $(patsubst pages/%.html, $(out)/pages/%.bas, $(wildcard pages/*.html))
23+
pages = $(patsubst pages/%.markdown, $(out)/pages4/%.html, $(wildcard pages/*.markdown))
2424
reference = $(patsubst reference/%.markdown, $(out)/reference3/%.html, $(wildcard reference/*.markdown))
2525

2626
# rules
@@ -38,23 +38,36 @@ $(out)/reference1/%.html: reference/%.markdown
3838

3939
$(out)/reference2/%.html: $(out)/reference1/%.html $(bas)
4040
$(mkdir)
41-
$(sbasic) $(out)/post.bas $< > $@
41+
$(sbasic) $(out)/reference.bas $< > $@
4242

4343
$(out)/reference3/%.html: $(out)/reference2/%.html
4444
$(mkdir)
4545
$(sbasic) $(out)/sitepage.bas $< > $@
4646

47-
$(out)/pages/%.bas: pages/%.html .data
48-
@mkdir -p $(out)/pages
49-
@mkdir -p $(out)/html/pages
47+
$(out)/pages/%.html: pages/%.markdown
48+
$(mkdir)
49+
$(pandoc) $(pandoc_options) -o $@ $<
50+
51+
$(out)/pages/%.bas: $(out)/pages/%.html $(bas)
52+
$(mkdir)
5053
$(sbasic) mkpage.bas $< > $@
51-
$(sbasic) $@ > $(out)/$<
52-
$(sbasic) $(out)/sitepage.bas $(out)/$< > $(out)/html/$<
54+
55+
$(out)/pages2/%.html: $(out)/pages/%.bas
56+
$(mkdir)
57+
$(sbasic) $< > $@
58+
59+
$(out)/pages3/%.html: $(out)/pages2/%.html
60+
$(mkdir)
61+
$(sbasic) $(out)/article.bas $< > $@
62+
63+
$(out)/pages4/%.html: $(out)/pages3/%.html
64+
$(mkdir)
65+
$(sbasic) $(out)/sitepage.bas $< > $@
5366

5467
all: $(reference) $(pages)
5568
@mkdir -p ../reference
5669
$(sbasic) deploy.bas
57-
@cp $(out)/html/pages/*.html ../
70+
@cp $(out)/pages4/*.html ../
5871

5972
clean:
6073
rm -rf $(out) *.sbu

_build/layouts/article.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="article">
2+
{{ content }}
3+
</div>
File renamed without changes.

_build/pages/reference.html

Lines changed: 0 additions & 155 deletions
This file was deleted.

_build/pages/reference.markdown

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Language reference
2+
==================
3+
4+
BASIC is a very simple language and it is a perfect tool for calculations or utilities.
5+
Its name stands for (B)eginners (A)ll-purpose (S)ymbolic (I)nstruction (c)ode. It was developed by John
6+
Kemeny and Thomas Kurtz at Dartmouth College during the middle of 1960, and was one of the most
7+
popular languages for several decades. {.roleNote}
8+
9+
How to read the language reference syntax
10+
-----------------------------------------
11+
12+
* Everything written inside of [] characters are optional values.
13+
* Everything written inside of { characters means you must select one of them.
14+
* The symbol | means OR.
15+
* The symbols ... mean you can repeat the previous syntax.
16+
* Keywords are written with capital letters.
17+
* Parameters are written with lower letters.
18+
* Keywords with suffix () are functions.
19+
* Parameters with suffix () are arrays.
20+
21+
~~~
22+
FOO <- This is keyword
23+
FOO() <- This is function
24+
foo <- This is variable/parameter
25+
foo() <- This is array/parameter
26+
{A|B} <- This means that you must type A or B
27+
[{A|B}] <- This means that you must use A or B or nothing
28+
~~~
29+
30+
The following example means that you must give the first parameter (a) but you can use the second (x)
31+
only if you want to. But if you want to use the (x) you must also separate it from (a) with a comma.
32+
33+
~~~FOO a[, x]~~~
34+
35+
The next example means that you must use the first parameter. You can also use second parameter
36+
but you must separate it with ',' or ';'. You can also repeat the last syntax more times.
37+
38+
~~~FOO var [{,|;} var2 [...]]~~~
39+
40+
<div class="contentsPanel">
41+
<div class="contentsHeader">Contents</div>
42+
<ul>
43+
<li><span>1</span><a href="/reference/521.html">Console</a></li>
44+
<li><span>2</span><a href="/reference/581.html">Data</a></li>
45+
<li><span>3</span><a href="/reference/575.html">Date</a></li>
46+
<li><span>4</span><a href="/reference/580.html">File</a></li>
47+
<li><span>5</span><a href="/reference/611.html">Graphics</a></li>
48+
<li><span>6</span><a href="/reference/662.html">Language</a></li>
49+
<li><span>7</span><a href="/reference/704.html">Math</a></li>
50+
<li><span>8</span><a href="/reference/771.html">String</a></li>
51+
<li><span>9</span><a href="/reference/1439.html">System</a></li>
52+
</ul>
53+
</div>
54+
55+
You can find
56+
------------
57+
58+
escape codes under Console or under Articles "Escape Codes"
59+
ARRAY under Data, ISMAP under Data, ISREF under Data
60+
61+
bit color systems under Graphics
62+
STEP under Graphics, aspect under Graphics, FILLED under Graphics, QBcolors under COLOR under Graphics
63+
64+
"system variables" AKA built in coder constants under System eg, pi, xmax, ymax, cwd...
65+
INCLUDE under System
66+
67+
Allot of information is under Articles > "Welcome to SmallBASIC":
68+
operators eg ~ % ^ ! IN LIKE
69+
special characters eg [ , ;] ARRAY definition << append to array
70+
basic stuff about variables, subs and functions
71+
aha! stuff on units, meta commands, options, pseudo operators
72+
73+
TRY CATCH THROW ENDTRY ... located in Language ref > Language unsorted list
74+
75+

0 commit comments

Comments
 (0)