Skip to content

Commit 030e45c

Browse files
committed
Pandoc syntax highlighting for code-blocks
1 parent fac6aea commit 030e45c

31 files changed

+591
-132
lines changed

_build/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pandoc = /usr/bin/pandoc
1818
# variables
1919
mkdir = @mkdir -p $(dir $@)
2020
out = _out
21-
pandoc_options=--from markdown-tex_math_dollars --to html5
21+
pandoc_options=--from markdown-tex_math_dollars --to html5 --syntax-definition=smallbasic.xml
2222
bas = $(patsubst layouts/%.html, $(out)/%.bas, $(wildcard layouts/*.html))
2323
pages = $(patsubst pages/%.markdown, $(out)/pages3/%.html, $(wildcard pages/*.markdown))
2424
posts = $(patsubst posts/%.markdown, $(out)/posts3/%.html, $(wildcard posts/*.markdown))

_build/pages/android.markdown

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ All of the above UI elements are written in SmallBASIC, see [main.bas](https://g
3737

3838
To use the following services, your program must start with the following two lines:
3939

40-
```
40+
```smallbasic
4141
option predef load modules
4242
import android
4343
```
@@ -48,23 +48,23 @@ The first line tell SmallBASIC to dynamically load runtime modules. The second l
4848

4949
GPS_ON
5050

51-
```
51+
```smallbasic
5252
android.gps_on()
5353
```
5454

5555
Instructs the system to commence recording location information. Note: This relies on the device location services being enabled by the user.
5656

5757
GPS_OFF
5858

59-
```
59+
```smallbasic
6060
android.gps_off()
6161
```
6262

6363
Turns off recording of location information.
6464

6565
LOCATION
6666

67-
```
67+
```smallbasic
6868
l = android.location()
6969
```
7070

@@ -86,7 +86,7 @@ For more details, see: <https://developer.android.com/reference/android/location
8686

8787
SENSOR_ON
8888

89-
```
89+
```smallbasic
9090
const SensorAccelerometer = 0
9191
const SensorMagneticField = 1
9292
const SensorGyroscope = 2
@@ -99,15 +99,15 @@ Enables the given sensor (currently only one may be enabled at a time). Throws a
9999

100100
SENSOR_OFF
101101

102-
```
102+
```smallbasic
103103
android.sensor_off()
104104
```
105105

106106
Disables any active sensor.
107107

108108
SENSOR
109109

110-
```
110+
```smallbasic
111111
s = android.sensor()
112112
```
113113

@@ -131,39 +131,39 @@ Notes:
131131

132132
TTS_PITCH
133133

134-
```
134+
```smallbasic
135135
android.tts_pitch(n)
136136
```
137137

138138
Sets the voice pitch (default is 1.0).
139139

140140
TTS_RATE
141141

142-
```
142+
```smallbasic
143143
android.tts_rate(n)
144144
```
145145

146146
Sets the rate of speaking (default is 1.0)
147147

148148
TTS_LANG
149149

150-
```
150+
```smallbasic
151151
android.tts_lang(s)
152152
```
153153

154154
Sets the locale, for example "en", "de", "fr" for English, German, France. May cause the system to download the language codec if not already installed.
155155

156156
TTS_OFF
157157

158-
```
158+
```smallbasic
159159
android.tts_off()
160160
```
161161

162162
Turns off text to speech output.
163163

164164
SPEAK
165165

166-
```
166+
```smallbasic
167167
android.speak(text)
168168
```
169169

_build/pages/escape.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SmallBASIC supports a number of escape codes for controlling the display. The co
3131

3232
Instead of `\e` the command CHR(27) is useful for obtaining and printing the escape character.
3333

34-
```Freebasic
34+
```smallbasic
3535
PRINT CHR(27) + "[1mTHIS IS BOLD" + CHR(27) + "[0m"
3636
PRINT CHR(27) + "[3mThis is italic" + CHR(27) + "[0m"
3737
PRINT CHR(27) + "[4mThis is underline"
@@ -47,7 +47,7 @@ The EscapeCode Unit makes it easier to use escape codes and to deal with differe
4747

4848
Here an example on how to use the unit:
4949

50-
```Freebasic
50+
```smallbasic
5151
' SmallBASIC 12.25
5252
' Example for using UNIT "EscapeCodes"
5353
' For more information see: https://smallbasic.github.io/pages/escape.html

_build/pages/network.markdown

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Network programming
77

88
Use the prefix "HTTP:" with the OPEN command to open a network HTTP connection. You can then use the file number with the TLOAD command to read the data.
99

10-
```
10+
```smallbasic
1111
print "DuckDuckGo Search"
1212
while 1
1313
print '<=== when cycle around need to isolate input prompt
@@ -43,7 +43,7 @@ wend
4343

4444
Use the prefix "HTTP:" with the OPEN command to open an image file over the network. You can then pass the file number to the IMAGE command. This returns an system object which can then be used to manipulate images in the graphical version of SmallBASIC.
4545

46-
```
46+
```smallbasic
4747
' open some random image I found on the net
4848
open "http://img2.wikia.nocookie.net/__cb20150113215904/farmville/images/9/92/Lumberjack_Gnome-icon.png" as #1
4949
@@ -85,7 +85,7 @@ pause true
8585

8686
Use the prefix "SOCL:" with the OPEN command to open a network socket. You can then use the file number with other input/output commands to interact with the connection.
8787

88-
```
88+
```smallbasic
8989
open "SOCL:192.168.178.76:8080" as #1
9090
print #1, "time"
9191
lineinput #1, s
@@ -95,7 +95,7 @@ close #1
9595

9696
If you omit the host name in the SOCL: string passed to the OPEN command, SmallBASIC will listen for connections from another host/process.
9797

98-
```
98+
```smallbasic
9999
rem Print a date string like '29 SEP 2018 09:31:49 ACST'
100100
func get_time
101101
local today = julian(date)
@@ -127,15 +127,15 @@ In addition to the graphical and command line versions of SmallBASIC, there is a
127127

128128
You launch the web SmallBASIC in a folder containing one or more SmallBASIC programs, you then point your browser to a URL formulated from the listening port number and the SmallBASIC program name. For example:
129129

130-
```
130+
```smallbasic
131131
$ ls cats.bas # program cats.bas exists in the current folder
132132
$ sbasicw
133133
Starting SmallBASIC web server on port:8080
134134
```
135135

136136
In your Web Browser:
137137

138-
```
138+
```smallbasic
139139
http://localhost:8080/cats.bas
140140
Output from cats.bas displayed in the web browser.
141141

_build/pages/plugins_clipboard.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Clipboard is a simple plugin to copy and paste text between your SmallBASIC prog
99
The plugin can be used by importing it with `import clipboard`. A simple "Hello World" program looks like this:
1010

1111

12-
```
12+
```smallbasic
1313
import clipboard
1414
1515
print clipboard.paste()

_build/pages/plugins_gifenc.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Gifenc lets you create simple animated gif images. It is based on a c library cr
99
The plugin can be used by importing it with `import gifenc`. A simple program creating a moving stripe pattern with 8 frames looks like this:
1010

1111

12-
```
12+
```smallbasic
1313
import gifenc as ge
1414
1515
const w = 120

_build/pages/plugins_nuklear.markdown

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If you are working in Windows, then start your program with:
2626

2727
The following code shows how to create your first "Hello World" window.
2828

29-
```
29+
```smallbasic
3030
option predef grmode 640x480 ' Set window size
3131
3232
import nuklear as nk ' Import Nuklear plugin
@@ -44,7 +44,7 @@ With `nk.windowBegin()` a window will be created, if not already present. Additi
4444

4545
## Placing a button
4646

47-
```
47+
```smallbasic
4848
option predef grmode 640x480
4949
5050
import nuklear as nk
@@ -69,7 +69,7 @@ Before you can add a button, you have to define a layout which can hold the GUI
6969

7070
## Displaying two radio buttons
7171

72-
```
72+
```smallbasic
7373
option predef grmode 640x480
7474
7575
import nuklear as nk
@@ -98,7 +98,7 @@ Because `nk.layoutRow("dynamic", 90, 2)` is this time set to "2" two elements ar
9898

9999
## Dynamic rows vs. static rows
100100

101-
```
101+
```smallbasic
102102
option predef grmode 640x480
103103
104104
import nuklear as nk
@@ -133,7 +133,7 @@ If you run this example and change the size of the window with the mouse, you ca
133133

134134
## Show input boxes with labels - More flexible row layout
135135

136-
```
136+
```smallbasic
137137
option predef grmode 640x480
138138
139139
import nuklear as nk
@@ -174,7 +174,7 @@ When using `nk.layoutRowBegin(...)` the end of the definition for a row has to b
174174

175175
Caution: `menuItem()` is not yet working probably. This will be fixed with the next release.
176176

177-
```
177+
```smallbasic
178178
option predef grmode 640x480
179179
180180
import nuklear as nk
@@ -208,7 +208,7 @@ The example above will display a menu with one entry called "Menu". When clicked
208208

209209
### Draw basic shapes
210210

211-
```
211+
```smallbasic
212212
option predef grmode 640x480
213213
214214
import nuklear as nk
@@ -263,7 +263,7 @@ checkboxValue: actual value of the checkbox
263263

264264
Creates a checkbox with the name _Name_. State of the checkbox is stored in _checkboxValue_.
265265

266-
```
266+
```smallbasic
267267
checkA = {value: false}
268268
...
269269
nk.Checkbox("Checkbox A", checkA)
@@ -290,7 +290,7 @@ color: color of the colorpicker
290290

291291
Creates a colorpicker. The color picked by the user is stored in color.value as a string.
292292

293-
```
293+
```smallbasic
294294
colorPicker = {value: "#ff0000"}
295295
...
296296
nk.colorPicker(colorPicker)
@@ -305,7 +305,7 @@ comboValue (map): settings of combobox
305305

306306
Creates a combobox. The number of the selected combobox is stored in _comboValue.value_.
307307

308-
```
308+
```smallbasic
309309
comboA = {value: 1, items: ["A", "B", "C"]}
310310
nk.combobox(comboA)
311311
```
@@ -319,7 +319,7 @@ triggerX, triggerY, triggerW, triggerH: Trigger area in pixel
319319

320320
Creates an contextual menu. Right-click in the trigger area will open a menu.
321321

322-
```
322+
```smallbasic
323323
[x, y, w, h] = nk.widgetBounds()
324324
if nk.contextualBegin(100, 100, x, y, w, h) then
325325
nk.layoutRow("dynamic", 30, 1)
@@ -358,7 +358,7 @@ editValue: Stores the actual text
358358

359359
Creates an input box. The content of the input box is stored in _editValue.value_.
360360

361-
```
361+
```smallbasic
362362
editA = {value: ""}
363363
...
364364
nk.edit("field", editA)
@@ -383,7 +383,7 @@ Style (String): "", "border"
383383

384384
Groups several elements. The group can be surrounded by a border.
385385

386-
```
386+
```smallbasic
387387
nk.groupBegin("Group 1", "border")
388388
nk.layoutRow("dynamic", 30, 1)
389389
nk.label("Radio buttons:")
@@ -414,7 +414,7 @@ color (string): hex color, i.e "#ff0000"
414414

415415
Creates a label.
416416

417-
```
417+
```smallbasic
418418
nk.label("Left label")
419419
nk.label("Centered label", "centered")
420420
nk.label("Right label", "right")
@@ -523,7 +523,7 @@ modifiable: true or false (default: false)
523523

524524
Displays a progress bar. The length of the bar is given by _progressValue.value_. Set _modifiable_ to true, if you want to use the progress bar as a slider to change the value.
525525

526-
```
526+
```smallbasic
527527
progress.value = 5
528528
...
529529
nk.progress(progress, 10, false)
@@ -541,7 +541,7 @@ stepSizeByMoving: Stepsize when click + hold + moving the mouse
541541

542542
Displays an input box for numbers. The actual value is stored in _propertyValue.value_.
543543

544-
```
544+
```smallbasic
545545
property = {value: 6}
546546
...
547547
nk.property("Property", 1, property, 10, 0.25, 0.5)
@@ -575,7 +575,7 @@ selectValue: value of the item
575575

576576
Creates a list of items, which can be selected similar to a checkbox. The actual value of the selectable is stored in _selectValue.value_
577577

578-
```
578+
```smallbasic
579579
selectA = {value: false}
580580
selectB = {value: true}
581581
...
@@ -595,7 +595,7 @@ stepSize: step size of the slider when moving with the mouse
595595

596596
Displays a slider. The slider position is given by _sliderValue.value_
597597

598-
```
598+
```smallbasic
599599
sliderValue = {value: 5}
600600
...
601601
nk.slider(1, sliderValue, 10, .5)
@@ -632,7 +632,7 @@ TooltipValue (String): Text of the tooltip
632632

633633
Prints a tooltip.
634634

635-
```
635+
```smallbasic
636636
edit = {value: "Edit text"}
637637
...
638638
nk.layoutRow("dynamic", 30, 1)
@@ -657,7 +657,7 @@ name (String): name of tree element
657657

658658
Creates a tree.
659659

660-
```
660+
```smallbasic
661661
nk.layoutRow("dynamic", 30, 1)
662662
if nk.treePush("tab", "Tree Tab") then
663663
if nk.treePush("node", "Tree Node 1") then
@@ -715,7 +715,7 @@ w,h: width and height of the widget
715715

716716
Returns the position and the dimensions of a widget.
717717

718-
```
718+
```smallbasic
719719
edit = {value: "Edit text"}
720720
...
721721
nk.layoutRow("dynamic", 30, 1)

0 commit comments

Comments
 (0)