Skip to content

Commit 7300f56

Browse files
authored
Fix examples REAMDE markdown (#20428)
# Objective - Markdownlint doesn't allow more than 1 h1 heading in a file ## Solution - Add one more level to everything ## Testing N/A
1 parent e259145 commit 7300f56

File tree

2 files changed

+82
-82
lines changed

2 files changed

+82
-82
lines changed

docs-template/EXAMPLE_README.md.tpl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,37 @@ git checkout v0.4.0
5959
- [Optimizing](#optimizing)
6060
- [Loading Assets](#loading-assets)
6161

62-
# The Bare Minimum
62+
## The Bare Minimum
6363

6464
<!-- MD026 - Hello, World! looks better with the ! -->
6565
<!-- markdownlint-disable-next-line MD026 -->
66-
## Hello, World!
66+
### Hello, World!
6767

6868
Example | Description
6969
--- | ---
7070
[`hello_world.rs`](./hello_world.rs) | Runs a minimal example that outputs "hello world"
7171

72-
# Cross-Platform Examples
72+
## Cross-Platform Examples
7373
{% for category, details in all_examples %}
74-
## {{ category }}
74+
### {{ category }}
7575

7676
{% if details.description is string %}{{ details.description }}
7777
{% endif %}Example | Description
7878
--- | ---
7979
{% for example in details.examples %}[{{ example.name }}](../{{ example.path }}) | {{ example.description }}
8080
{% endfor %}{% endfor %}
81-
# Tests
81+
## Tests
8282

8383
Example | Description
8484
--- | ---
8585
[How to Test Apps](../tests/how_to_test_apps.rs) | How to test apps (simple integration testing)
8686
[How to Test Systems](../tests/how_to_test_systems.rs) | How to test systems with commands, queries or resources
8787

88-
# Platform-Specific Examples
88+
## Platform-Specific Examples
8989

90-
## Android
90+
### Android
9191

92-
### Setup
92+
#### Setup
9393

9494
```sh
9595
rustup target add aarch64-linux-android
@@ -102,7 +102,7 @@ When using `NDK (Side by side)`, the environment variable `ANDROID_NDK_ROOT` mus
102102

103103
Alternatively, you can install Android Studio.
104104

105-
### Build & Run
105+
#### Build & Run
106106

107107
To build an Android app, you first need to build shared object files for the target architecture with `cargo-ndk`:
108108

@@ -130,15 +130,15 @@ Or build it with Android Studio.
130130

131131
Then you can test it in your Android project.
132132

133-
#### About `libc++_shared.so`
133+
##### About `libc++_shared.so`
134134

135135
Bevy may require `libc++_shared.so` to run on Android, as it is needed by the `oboe` crate, but typically `cargo-ndk` does not copy this file automatically.
136136

137137
To include it, you can manually obtain it from NDK source or use a `build.rs` script for automation, as described in the `cargo-ndk` [README](https://github.com/bbqsrc/cargo-ndk?tab=readme-ov-file#linking-against-and-copying-libc_sharedso-into-the-relevant-places-in-the-output-directory).
138138

139139
Alternatively, you can modify project files to include it when building an APK. To understand the specific steps taken in this project, please refer to the comments within the project files for detailed instructions(`app/CMakeList.txt`, `app/build.gradle`, `app/src/main/cpp/dummy.cpp`).
140140

141-
### Debugging
141+
#### Debugging
142142

143143
You can view the logs with the following command:
144144

@@ -154,7 +154,7 @@ Sometimes, running the app complains about an unknown activity. This may be fixe
154154
adb uninstall org.bevyengine.example
155155
```
156156

157-
### Old phones
157+
#### Old phones
158158

159159
In its examples, Bevy targets the minimum Android API that Play Store <!-- markdown-link-check-disable -->
160160
[requires](https://developer.android.com/distribute/best-practices/develop/target-sdk) to upload and update apps. <!-- markdown-link-check-enable -->
@@ -168,17 +168,17 @@ bevy = { version = "0.14", default-features = false, features = ["android-native
168168

169169
Then build it as the [Build & Run](#build--run) section stated above.
170170

171-
#### About `cargo-apk`
171+
##### About `cargo-apk`
172172

173173
You can also build an APK with `cargo-apk`, a simpler and deprecated tool which doesn't support `GameActivity`. If you want to use this, there is a [folder](./mobile/android_basic) inside the mobile example with instructions.
174174

175175
Example | File | Description
176176
--- | --- | ---
177177
`android` | [`mobile/src/lib.rs`](./mobile/src/lib.rs) | A 3d Scene with a button and playing sound
178178

179-
## iOS
179+
### iOS
180180

181-
### Setup
181+
#### Setup
182182

183183
You need to install the correct rust targets:
184184

@@ -190,7 +190,7 @@ You need to install the correct rust targets:
190190
rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
191191
```
192192

193-
### Build & Run
193+
#### Build & Run
194194

195195
Using bash:
196196

@@ -220,16 +220,16 @@ Example | File | Description
220220
--- | --- | ---
221221
`ios` | [`mobile/src/lib.rs`](./mobile/src/lib.rs) | A 3d Scene with a button and playing sound
222222

223-
## Wasm
223+
### Wasm
224224

225-
### Setup
225+
#### Setup
226226

227227
```sh
228228
rustup target add wasm32-unknown-unknown
229229
cargo install wasm-bindgen-cli
230230
```
231231

232-
### Build & Run
232+
#### Build & Run
233233

234234
Following is an example for `lighting`. For other examples, change the `lighting` in the
235235
following commands.
@@ -249,17 +249,17 @@ javascript bindings to this wasm file in the output file `examples/wasm/target/w
249249
Then serve `examples/wasm` directory to browser. i.e.
250250

251251
```sh
252-
# cargo install basic-http-server
252+
## cargo install basic-http-server
253253
basic-http-server examples/wasm
254254

255-
# with python
255+
## with python
256256
python3 -m http.server --directory examples/wasm
257257

258-
# with ruby
258+
## with ruby
259259
ruby -run -ehttpd examples/wasm
260260
```
261261

262-
#### WebGL2 and WebGPU
262+
##### WebGL2 and WebGPU
263263

264264
Bevy support for WebGPU is being worked on, but is currently experimental.
265265

@@ -273,13 +273,13 @@ Bevy has a helper to build its examples:
273273

274274
This helper will log the command used to build the examples.
275275

276-
### Audio in the browsers
276+
#### Audio in the browsers
277277

278278
For the moment, everything is single threaded, this can lead to stuttering when playing audio in browsers. Not all browsers react the same way for all games, you will have to experiment for your game.
279279

280280
In browsers, audio is not authorized to start without being triggered by an user interaction. This is to avoid multiple tabs all starting to auto play some sounds. You can find more context and explanation for this on [Google Chrome blog](https://developer.chrome.com/blog/web-audio-autoplay/). This page also describes a JS workaround to resume audio as soon as the user interact with your game.
281281

282-
### Optimizing
282+
#### Optimizing
283283

284284
On the web, it's useful to reduce the size of the files that are distributed.
285285
With rust, there are many ways to improve your executable sizes, starting with
@@ -314,7 +314,7 @@ opt-level = "z" | 6.1M | 12.7M
314314
"z" + "thin" + codegen-units = 1 | 5.3M | 11M
315315
"z" + "fat" + codegen-units = 1 | 4.8M | 8.5M
316316

317-
### Loading Assets
317+
#### Loading Assets
318318

319319
To load assets, they need to be available in the folder examples/wasm/assets. Cloning this
320320
repository will set it up as a symlink on Linux and macOS, but you will need to manually move

0 commit comments

Comments
 (0)