Skip to content

Commit ffd6637

Browse files
⚠️ Revamp links ⚠️
1 parent 8ed3fb5 commit ffd6637

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+222
-208
lines changed

elements/Matrix/Matrix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'matrix'
22
description: |
3-
Matrices are one of the most powerful features of MTA [OOP](/OOP_Introduction). We did have a presence of Matrices before with [getElementMatrix](/getElementMatrix), but we were given an ugly disgusting table to play with. Now, with the new Matrix class, we can make and magically manipulate Matrices.
3+
Matrices are one of the most powerful features of MTA [OOP](/reference/OOP). We did have a presence of Matrices before with [getElementMatrix](/getElementMatrix), but we were given an ugly disgusting table to play with. Now, with the new Matrix class, we can make and magically manipulate Matrices.
44
55
oop_only_methods:
66
- name: create

elements/Server/console.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ description: |
99
preview_images:
1010
- path: 'server_console_help.jpg'
1111
description: 'Help output inside server console:'
12-
13-
# see_also:
14-
# - 'article:Server_Commands'

elements/Vector/Vector2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'vector2'
22
description: |
3-
This is a 2D [Vector](/Vector) class.
3+
This is a 2D [Vector](/reference/Vector) class.
44
oop_only_methods:
55
- name: create
66
description: |

elements/Vector/Vector3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Vector3
22
type: class
33
description: |
4-
Represents a 3D [Vector](/Vector). Used for storing and manipulating three-dimensional coordinates (x, y, z).
4+
Represents a 3D [Vector](/reference/Vector). Used for storing and manipulating three-dimensional coordinates (x, y, z).
55
oop_only_methods:
66
- name: create
77
description: |

elements/Vector/Vector4.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Vector4
22
type: class
33
description: |
4-
Represents a 4D [Vector](/Vector).
4+
Represents a 4D [Vector](/reference/Vector).
55
oop_only_methods:
66
- name: create
77
description: |

functions/File/fileCopy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ shared: &shared
33
notes:
44
- type: 'tip'
55
content: |
6-
If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [[filepath]] for more information).
6+
If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [Filepath](/reference/Filepath) for more information).
77
oop:
88
element: file
99
static: true

functions/File/fileCreate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ shared: &shared
66
To prevent memory leaks, ensure each successful call to [[fileCreate]] has a matching call to [[fileClose]].
77
- type: 'tip'
88
content: |
9-
If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [[filepath]] for more information).
9+
If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [Filepath](/reference/Filepath) for more information).
1010
- type: 'important'
1111
content: |
1212
It is important to remember to close a file after you've finished all your operations on it, especially if you've been writing to the file. If you don't close a file and your resource crashes, all changes to the file may be lost.

functions/File/fileDelete.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ shared: &shared
99
- name: 'filePath'
1010
type: 'string'
1111
description: |
12-
The [filepath](/filepath) of the file to delete in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.
12+
The [Filepath](/reference/Filepath) of the file to delete in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.
1313
For example, if you want to delete a file name "myFile.txt" in the resource 'fileres', it can be deleted from another resource this way: `fileDelete(":fileres/myFile.txt")`.
1414
If the file is in the current resource, only the file path is necessary, e.g. `fileDelete("myFile.txt")`.
1515
returns:

functions/File/fileExists.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ shared: &shared
99
- name: 'filePath'
1010
type: 'string'
1111
description: |
12-
The [filepath](/filepath) of the file, whose existence is going to be checked, in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is checked to be in, and 'path' is the path from the root directory of the resource to the file.
12+
The [Filepath](/reference/Filepath) of the file, whose existence is going to be checked, in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is checked to be in, and 'path' is the path from the root directory of the resource to the file.
1313
For example, if you want to check whether a file named 'myfile.txt' exists in the resource 'mapcreator', it can be done from another resource this way: `fileExists(":mapcreator/myfile.txt")`.
1414
If the file, whose existence is going to be checked, is in the current resource, only the file path is necessary, e.g. `fileExists("myfile.txt")`. Note that you must use forward slashes '/' for the folders, backslashes '\' will return false.
1515
returns:

functions/File/fileOpen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ shared: &shared
1111
- name: 'filePath'
1212
type: 'string'
1313
description: |
14-
The [filepath](/filepath) of the file in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.
14+
The [Filepath](/reference/Filepath) of the file in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.
1515
For example, if there is a file named `coolObjects.txt` in the resource `objectSearch`, it can be opened from another resource this way: `fileOpen(":objectSearch/coolObjects.txt")`.
1616
If the file is in the current resource, only the file path is necessary, e.g. `fileOpen("coolObjects.txt")`.
1717
- name: 'readOnly'

functions/File/fileRename.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ shared: &shared
1515
The filepath of the source file in the following format: `:resourceName/path`. `resourceName` is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file. If the file is in the current resource, only the file path is necessary.
1616
- name: 'newFilePath'
1717
type: 'string'
18-
description: Destination [filepath](/filepath) for the specified source file in the same format.
18+
description: Destination [Filepath](/reference/Filepath) for the specified source file in the same format.
1919
returns:
2020
description: If successful, returns true. Otherwise returns false.
2121
values:

functions/XML/xmlCreateFile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ shared: &shared
66
To prevent memory leaks, ensure each call to **xmlCreateFile** has a matching call to [xmlUnloadFile](/xmlUnloadFile).
77
- type: 'tip'
88
content: |
9-
If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [filepath](/filepath) for more information).
9+
If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [Filepath](/reference/Filepath) for more information).
1010
oop:
1111
element: xmlnode
1212
constructorclass: XML
@@ -16,7 +16,7 @@ shared: &shared
1616
- name: 'filePath'
1717
type: 'string'
1818
description: |
19-
The [filepath](/filepath) of the file in the following format: **":resourceName/path"**. *resourceName* is the name of the resource the file will be in, and *path* is the path from the root directory of the resource to the file. For example, if you want to create a file named *new.xml* in the resource *ctf*, it can be created from another resource this way [xmlCreateFile](/xmlCreateFile)(":ctf/new.xml", "newroot"). If the file is in the current resource, only the file path is necessary, e.g. [xmlCreateFile](/xmlCreateFile)("new.xml", "newroot"). Note that if a different resource than default is being accessed, the caller resource needs access to **general.ModifyOtherObjects** in the [ACL](/ACL).
19+
The [Filepath](/reference/Filepath) of the file in the following format: **":resourceName/path"**. *resourceName* is the name of the resource the file will be in, and *path* is the path from the root directory of the resource to the file. For example, if you want to create a file named *new.xml* in the resource *ctf*, it can be created from another resource this way [xmlCreateFile](/xmlCreateFile)(":ctf/new.xml", "newroot"). If the file is in the current resource, only the file path is necessary, e.g. [xmlCreateFile](/xmlCreateFile)("new.xml", "newroot"). Note that if a different resource than default is being accessed, the caller resource needs access to **general.ModifyOtherObjects** in the [ACL](/ACL).
2020
- name: 'rootNodeName'
2121
type: 'string'
2222
description: 'The name of the root node in the XML document.'

functions/XML/xmlLoadFile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ shared: &shared
1010
- name: 'filePath'
1111
type: 'string'
1212
description: |
13-
The [filepath](/filepath) of the file in the following format: **":resourceName/path"**. *resourceName* is the name of the resource the file will be in, and *path* is the path from the root directory of the resource to the file. For example, if you want to create a file named *new.xml* in the resource *ctf*, it can be created from another resource this way [xmlCreateFile](/xmlCreateFile)(":ctf/new.xml", "newroot"). If the file is in the current resource, only the file path is necessary, e.g. [xmlCreateFile](/xmlCreateFile)("new.xml", "newroot"). Note that if a different resource than default is being accessed, the caller resource needs access to **general.ModifyOtherObjects** in the [ACL](/ACL).
13+
The [Filepath](/reference/Filepath) of the file in the following format: **":resourceName/path"**. *resourceName* is the name of the resource the file will be in, and *path* is the path from the root directory of the resource to the file. For example, if you want to create a file named *new.xml* in the resource *ctf*, it can be created from another resource this way [xmlCreateFile](/xmlCreateFile)(":ctf/new.xml", "newroot"). If the file is in the current resource, only the file path is necessary, e.g. [xmlCreateFile](/xmlCreateFile)("new.xml", "newroot"). Note that if a different resource than default is being accessed, the caller resource needs access to **general.ModifyOtherObjects** in the [ACL](/ACL).
1414
- name: 'readOnly'
1515
type: 'boolean'
1616
default: 'false'

web/astro.config.mjs

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,46 +43,54 @@ export default defineConfig({
4343
label: 'Introduction', link: '/',
4444
},
4545
{
46-
label: 'How you can help', link: '/How_you_can_help',
46+
label: 'How you can help', link: '/articles/How_you_can_help',
47+
},
48+
]
49+
},
50+
{
51+
label: 'Tutorials',
52+
items: [
53+
{
54+
label: 'Scripting Introduction', link: '/articles/Scripting_Introduction',
4755
},
4856
]
4957
},
5058
{
5159
label: 'Reference',
5260
items: [
5361
{
54-
label: 'Lua API', link: 'Lua_API',
62+
label: 'Lua API', link: '/reference/Lua_API',
5563
},
5664
{
5765
label: 'Functions',
5866
items: [
59-
{label: 'All functions', link: 'Scripting_Functions'},
60-
{label: 'Shared functions', link: 'Shared_Scripting_Functions'},
61-
{label: 'Client functions', link: 'Client_Scripting_Functions'},
62-
{label: 'Server functions', link: 'Server_Scripting_Functions'},
67+
{label: 'All functions', link: '/reference/Scripting_Functions'},
68+
{label: 'Shared functions', link: '/reference/Shared_Scripting_Functions'},
69+
{label: 'Client functions', link: '/reference/Client_Scripting_Functions'},
70+
{label: 'Server functions', link: '/reference/Server_Scripting_Functions'},
6371
]
6472
},
6573
{
6674
label: 'Events',
6775
items: [
68-
{label: 'All events', link: 'Scripting_Events'},
69-
{label: 'Client events', link: 'Client_Scripting_Events'},
70-
{label: 'Server events', link: 'Server_Scripting_Events'},
76+
{label: 'All events', link: '/reference/Scripting_Events'},
77+
{label: 'Client events', link: '/reference/Client_Scripting_Events'},
78+
{label: 'Server events', link: '/reference/Server_Scripting_Events'},
7179
]
7280
},
7381
{
7482
label: 'Elements',
7583
items: [
76-
{label: 'Element types', link: 'Element'},
77-
{label: 'Element tree', link: 'Element_tree'},
78-
{label: 'Entity', link: 'Entity'},
84+
{label: 'Element types', link: '/reference/Element'},
85+
{label: 'Element tree', link: '/reference/Element_tree'},
86+
{label: 'Entity', link: '/reference/Entity'},
7987
]
8088
},
8189
{
8290
label: 'OOP',
8391
items: [
84-
{label: 'About OOP', link: 'OOP_Introduction'},
85-
{label: 'OOP Classes', link: 'OOP_Classes'},
92+
{label: 'About OOP', link: '/reference/OOP'},
93+
{label: 'OOP Classes', link: '/reference/OOP_Classes'},
8694
]
8795
},
8896
]

web/public/_redirects

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
# Rewrite /wiki
21
/wiki /
32
/wiki/* /:splat
4-
5-
# Aliases for specific pages
63
/Main_Page /
7-
/bool /boolean
8-
/element /Element
9-
/MTA_Classes /Element
10-
/Element/:elementname /:elementname
11-
/Vector/:vectorclass /:vectorclass
12-
/OOP /OOP_Introduction
4+
5+
# Fallbacks
6+
/* /articles/:splat 200
7+
/* /reference/:splat 200

web/src/components/CategoryList.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ function displayItem(item: any) {
8888
switch (what) {
8989
case 'all_functions':
9090
const funcInfo = getFunctionInfo(item.data);
91-
return `<a href=/${item.id}>${item.id}</a>
91+
return `<a href=/reference/${item.id}>${item.id}</a>
9292
(<span class=${"side-"+funcInfo.type}>${funcInfo.typePretty}</span>)`;
9393
case 'all_events':
94-
return `<a href=/${item.id}>${item.id}</a>
94+
return `<a href=/reference/${item.id}>${item.id}</a>
9595
(<span class=${"side-"+item.data.type}>${getEventTypePretty(item.data.type)}-side</span>)`;
9696
case 'client_functions':
9797
case 'server_functions':
9898
case 'shared_functions':
9999
case 'client_events':
100100
case 'server_events':
101-
return `<a href=/${item.id}>${item.id}</a>`;
101+
return `<a href=/reference/${item.id}>${item.id}</a>`;
102102
}
103103
return '?';
104104
}

web/src/components/CodeExamplesSection.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if (codeExamples.length === 0 && !examplesRequired) {
5959
<strong>{example.side}</strong> {example.title && ` - ${example.title}`}
6060
{example.oop && (
6161
<div class="oop-indicator">
62-
<a href="/OOP_Introduction">OOP</a> Required
62+
<a href="/reference/OOP">OOP</a> Required
6363
</div>
6464
)}
6565
</div>

web/src/components/ElementOOPInfo.astro

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,27 @@ export interface Props {
99
}
1010
1111
const { element_name = null, oop_only_methods, oop_compatible_functions } = Astro.props;
12-
1312
let oop_constructor = oop_compatible_functions.find(func => func.oop.constructorclass);
1413
---
1514
{element_name && oop_constructor && (
1615
<section class="oop-constructor-section">
17-
<h4><a href="/OOP_Introduction">OOP</a> Constructor</h4>
16+
<h4><a href="/reference/OOP">OOP</a> Constructor</h4>
1817
<p>
19-
{oop_constructor.oop.constructorclass}(...) is the constructor method for the <code>{element_name}</code> class (<a href={oop_constructor.link}>{oop_constructor.name}</a>).
18+
{oop_constructor.oop.constructorclass}(...) is the constructor method for the <code>{element_name}</code> class (<a href={"/reference/"+oop_constructor.id}>{oop_constructor.id}</a>).
2019
</p>
2120
</section>
2221
)}
2322

2423
{oop_compatible_functions.length > 0 && (
2524
<section class="oop-compatible-functions-section">
26-
<h4><a href="/OOP_Introduction">OOP</a> Methods and Variables</h4>
25+
<h4><a href="/reference/OOP">OOP</a> Methods and Variables</h4>
2726
<ul>
2827
{oop_compatible_functions.map((funcInfo: any) => (
2928
funcInfo.oop.constructorclass ? null : (
3029
<li>
3130
{funcInfo.oop.method && (
3231
<span style="margin-right: 10px;">
33-
{funcInfo.oop.static ? getFixedStaticOOPClass(funcInfo.oop.element) : funcInfo.oop.element}{funcInfo.oop.static ? '.' : ':'}<a href={funcInfo.link} title={funcInfo.name}>{funcInfo.oop.method}</a>(...)
32+
{funcInfo.oop.static ? getFixedStaticOOPClass(funcInfo.oop.element) : funcInfo.oop.element}{funcInfo.oop.static ? '.' : ':'}<a href={"/reference/"+funcInfo.id} title={funcInfo.id}>{funcInfo.oop.method}</a>(...)
3433
</span>
3534
)}
3635

@@ -50,7 +49,7 @@ let oop_constructor = oop_compatible_functions.find(func => func.oop.constructor
5049

5150
{oop_only_methods.length > 0 && (
5251
<section class="oop-methods-section">
53-
<h4><a href="/OOP_Introduction">OOP</a>-Only Methods</h4>
52+
<h4><a href="/reference/OOP">OOP</a>-Only Methods</h4>
5453

5554
{oop_only_methods.map((method: any) => (
5655
<>

web/src/components/EnhancedMarkdown.astro

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ interface Props {
88
99
const { content } = Astro.props;
1010
11-
function convertMediaWikiLinks(text: string): string {
12-
return text.replace(
13-
/\[\[([^|\]#]+)(?:#([^\]]+))?(?:\|([^\]]+))?\]\]/g,
14-
(_, link, hash, text) => {
15-
const url = `/${link}${hash ? `#${hash}` : ''}`;
16-
return `[${text || link}](${url})`;
17-
}
18-
);
19-
}
2011
21-
const processedContent = convertMediaWikiLinks(content);
22-
const tokens = marked.lexer(processedContent);
12+
// We can't do this as we're now organizing pages in folders
13+
14+
// function convertMediaWikiLinks(text: string): string {
15+
// return text.replace(
16+
// /\[\[([^|\]#]+)(?:#([^\]]+))?(?:\|([^\]]+))?\]\]/g,
17+
// (_, link, hash, text) => {
18+
// const url = `/${link}${hash ? `#${hash}` : ''}`;
19+
// return `[${text || link}](${url})`;
20+
// }
21+
// );
22+
// }
23+
24+
// const processedContent = convertMediaWikiLinks(content);
25+
// const tokens = marked.lexer(processedContent);
26+
27+
const tokens = marked.lexer(content);
2328
---
2429

2530
{

web/src/overrides/Pagination.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ import IconLinkCard from '@src/components/IconLinkCard.astro';
1010
title="Functions"
1111
titleColor="#ca6c26"
1212
description="List of all client-side, server-side and shared functions"
13-
href="/Scripting_Functions" />
13+
href="/reference/Scripting_Functions" />
1414

1515
<IconLinkCard
1616
icon="seti:purescript"
1717
iconColor="#ca6c26"
1818
title="Events"
1919
titleColor="#ca6c26"
2020
description="List of all client-side and server-side events"
21-
href="/Scripting_Events" />
21+
href="/reference/Scripting_Events" />
2222

2323
<IconLinkCard
2424
icon="seti:plan"
2525
iconColor="#ca6c26"
2626
title="Elements"
2727
titleColor="#ca6c26"
2828
description="List of all element types and their properties"
29-
href="/Element" />
29+
href="/reference/Element" />
3030

3131
<IconLinkCard
3232
icon="seti:hex"
3333
iconColor="#ca6c26"
3434
title="OOP"
3535
titleColor="#ca6c26"
3636
description="Information about MTA object-oriented programming"
37-
href="/OOP_Introduction" />
37+
href="/reference/OOP" />
3838

3939
</CardGrid>
4040

web/src/pages/Incomplete_Pages.astro

Whitespace-only changes.

web/src/pages/How_you_can_help.astro renamed to web/src/pages/articles/How_you_can_help.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { MTA_CURRENT_VERSION } from '@src/content.constants';
2727
<li>Become a contributor to MTA's official resources, read more about them here: <a href="/Default_resources">Default resources</a></li>
2828
<li>Create and <a href="https://community.multitheftauto.com/">publish</a> a gamemode or useful script
2929
<ul>
30-
<li><a href="/Scripting_Introduction">Scripting Introduction</a></li>
30+
<li><a href="/articles/Scripting_Introduction">Scripting Introduction</a></li>
3131
<li><a href="https://www.lua.org/pil/index.html">"Programming in Lua" Manual</a></li>
3232
</ul>
3333
</li>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
---
4+
5+
<StarlightPage frontmatter={{
6+
template: 'doc',
7+
title: 'Scripting Introduction',
8+
tableOfContents: false,
9+
}}>
10+
11+
TODO
12+
13+
</StarlightPage>

0 commit comments

Comments
 (0)