Skip to content

Commit 18f6d36

Browse files
authored
save
1 parent 893442e commit 18f6d36

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ Make sure you've installed [mdBook](https://rust-lang.github.io/mdBook/guide/ins
1111

1212
The custom `theme/highlight.js` is needed because the default mdBook `highlight.js` doesn't include the `cmake` language. The current custom build includes [all of the mdBook defaults](https://rust-lang.github.io/mdBook/format/theme/syntax-highlighting.html#supported-languages) plus `cmake`. Generate it using https://highlightjs.org/download and use the `./highlight.min.js` file from the resulting `.zip` download.
1313

14-
To create a new example:
14+
To create a new example ("Cool feature" in this example):
1515

16-
1. Come up with a slug like `cool-feature`.
17-
2. Add it to `src/SUMMARY.md` like `- [Cool feature](cool-feature/index.md)`.
18-
3. Create a new folder to hold the example like `src/cool-feature`.
19-
4. Add a `README.md` to the new folder.
20-
5. Create your example. Take note of any dependencies it needs (Clang, clang-format, Vcpkg, Conan, etc.).
21-
6. Add a lot of comments to your code files to explain what's going on. The `README.md` is for shell commands. The code files are for other prose.
22-
7. `{{#include filename.txt}}` any relevant files in the `src/cool-feature/README.md` inside `` ``` `` code blocks.
23-
8. Add any shell commands to interact with the example to the `src/cool-feature/README.md`. Make sure to document them.
24-
9. (Optional) Use `<!-- cmdrun cmake ... -->` or similar inside a `` ``` `` code block to run that command and use its output at build time.
25-
10. Create a corresponding `.devcontainer/cool-feature/devcontainer.json` that will open the example's folder. Add any necessary dependencies to the dev container.
26-
11. Add an "Open in Codespaces" button to the `src/cool-feature/README.md`.
16+
1. Add it to `src/SUMMARY.md` like `- [Cool feature](cool-feature/README.md)`.
17+
2. Create a `src/cool-feature/README.md`.
18+
3. Create your example in `src/cool-feature/`. Add a bunch of comments _in the code files_ so that they are visible on the website and when viewing the file in an IDE.
19+
4. `{{#include filename.txt}}` any interesting files in `src/cool-feature/README.md`.
20+
5. Add any shell commands to interact with the example to the `src/cool-feature/README.md`. Make sure to document them.
21+
6. (Optional) Use `<!-- cmdrun cmake ... -->` or similar inside a `` ``` `` code block to run that command and use its output at build time.
22+
7. Create a corresponding `.devcontainer/cool-feature/devcontainer.json` that will open the example's folder. Add any necessary dependencies to the dev container.
23+
8. Add an "Open in Codespaces" button to the `src/cool-feature/README.md`.

src/hello-world/.devcontainer.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/hello-world/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hello world
22

3-
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/jcbhmr/cmakebyexample.jcbhmr.com?quickstart=1&devcontainer_path=src%2Fhello-world%2F.devcontainer.json)
3+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/jcbhmr/cmakebyexample.jcbhmr.com?quickstart=1&devcontainer_path=.devcontainer%2Fhello-world%2Fdevcontainer.json)
44

55
```c
66
{{#include main.c}}

0 commit comments

Comments
 (0)