Skip to content

Syntax highlighting for jEdit and Micro #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _build/pages/language_support.markdown
Original file line number Diff line number Diff line change
@@ -14,4 +14,6 @@ Contents
#. [Geany](/pages/language_support_geany.html)
#. [Sublime Text](/pages/language_support_sublimetext.html)
#. [KDE Kate](/pages/language_support_kdekate.html)
#. [jEdit](/pages/language_support_jedit.html)
#. [Micro](/pages/language_support_micro.html)
:::
21 changes: 21 additions & 0 deletions _build/pages/language_support_jedit.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SmallBASIC in jEdit

> Using jEdit

_"jEdit is a free software text editor available under GPL-2.0-or-later. It is written in Java and runs on any operating system with Java support, including BSD, Linux, macOS and Windows. " ([wikipedia](https://en.wikipedia.org/wiki/JEdit))_

![Example](https://github.com/Joe7M/smallbasic.jedit.syntaxcoloring/blob/main/Screenshot.png)

## Setup Syntax Highlighting and Coloring

- Download the file `smallbasic.xml` from [Github](https://github.com/Joe7M/smallbasic.jedit.syntaxcoloring)
- Start jedit
- Go to `Utilities -> Global Options -> Editing -> Edit Modes`
- In the section `Add Mode` create a new mode:
- Mode Name: 'smallbasic'
- Select Mode File: select `smallbasic.xml`
- File Name Glob: `*.bas`
- First Line Glob: leave empty
- Click button `Add Mode`

Tip: In `Utilities -> Global Options -> Editing -> Edit Modes` you can remove `vbscript` from the section `Selected modes` to make SmallBASIC the standard syntax highlighting for bas files.
11 changes: 11 additions & 0 deletions _build/pages/language_support_micro.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SmallBASIC in Micro

> Using Micro

_"Micro is a modern and intuitive terminal-based text editor " ([micro](https://micro-editor.github.io/))_

![Example](https://github.com/Joe7M/smallbasic.micro.syntaxcoloring/blob/main/Screenshot.png)

## Setup Syntax Highlighting and Coloring

Download the file `smallbasic.yaml` from [github](https://github.com/Joe7M/smallbasic.micro.syntaxcoloring) and copy it to `~/.config/micro/syntax/`.
17 changes: 8 additions & 9 deletions _build/reference/589-file-dirwalk.markdown
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# DIRWALK

> DIRWALK directory [, wildcards] [USE ...]
> DIRWALK dir [, wildcards] [USE f(x)]

Walk through the specified directories. The user-defined function must returns zero to stop the process.
The user defined function takes `x` as a parameter. `x` contains information about the current file.
Walk through the specified directory `dir` and its subdirectories. The user defined function `f(x)` takes `x` as a parameter. `x` contains information about the current file. `f(x)` must return zero to stop the process. `wildcards` can be used to filter the files.

## Example 1: Print all files
### Example 1: Print all files

```
FUNC PRNF(x)
@@ -16,7 +15,7 @@ END
DIRWALK "." USE PRNF(x)
```

## Example 2: Create a list of all files
### Example 2: Create a list of all files

```
FUNC ListFiles(x)
@@ -31,7 +30,7 @@ for n in FileList
next
```

## Example 3: Search for a certain file using wildcards
### Example 3: Search for a certain file using wildcards

```
FUNC ListFiles(x)
@@ -46,7 +45,7 @@ for n in FileList
next
```

## Example 4: Search a certain file using user defined function
### Example 4: Search a certain file using user defined function

```
func SearchFile(x)
@@ -63,7 +62,7 @@ DIRWALK "." USE SearchFile(x)
print path
```

## Example 5: Using wilcards
### Example 5: Using wilcards

```
FUNC ListFiles(x)
@@ -78,7 +77,7 @@ for n in FileList
next
```

## Example 6: File list utility
### Example 6: File list utility

~~~

6 changes: 3 additions & 3 deletions _build/reference/615-graphics-draw.markdown
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@

> DRAW CommandString

Draw lines as specified by the given CommandString. The CommandString is created using commands from the Graphics Definition Language.
Draw lines as specified by the given `CommandString`. The `CommandString` is created using commands from the Graphics Definition Language.
The start point for drawing can be defined using the PSET command. COLOR can be used to change the color of the lines.

## Graphics Definition Language
### Graphics Definition Language

In the movement instructions below, n specifies a distance to move in pixel.

@@ -24,7 +24,7 @@ In the movement instructions below, n specifies a distance to move in pixel.
| N | A prefix command. Next movement command moves, but returns immediately to previous point.


## Example 1: Let's draw a house
### Example 1: Let's draw a house

```
COLOR 9
6 changes: 3 additions & 3 deletions _build/reference/617-graphics-image.markdown
Original file line number Diff line number Diff line change
@@ -137,12 +137,12 @@ dim png
i.save(png)
```

### Clip command (console version only)
### Clip command

Reduces the size of the image.
Clips the image. Next draw or show command will display only this part of the image. On the same image a new clip can be set.

```
png.clip(left, top, right, bottom)
i.clip(left, top, width, height)
```

### Filter command (console version only)
6 changes: 3 additions & 3 deletions _build/reference/642-language-do.markdown
Original file line number Diff line number Diff line change
@@ -4,18 +4,18 @@

This keyword is used to declare single-line commands. It can be used with WHILE and FOR-family commands.

## Example 1
### Example 1

```
For i = 1 to 10 do print i
```

## Example 2
### Example 2
```
FOR f IN files("*.txt") DO PRINT f
```

## Example 3
### Example 3

```
While(i < 10) do i++
15 changes: 10 additions & 5 deletions _build/reference/694-math-diffeqn.markdown
Original file line number Diff line number Diff line change
@@ -4,12 +4,15 @@

Solving first-order differential equations using Runge-Kutta method.

dy/dx = f(y,x) with start condition: y(x = x0) = y0
- `expr` : f(y,x) = dy/dx with start condition: y(x = x0) = y0
- `x0`, `y0` : initial x, y
- `xf` : final x
- `yf` : result
- `maxseq` : equivalent to precision
- `maxerr` : maximum allowed error
- `errcode` : 0 for success; otherwise calculation error

x0,y0 = initial x,y
xf = final x
errcode = 0 for success; otherwise calculation error
yf = result
### Example 1

```
' Solving dy/dx = 7*y^2 * x^3 with start condition y(2) = 3
@@ -38,6 +41,8 @@ if(errcode != 0) then
endif
```

### Example 2

```
' Defining the differential equation for a stiffness system

8 changes: 5 additions & 3 deletions _build/reference/729-math-determ.markdown
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# DETERM

> DETERM (A[, toler])
> D = DETERM (A [, toler])

Determinant of A. toler = tolerance number. the absolute value of the lowest acceptable number. default = 0.
Determinant of `A`. `toler` is the tolerance number. It is equivalent to the absolute value of the lowest acceptable number. Default value is `0`.

### Example

```
A = [ 0, 1, 2; 3, 2, 1; 1, 1, 0]
print determ(A)
print determ(A) ' Output: 3
```

2 changes: 1 addition & 1 deletion _build/reference/777-string-disclose.markdown
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ if `pairs` and `ingnore-pairs` are not given, the following default pairs and i
| { | {} | " " ' ' |
| < | <> | " " ' ' |

## Example 1: Disclose default pairs
### Example 1: Disclose default pairs

```
s = "(abc)"