Skip to content

Commit 529c4a8

Browse files
committed
Add ability to redirection to other function page
1 parent bb45dcd commit 529c4a8

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed
Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.lower
21
shared:
32
name: utf8.lower
4-
description: Converts a UTF\-8 string to folded case (lowercase), which can be used
5-
to compare two strings. If *input* is an integer, it's treat as a codepoint and
6-
a convert codepoint (integer) is returned.
7-
parameters:
8-
- name: input
9-
type: string|int
10-
description: A string character sequence OR an integer value
11-
examples:
12-
- path: examples/utf8.lower-1.lua
13-
description: This example shows how to convert a string to lowercase, which can
14-
be used to compare with other folded strings.
15-
side: server
16-
returns:
17-
values:
18-
- type: string|int utf8.fold
19-
name: value
20-
description: Returns a string in lowercase OR returns an integer (see description).
21-
notes:
22-
- type: info
23-
content: You may want to read up on case folding for more information about the
24-
use of this function.
25-
requires_review: true
3+
redirect: utf8.fold

schemas/function.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ $defs:
2323
required:
2424
- name
2525
properties:
26+
redirect:
27+
type: string
28+
description: The page to redirect to.
2629
name:
2730
type: string
2831
description: Name of the function.

web/src/pages/reference/[func].astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ const { func } = Astro.props;
3434
func.data.itemType = 'function';
3535
3636
const funcInfo = getFunctionInfo(func.data);
37+
if (funcInfo.redirect)
38+
return Astro.redirect('/reference/' + funcInfo.redirect);
39+
3740
const funcType = funcInfo.type;
3841
const funcPair = funcInfo.pair;
3942
const funcPath = path.dirname(func.filePath ?? "");

web/src/utils/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export type FunctionInfo = {
4242
notes?: NotesType;
4343
version?: VersionInfo;
4444
issues?: IssuesTable;
45+
redirect?: string;
4546
};
4647

4748
export type FunctionData = {

0 commit comments

Comments
 (0)