From f7c7fde6a97697b40fa7fc691c4ebd64c24e03ad Mon Sep 17 00:00:00 2001 From: Astrale Date: Tue, 2 Nov 2021 13:15:23 +0100 Subject: [PATCH] Adds a Table of content for src/faq/* using mdbook-toc --- book.toml | 5 +++++ src/faq/code.md | 3 +++ src/faq/community.md | 3 +++ src/faq/configuration.md | 3 +++ src/faq/godot4.md | 3 +++ src/faq/multithreading.md | 3 +++ src/faq/support.md | 3 +++ 7 files changed, 23 insertions(+) diff --git a/book.toml b/book.toml index 2fc4935..50478b0 100644 --- a/book.toml +++ b/book.toml @@ -3,3 +3,8 @@ authors = ["The godot-rust developers"] multilingual = false src = "src" title = "The godot-rust Book" + +[preprocessor.toc] +max-level = 2 +command = "mdbook-toc" +renderer = ["html"] \ No newline at end of file diff --git a/src/faq/code.md b/src/faq/code.md index 09f19ff..db057ad 100644 --- a/src/faq/code.md +++ b/src/faq/code.md @@ -1,5 +1,8 @@ # FAQ: Common code questions +## Table of contents + + ## What is the `BorrowFailed` error and why do I keep getting it? In Rust, [there can only be *one* `&mut` reference to the same memory location at the same time](https://docs.rs/dtolnay/0.0.9/dtolnay/macro._02__reference_types.html). To enforce this while making simple use cases easier, the bindings make use of [interior mutability](https://doc.rust-lang.org/book/ch15-05-interior-mutability.html). This works like a lock: whenever a method with `&mut self` is called, it will try to obtain a lock on the `self` value, and hold it *until it returns*. As a result, if another method that takes `&mut self` is called in the meantime for whatever reason (e.g. signals), the lock will fail and an error (`BorrowFailed`) will be produced. diff --git a/src/faq/community.md b/src/faq/community.md index 291111c..df4e2a7 100644 --- a/src/faq/community.md +++ b/src/faq/community.md @@ -1,5 +1,8 @@ # FAQ: Community +## Table of contents + + ## I need help, where can I ask? The godot-rust project uses several different sources for different kinds of information. diff --git a/src/faq/configuration.md b/src/faq/configuration.md index c3b0fd3..599af90 100644 --- a/src/faq/configuration.md +++ b/src/faq/configuration.md @@ -1,5 +1,8 @@ # FAQ: Configuration +## Table of contents + + ## How do I create the library file for my GDNative binary? You can create .gdnlib files with either of the following methods. diff --git a/src/faq/godot4.md b/src/faq/godot4.md index 78969fc..5d7d944 100644 --- a/src/faq/godot4.md +++ b/src/faq/godot4.md @@ -1,5 +1,8 @@ # FAQ: Godot 4.0 Status +## Table of contents + + ## What is the status of Godot 4 Support? Currently we are still in the planning phase of determining how to support Godot 4.0 and where we will focus our efforts in the future. diff --git a/src/faq/multithreading.md b/src/faq/multithreading.md index 9bd4b18..7f3d7e2 100644 --- a/src/faq/multithreading.md +++ b/src/faq/multithreading.md @@ -1,5 +1,8 @@ # FAQ: Multithreading +## Table of contents + + ## How do I use multithreading? Follow [Godot's thread safety guidelines](https://docs.godotengine.org/en/stable/tutorials/threads/index.html) and change your settings to "Multi-threaded" in "Project Settings > Rendering > Threading". diff --git a/src/faq/support.md b/src/faq/support.md index 1b91a4b..dece93d 100644 --- a/src/faq/support.md +++ b/src/faq/support.md @@ -1,5 +1,8 @@ # FAQ: Versioning and supported platforms +## Table of contents + + ## What does godot-rust's version mean? godot-rust follows [Cargo's semantic versioning](https://doc.rust-lang.org/cargo/reference/semver.html) for the API breaking changes.