You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,13 @@ Make sure you've installed [mdBook](https://rust-lang.github.io/mdBook/guide/ins
11
11
12
12
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.
13
13
14
-
To create a new example:
14
+
To create a new example ("Cool feature" in this example):
15
15
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`.
Copy file name to clipboardExpand all lines: src/hello-world/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Hello world
2
2
3
-
[](https://codespaces.new/jcbhmr/cmakebyexample.jcbhmr.com?quickstart=1&devcontainer_path=src%2Fhello-world%2F.devcontainer.json)
3
+
[](https://codespaces.new/jcbhmr/cmakebyexample.jcbhmr.com?quickstart=1&devcontainer_path=.devcontainer%2Fhello-world%2Fdevcontainer.json)
0 commit comments