Skip to content

Commit 6762955

Browse files
authored
Merge pull request #1833 from arturo-lang/website-makeover
Website fixes & tweaks
2 parents b05dd73 + a80ca2e commit 6762955

File tree

31 files changed

+414
-308
lines changed

31 files changed

+414
-308
lines changed

docs/website/pages/documentation/in a nutshell.art

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ So... **With X = Arturo and Y = ~15 minutes**, here you are:
66

77
---
88

9-
```red
9+
```arturo
1010
; this is a comment
1111
; this is another comment
1212

docs/website/pages/documentation/language.art

Lines changed: 226 additions & 135 deletions
Large diffs are not rendered by default.

docs/website/pages/documentation/library/arithmetic/_index.art

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Arithmetic module provides basic mathematical operations that work seamlessl
1515

1616
#### Basic Operations
1717

18-
```red
18+
```arturo
1919
; addition
2020
print 2 + 3 ; 5
2121
print add 2 3 ; 5
@@ -37,7 +37,7 @@ print fdiv 10 3 ; 3.333333333333333
3737

3838
#### Working with Different Types
3939

40-
```red
40+
```arturo
4141
; integer + floating
4242
print 2 + 3.81 ; 5.81
4343

@@ -54,7 +54,7 @@ print a + b ; 5/4
5454

5555
#### In-place Modifications
5656

57-
```red
57+
```arturo
5858
x: 5
5959

6060
; increment
@@ -77,7 +77,7 @@ print x ; 16
7777

7878
#### Division and Remainder
7979

80-
```red
80+
```arturo
8181
; integer division with remainder
8282
[quotient remainder]: divmod 17 5
8383
print ["17 ÷ 5 =" quotient "remainder" remainder]
@@ -89,7 +89,7 @@ print fdiv 17 5 ; 3.4
8989

9090
#### Working with Quantities
9191

92-
```red
92+
```arturo
9393
distance: 100`m ; 100 meters
9494
time: 5`s ; 5 seconds
9595

@@ -99,7 +99,7 @@ print speed ; 20 m/s
9999

100100
#### Type Conversions & Promotions
101101

102-
```red
102+
```arturo
103103
; integer → floating
104104
a: 5 + 3.41 ; 8.41 (floating)
105105
b: 2 * 3.5 ; 7.0 (floating)

docs/website/pages/documentation/library/bitwise/_index.art

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Bitwise module provides functions for bit-level operations on integer values
1414

1515
#### Boolean Operations
1616

17-
```red
17+
```arturo
1818
x: 5 ; binary: 101
1919
y: 3 ; binary: 011
2020

@@ -28,7 +28,7 @@ not x ; => -6 (complement of 101)
2828

2929
#### Advanced Operations
3030

31-
```red
31+
```arturo
3232
a: 12 ; binary: 1100
3333
b: 9 ; binary: 1001
3434

@@ -39,7 +39,7 @@ xnor a b ; => -6
3939

4040
#### Bit Shifting
4141

42-
```red
42+
```arturo
4343
num: 8 ; binary: 1000
4444

4545
; left shift (multiply by 2^n)
@@ -55,7 +55,7 @@ print shr num 1 ; 4 (100)
5555

5656
#### Checking Individual Bits
5757

58-
```red
58+
```arturo
5959
value: 42 ; binary: 101010
6060
mask: shl 1 3 ; binary: 001000
6161

@@ -65,7 +65,7 @@ if and value mask ->
6565

6666
#### Setting and Clearing Bits
6767

68-
```red
68+
```arturo
6969
number: 10 ; binary: 1010
7070
pos: 2
7171

docs/website/pages/documentation/library/collections/_index.art

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The Collections module provides a unified interface for working with different t
1616

1717
#### Creating Collections
1818

19-
```red
19+
```arturo
2020
; blocks (arrays)
2121
numbers: [1 2 3 4 5]
2222
mixed: ["hello" 42 true]
@@ -39,7 +39,7 @@ print @evens ; 2 3 4 5 6 7 8 9 10
3939

4040
#### Basic Operations
4141

42-
```red
42+
```arturo
4343
lst: [1 2 3]
4444

4545
; adding/removing elements
@@ -62,7 +62,7 @@ print lst\2 ; 4
6262

6363
#### Collection Indexing
6464

65-
```red
65+
```arturo
6666
; basic array indexing
6767
colors: ["red" "green" "blue"]
6868
print colors\0 ; red (first element)
@@ -84,12 +84,13 @@ print user\name ; John
8484
; dynamic dictionary field access
8585
field: 'surname ; using a literal
8686
print user\[field] ; Doe
87+
```
8788

8889
> [!NOTE] Indexing with `\` works uniformly across all collection types. Use a block after `\` when you need to evaluate an expression to get the index or field name.
8990

9091
#### Collection Information
9192

92-
```red
93+
```arturo
9394
data: [1 2 2 3 3 3]
9495

9596
size data ; => 6
@@ -102,7 +103,7 @@ index data 3 ; => 2
102103

103104
#### Collection Transformation
104105

105-
```red
106+
```arturo
106107
; flatten nested structure
107108
nested: [[1 2] [3 4] [5 6]]
108109
flat: flatten nested
@@ -118,7 +119,7 @@ print reverse [1 2 3] ; 3 2 1
118119

119120
#### Working with Dictionaries
120121

121-
```red
122+
```arturo
122123
user: #[
123124
name: "John"
124125
age: 30
@@ -140,7 +141,7 @@ print complete
140141

141142
#### Working with Strings
142143

143-
```red
144+
```arturo
144145
text: "Hello 世界" ; unicode string
145146

146147
; strings are like character arrays
@@ -169,7 +170,7 @@ loop text 'c ->
169170

170171
#### Combinations & Permutations
171172

172-
```red
173+
```arturo
173174
items: [1 2 3]
174175

175176
; specific size combinations
@@ -185,7 +186,7 @@ permutate items
185186

186187
#### Efficient Range Operations
187188

188-
```red
189+
```arturo
189190
; create a range of numbers
190191
nums: 1..1000
191192

@@ -201,7 +202,7 @@ nums\42 ; => 42
201202

202203
##### Working with Nested Data
203204

204-
```red
205+
```arturo
205206
users: #[
206207
active: @[
207208
#[name: "John" score: 42 tags: ["admin" "dev"]]
@@ -229,7 +230,7 @@ allTags: unique flatten map users\active 'usr -> usr\tags
229230

230231
##### Managing a Priority Queue
231232

232-
```red
233+
```arturo
233234
tasks: []
234235

235236
; add tasks with priorities

docs/website/pages/documentation/library/colors/_index.art

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Colors module provides comprehensive color handling capabilities. It include
1515

1616
#### Creating Colors
1717

18-
```red
18+
```arturo
1919
; using hex notation
2020
color1: #f00 ; short RGB
2121
color2: #ff0000 ; full RGB
@@ -35,7 +35,7 @@ extract.alpha #ff0000ff ; => 255
3535

3636
#### Color Operations
3737

38-
```red
38+
```arturo
3939
; lighten/darken
4040
dark: darken #red 0.3 ; 30% darker (= #B20000)
4141
light: lighten #emerald 0.2 ; 20% lighter (= #60F090)
@@ -54,7 +54,7 @@ opposite: invert #white ; #black
5454

5555
#### Color Space Conversions
5656

57-
```red
57+
```arturo
5858
col: #magenta ; #FF00FF
5959

6060
; get HSL representation
@@ -70,7 +70,7 @@ newColor: to :color .hsv [300, 1.0 1.0] ; #FF00FF (yep, #magenta!)
7070

7171
#### Color Palettes
7272

73-
```red
73+
```arturo
7474
baseColor: #4169e1 ; royal blue
7575

7676
; generate different palettes
@@ -123,7 +123,7 @@ Here are some of the most commonly used colors organized by hue:
123123

124124
#### Working with Alpha
125125

126-
```red
126+
```arturo
127127
; full opacity
128128
solid: #ff0000ff ; red, 100% opaque
129129

docs/website/pages/documentation/library/comparison/_index.art

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Comparison module provides functions for comparing values of any type. Beyon
1414

1515
#### Simple Comparisons
1616

17-
```red
17+
```arturo
1818
; equality
1919
print 2 = 2 ; true
2020
print "abc" = "abc" ; true
@@ -28,7 +28,7 @@ print 2.0 <> 2 ; false
2828

2929
#### Ordering
3030

31-
```red
31+
```arturo
3232
; less/greater than
3333
print 2 < 3 ; true
3434
print 3 > 2 ; true
@@ -42,7 +42,7 @@ print 3 >= 2 ; true
4242

4343
#### Range Checking
4444

45-
```red
45+
```arturo
4646
; check if value is in range (inclusive)
4747
5 <=> 1 10 ; => true
4848
'm' <=> 'a' 'z' ; => true
@@ -59,7 +59,7 @@ between? 5 1 10 ; => true
5959

6060
The `compare` function returns -1, 0, or 1 and is useful for custom sorting:
6161

62-
```red
62+
```arturo
6363
a: "hello"
6464
b: "world"
6565

@@ -70,7 +70,7 @@ print ["A comes" (result < 0)? -> "before" -> "after" "B"]
7070

7171
#### Identity vs Equality
7272

73-
```red
73+
```arturo
7474
x: 1`N
7575
y: 1`kg.m/s2 ; actually, that's the definition of 1 Newton!
7676

docs/website/pages/documentation/library/core/_index.art

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Core module provides the fundamental building blocks of Arturo: functions fo
1515

1616
#### Variable Assignment
1717

18-
```red
18+
```arturo
1919
; basic assignment
2020
x: 5 ; assign value to symbol
2121
let 'x 5 ; alternative syntax
@@ -28,7 +28,7 @@ let 'x 5 ; alternative syntax
2828

2929
Arturo provides several ways to handle conditional execution:
3030

31-
```red
31+
```arturo
3232
; simple if statement
3333
if x=2 [
3434
print "x is two"
@@ -81,7 +81,7 @@ when.has: x [
8181

8282
#### Function Definition
8383

84-
```red
84+
```arturo
8585
; basic function
8686
sum: function [a b][
8787
a + b
@@ -100,7 +100,7 @@ double: $[x]-> x * 2
100100

101101
Modules are a way of isolating pieces of code so that we can expose only the functions we need, while still safeguarding parts of the internal implementation.
102102

103-
```red
103+
```arturo
104104
; create new module
105105
math: module [
106106
pwr: function [x][
@@ -124,7 +124,7 @@ print calculate 10 ; 100
124124

125125
#### Safe Operations
126126

127-
```red
127+
```arturo
128128
; coalesce operator
129129
value: null
130130
result: value ?? "default" ; use default if null
@@ -141,7 +141,7 @@ counter: 0
141141

142142
#### Loop Control
143143

144-
```red
144+
```arturo
145145
; break from loop
146146
done?: false
147147
while [true][

0 commit comments

Comments
 (0)