Skip to content

Commit 609f21a

Browse files
authored
Merge pull request #74 from basiljs/fix/syntax-highlight-tutorials
fix(highlight): syntax must be defined
2 parents bfe5990 + fdf45a9 commit 609f21a

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ sass:
2727
sass_dir: _sass
2828
# Build settings
2929
markdown: kramdown
30+
# kramdown:
31+
# smart_quotes: ["apos", "apos", "quot", "quot"]
3032
highlighter: rouge
3133
plugins:
3234
- jekyll-feed

tutorials/02-syntax/index.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ Since Java and JavaScript are quite similar programming languages you do not hav
1111

1212
### Comments
1313

14-
```
14+
```js
1515
// This is an inline comment
1616
/* This is a block comment,
1717
that can go over several lines */
1818
```
1919

2020
### if / else conditions
2121

22-
```
22+
```js
2323
if ( a > 3 ) {
2424
// execute if a is bigger than 3
2525
} else {
@@ -29,7 +29,7 @@ if ( a > 3 ) {
2929

3030
### Logical comparisons
3131

32-
```
32+
```js
3333
a == b // equal
3434
a === b // Little difference to Java: You can check for same data type as well in... to be VERY sure
3535
a != b // not equal
@@ -38,14 +38,14 @@ a < b // smaller than
3838
a >= b // bigger or equal
3939
a <= b // smaller or equal
4040

41-
// You can combine statements with logical AND ”&&” resp. the logical OR ”||”
41+
// You can combine statements with logical AND "&&" resp. the logical OR "||"
4242
if ( a == b && b == c ) { ... } // AND
4343
if ( a == b || b == c ) { ... } // OR
4444
```
4545

4646
### Operators and assignments
4747

48-
```
48+
```js
4949
// +, -, *, / // addition, substraction, multiplication and division at your fingertips...
5050
foo = foo + 5; // increases the variable foo by 5
5151
foo += 5; // a short version of foo = foo + 5;
@@ -58,7 +58,7 @@ Writing JavaScript for Adobe InDesign is quite a different context than Java. In
5858

5959
### Basic program structure
6060

61-
```
61+
```js
6262
// In basil.js
6363

6464
// @includepath "~/Documents/;%USERPROFILE%Documents";
@@ -69,8 +69,9 @@ function setup() {
6969

7070
function draw() {
7171
}
72+
```
7273

73-
74+
```java
7475
// vs. Processing
7576

7677
void setup() {
@@ -86,13 +87,15 @@ void draw() {
8687

8788
### Variables and data types
8889

89-
```
90+
```js
9091
// In basil.js
9192
var myNumber = 5; // Integers...
9293
var myNumber = 3.0; // Floats...
93-
var myString = ”Hello Basil”; / Strings...
94-
var myLove = true; // and Booleans are all stored to the ”var” type
94+
var myString = "Hello Basil"; // Strings...
95+
var myLove = true; // and Booleans are all stored to the "var" type
96+
```
9597

98+
```java
9699
// vs. Processing
97100
int myNumber = 5;
98101
float myNumber = 3.0;
@@ -104,32 +107,35 @@ boolean myLove = true;
104107

105108
### Defining and using functions
106109

107-
```
110+
```js
108111
// In basil.js
109112
function myFunction (param1, param2){
110113
// code within the brackets has access to param1 and param2 and will be executed...
111114
}
112-
myFunction(234, ”Some String”);
115+
myFunction(234, "Some String");
116+
```
113117

118+
```java
114119
// vs. Processing
115-
116120
void myFunction( int param1, String param2 ){
117121
// code within the brackets has access to param1 and param2 and will be executed...
118122
}
119-
myFunction(234, Some String”);
123+
myFunction(234, "Some String");
120124
```
121125

122126
- Functions work quite similar besides the fact that they you do not have to declare any argument or return data types.
123127

124128
### for-loops
125129

126-
```
130+
```js
127131
// In basil.js
128132
for( var i = 0; i < 100; i++ )
129133
{
130134
println( i ); // prints 100 numbers counting upwards
131135
}
136+
```
132137

138+
```java
133139
// vs. Processing
134140
for( int i = 0; i < 100; i++ )
135141
{

0 commit comments

Comments
 (0)