Skip to content

Commit

Permalink
Adds a Table of content for src/faq/* using mdbook-toc
Browse files Browse the repository at this point in the history
  • Loading branch information
Astrale authored and jacobsky committed Nov 3, 2021
1 parent 2345ac2 commit cf23769
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ An online version of the book is available at [godot-rust.github.io/book/](https
The book is built with [mdBook](https://github.com/rust-lang-nursery/mdBook). To build the book locally, you can run:

```
$ cargo install mdbook
$ cargo install mdbook mdbook-toc
$ mdbook build
```

Expand Down
5 changes: 5 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions src/faq/code.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Common code questions

## Table of contents
<!-- toc -->

## 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.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/community.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Community

## Table of contents
<!-- toc -->

## I need help, where can I ask?

The godot-rust project uses several different sources for different kinds of information.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Configuration

## Table of contents
<!-- toc -->

## How do I create the library file for my GDNative binary?

You can create .gdnlib files with either of the following methods.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/godot4.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Godot 4.0 Status

## Table of contents
<!-- toc -->

## 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.
Expand Down
3 changes: 3 additions & 0 deletions src/faq/multithreading.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Multithreading

## Table of contents
<!-- toc -->

## 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".
Expand Down
3 changes: 3 additions & 0 deletions src/faq/support.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# FAQ: Versioning and supported platforms

## Table of contents
<!-- toc -->

## 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.
Expand Down

0 comments on commit cf23769

Please sign in to comment.