Skip to content

Commit a56e378

Browse files
rewrite configuration_file-format.md
1 parent ce019a1 commit a56e378

File tree

2 files changed

+57
-16
lines changed

2 files changed

+57
-16
lines changed

configuration_file-format.md

+55-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,46 @@
1-
`gdnative-doc` allows for an optional `toml` configuration file. The current valid entries are :
1+
# Configuration file
22

3-
- `url_overrides: HashMap<String, String>`:
4-
List of items for which the linking url should be overriden.
5-
- `rename_classes: HashMap<String, String>`:
6-
Renaming of types when going from Rust to Godot.
3+
The behaviour of `gdnative-doc` can be configured via a [toml configuration file](https://toml.io/en/).
74

8-
This is useful because GDNative allows defining a `script_class_name` in the
9-
`.gdns` file.
5+
The current options are:
106

11-
- `markdown_options: Vec<String>`:
12-
Optional markdown options.
7+
- ## url_overrides
138

14-
### Valid options
9+
Here you can specify a list of items for which the linking url should be overriden.
10+
11+
### Example
12+
13+
```toml
14+
# link `bool` to the latest documentation instead of stable.
15+
url_overrides = { bool = "https://docs.godotengine.org/en/latest/classes/class_bool.html" }
16+
```
17+
18+
- ## rename_classes
19+
20+
Here you can a list of structures that will be renamed.
21+
22+
This is useful because GDNative allows defining a `script_class_name` in the `.gdns` file.
23+
24+
### Example
25+
26+
```rust
27+
// in lib.rs
28+
29+
#[derive(NativeClass)]
30+
#[inherit(Reference)]
31+
/// My Rust interface
32+
pub struct RustStructure {}
33+
```
34+
35+
```toml
36+
rename_classes = { RustStructure = "GodotClass" }
37+
```
38+
39+
- ## markdown_options
40+
41+
List of optional markdown options.
42+
43+
- ### Valid options
1544

1645
- FOOTNOTES
1746
- SMART_PUNCTUATION
@@ -23,12 +52,24 @@
2352

2453
No option enabled.
2554

26-
- `opening_comment: bool`:
27-
Control whether or not to include commentary in the generated files.
55+
### Example
56+
57+
```toml
58+
markdown_options = ["STRIKETHROUGH", "TABLES", "TASKLISTS"]
59+
```
2860

29-
The commentary includes information such that the file was automatically
30-
generated, the name of the source file it originated from...
61+
- ## opening_comment
62+
63+
Boolean that control whether or not to include a comment in the generated files.
64+
65+
The comment includes information such that the file was automatically generated, the name of the source file it originated from...
3166

3267
### Default
3368

3469
`true`
70+
71+
### Example
72+
73+
```toml
74+
opening_comment = false
75+
```

src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ pub struct ConfigFile {
5252
/// # Default
5353
/// No option enabled.
5454
pub markdown_options: Option<Vec<String>>,
55-
/// Control whether or not to include commentary in the generated files.
55+
/// Control whether or not to include a comment in the generated files.
5656
///
57-
/// The commentary includes information such that the file was automatically
57+
/// The comment includes information such that the file was automatically
5858
/// generated, the name of the source file it originated from...
5959
///
6060
/// # Default

0 commit comments

Comments
 (0)