-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathastro.config.mjs
More file actions
160 lines (157 loc) · 5.02 KB
/
astro.config.mjs
File metadata and controls
160 lines (157 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Load custom Sanny Builder language grammar
const sbGrammar = JSON.parse(
readFileSync(join(__dirname, 'sb.tmLanguage.json'), 'utf-8')
);
// https://astro.build/config
export default defineConfig({
site: 'https://tutorial.sannybuilder.com',
integrations: [
starlight({
title: 'Sanny Builder 4 Tutorial',
description: 'Introduction to scripting for Grand Theft Auto: San Andreas using Sanny Builder 4',
logo: {
src: './public/img/sanny.png',
},
favicon: '/img/sanny.png',
social: {
github: 'https://github.com/sannybuilder/tutorial',
discord: 'https://sannybuilder.com/discord',
},
components: {
PageTitle: './src/components/PageTitle.astro',
Footer: './src/components/Footer.astro',
},
tableOfContents: false,
expressiveCode: {
themes: ['dracula', 'solarized-light'],
shiki: {
langs: [
{
// Language identifier
id: 'sb',
// Scope name from the grammar
scopeName: 'source.sb',
// The TextMate grammar
...sbGrammar,
// Language aliases for code blocks
aliases: ['sanny', 'sannybuilder'],
}
],
},
},
customCss: [
'./src/styles/custom.css',
],
sidebar: [
{
label: 'Welcome',
link: '/',
},
{
label: 'Chapter 0: Prerequisites',
collapsed: false,
items: [
{ label: 'Setting up the environment', slug: 'setup' },
{ label: 'CLEO Library', slug: 'cleo-library' },
{ label: 'Compiling scripts with Sanny Builder', slug: 'sanny-builder' },
{ label: 'Stripped main.scm', slug: 'stripped-scm' },
{ label: 'Quiz', slug: 'quiz-ch00' },
],
},
{
label: 'Chapter I: Hello, World!',
collapsed: false,
items: [
{ label: 'Instructions', slug: 'instructions' },
{ label: 'Parameters', slug: 'parameters' },
{ label: 'Numbers', slug: 'numbers' },
{ label: 'Strings', slug: 'strings' },
{ label: 'Comments', slug: 'comments' },
{ label: '$CLEO Directive', slug: 'cleo-directive' },
{ label: 'Hands-on: Showing a Message', slug: 'script-show-message' },
{ label: 'Quiz', slug: 'quiz-ch01' },
],
},
{
label: 'Chapter II: Introducing Loops',
collapsed: true,
items: [
{ label: 'Variables', slug: 'variables' },
{ label: 'WAIT command', slug: 'wait' },
{ label: 'WHILE Loop', slug: 'while' },
{ label: 'Infinite Loop with WHILE TRUE', slug: 'while-true' },
{ label: 'Hands-on: Spawning a Vehicle', slug: 'script-spawn-vehicle' },
{ label: 'Quiz', slug: 'quiz-ch02' },
],
},
{
label: 'Chapter III: To Be Or Not To Be',
collapsed: true,
items: [
{ label: 'Conditions', slug: 'conditions' },
{ label: 'IF..ELSE', slug: 'else' },
{ label: 'Negating Conditions', slug: 'negating-conditions' },
{ label: 'Multiple Conditions', slug: 'multiple-conditions' },
{ label: 'Quiz', slug: 'quiz-ch03' },
],
},
{
label: "Chapter IV: Working with Text",
collapsed: true,
items: [
{label: 'Text Types', slug: 'text-types'},
{label: 'Basic Messages', slug: 'basic-messages'},
{label: 'Formatted Messages', slug: 'formatted-messages'},
{label: 'Text Draws', slug: 'text-draws'},
{label: 'Debug Messages', slug: 'debug-messages'},
{label: 'String Variables', slug: 'string-variables'},
{ label: 'Quiz', slug: 'quiz-ch04' },
]
},
{
label: "Chapter V: Advanced Loops",
collapsed: true,
items: [
{ label: 'Constants', slug: 'constants' },
{ label: 'FOR Loop', slug: 'for-loop' },
{ label: 'REPEAT..UNTIL Loop', slug: 'repeat-until' },
{ label: 'Continue and Break', slug: 'continue-break' },
{ label: 'Hands-on: Bonus Counter', slug: 'script-bonus-counter' },
{ label: 'Quiz', slug: 'quiz-ch05' },
]
},
{
label: "Chapter VI: One Name, Many Values",
collapsed: true,
items: [
{ label: 'Arrays', slug: 'arrays' },
{ label: 'Arrays and Loops', slug: 'arrays-and-loops' },
{ label: 'Spread Operator', slug: 'spread' },
{ label: 'Hands-on: Checkpoint Hunt', slug: 'script-checkpoint-hunt' },
{ label: 'Quiz', slug: 'quiz-ch06' },
]
},
{
label: "Chapter VII: Code Reuse with Functions",
collapsed: true,
items: [
{ label: 'Functions', slug: 'functions' },
{ label: 'Function Scope', slug: 'function-scope' },
{ label: 'Returning Values', slug: 'return-values' },
{ label: 'Logical Functions', slug: 'logical-functions' },
{ label: 'Optional Return', slug: 'optional-return' },
{ label: 'Hands-on: Vehicle Roulette', slug: 'script-vehicle-roulette' },
{ label: 'Quiz', slug: 'quiz-ch07' },
]
}
],
}),
],
});