Skip to content

Commit 2a58e21

Browse files
committed
use gdscript2 alias to ensure custom lexer is used
1 parent 5c9f1dd commit 2a58e21

26 files changed

+379
-376
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,34 @@ add the specific word to [abbreviations.md](includes/abbreviations.md)
6969
together allow us to have highlighted code examples for Godot 3 and 4 with an easy toggle.
7070
The tab names need to be consistent across all pages to enable tab state synchronisation.
7171
72+
Note: we use `gdscript2` and `gd2` instead of `gdscript` and `gd` because we've replaced the default gdscript lexer
73+
with our own - and adding a new alias to lex is cleaner than hacking the pygments plugin system to replace the old lexer.
74+
7275
You can simply copy this snippet for that purpose.
7376
```markdown
7477
=== "Godot 4"
7578
76-
```gdscript
79+
```gdscript2
7780
[...]
7881
```
7982
8083
=== "Godot 3"
8184
82-
```gdscript
85+
```gdscript2
8386
[...]
8487
```
8588
```
8689

8790
Code blocks can also highlight single or a range of lines by adding this
88-
`gdscript hl_lines="1 2-5"`
91+
`gdscript2 hl_lines="1 2-5"`
8992

90-
For codeblocks to use proper highlighting, always add the language at the top, usually `gdscript`, as seen above.
93+
For codeblocks to use proper highlighting, always add the language at the top, usually `gdscript2`, as seen above.
9194

9295
Inline code [can also be highlighted](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#highlighting-inline-code-blocks)
93-
by adding `#!` followed by the language - `#!gd print("hello world")`
96+
by adding `#!` followed by the language - `#!gd2 print("hello world")`
9497

95-
While both `gdscript` and `gd` work, the former is preferred for code blocks to be explicit while the latter
96-
is preferred for inline highlights to remain brief.
98+
While both `gdscript2` and `gd2` work, the former is preferred for code blocks to be explicit while the latter
99+
is preferred for inline highlights to remain brief.
97100

98101
## API Docs generation
99102

docs/api/godot_3/mod_loader_config.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This class provides functionality for working with per-mod Configurations.
2121

2222
## Methods
2323
### create_config
24-
```gdscript
24+
```gdscript2
2525
func create_config(mod_id: String, config_name: String, config_data: Dictionary) -> ModConfig
2626
```
2727
Creates a new configuration for a mod.
@@ -36,7 +36,7 @@ Returns:
3636

3737

3838
### update_config
39-
```gdscript
39+
```gdscript2
4040
func update_config(config: ModConfig) -> ModConfig
4141
```
4242
Updates an existing ModConfig object with new data and save the config file.
@@ -49,7 +49,7 @@ Returns:
4949

5050

5151
### delete_config
52-
```gdscript
52+
```gdscript2
5353
func delete_config(config: ModConfig) -> bool
5454
```
5555
Deletes a ModConfig object and performs cleanup operations.
@@ -62,7 +62,7 @@ Returns:
6262

6363

6464
### set_current_config
65-
```gdscript
65+
```gdscript2
6666
func set_current_config(config: ModConfig) -> void
6767
```
6868
Sets the current configuration of a mod to the specified configuration.
@@ -72,7 +72,7 @@ Parameters:
7272

7373

7474
### get_config_schema
75-
```gdscript
75+
```gdscript2
7676
func get_config_schema(mod_id: String) -> Dictionary
7777
```
7878
Returns the schema for the specified mod id. If no configuration file exists for the mod, an empty dictionary is returned.
@@ -85,7 +85,7 @@ Returns:
8585

8686

8787
### get_schema_for_prop
88-
```gdscript
88+
```gdscript2
8989
func get_schema_for_prop(config: ModConfig, prop: String) -> Dictionary
9090
```
9191
Retrieves the schema for a specific property key.
@@ -99,7 +99,7 @@ Returns:
9999

100100

101101
### get_mods_with_config
102-
```gdscript
102+
```gdscript2
103103
func get_mods_with_config() -> Array
104104
```
105105
Retrieves an Array of mods that have configuration files.
@@ -109,7 +109,7 @@ Returns:
109109

110110

111111
### get_configs
112-
```gdscript
112+
```gdscript2
113113
func get_configs(mod_id: String) -> Dictionary
114114
```
115115
Retrieves the configurations dictionary for a given mod ID.
@@ -122,7 +122,7 @@ Returns:
122122

123123

124124
### get_config
125-
```gdscript
125+
```gdscript2
126126
func get_config(mod_id: String, config_name: String) -> ModConfig
127127
```
128128
Retrieves the configuration for a specific mod and configuration name. Returns the configuration as a ModConfig object or null if not found.
@@ -136,7 +136,7 @@ Returns:
136136

137137

138138
### get_default_config
139-
```gdscript
139+
```gdscript2
140140
func get_default_config(mod_id: String) -> ModConfig
141141
```
142142
Retrieves the default configuration for a specified mod ID.
@@ -149,7 +149,7 @@ Returns:
149149

150150

151151
### get_current_config
152-
```gdscript
152+
```gdscript2
153153
func get_current_config(mod_id: String) -> ModConfig
154154
```
155155
Retrieves the currently active configuration for a specific mod
@@ -162,7 +162,7 @@ Returns:
162162

163163

164164
### get_current_config_name
165-
```gdscript
165+
```gdscript2
166166
func get_current_config_name(mod_id: String) -> String
167167
```
168168
Retrieves the name of the current configuration for a specific mod Returns an empty string if no configuration exists for the mod or the user profile has not been loaded
@@ -176,12 +176,12 @@ Returns:
176176

177177
## Constants Descriptions
178178
##### DEFAULT_CONFIG_NAME
179-
```gdscript
179+
```gdscript2
180180
const DEFAULT_CONFIG_NAME: String = "default"
181181
```
182182

183183

184184
##### LOG_NAME
185-
```gdscript
185+
```gdscript2
186186
const LOG_NAME: String = "ModLoader:Config"
187187
```

docs/api/godot_3/mod_loader_deprecated.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This class provides methods for deprecating functions. Can be used by mods with
1010

1111
## Methods
1212
### deprecated_changed
13-
```gdscript
13+
```gdscript2
1414
func deprecated_changed(old_method: String, new_method: String, since_version: String, show_removal_note: bool = true) -> void
1515
```
1616
Marks a method that has changed its name or class.
@@ -23,7 +23,7 @@ Parameters:
2323

2424

2525
### deprecated_removed
26-
```gdscript
26+
```gdscript2
2727
func deprecated_removed(old_method: String, since_version: String, show_removal_note: bool = true) -> void
2828
```
2929
Marks a method that has been entirely removed, with no replacement. Note: This should rarely be needed but is included for completeness.
@@ -35,7 +35,7 @@ Parameters:
3535

3636

3737
### deprecated_message
38-
```gdscript
38+
```gdscript2
3939
func deprecated_message(msg: String, since_version: String = "") -> void
4040
```
4141
Marks a method with a freeform deprecation message.
@@ -47,6 +47,6 @@ Parameters:
4747

4848
## Constants Descriptions
4949
##### LOG_NAME
50-
```gdscript
50+
```gdscript2
5151
const LOG_NAME: String = "ModLoader:Deprecated"
5252
```

0 commit comments

Comments
 (0)