You're probably looking for cmakebyexample.jcbhmr.com 😉
Make sure you've installed mdBook and CMake. You'll also need to install mdbook-cmdrun. Run mdbook serve
to see the live preview.
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 plus cmake
. Generate it using https://highlightjs.org/download and use the ./highlight.min.js
file from the resulting .zip
download.
To create a new example ("Cool feature" in this example):
- Add it to
src/SUMMARY.md
like- [Cool feature](cool-feature/README.md)
. - Create a
src/cool-feature/README.md
. - 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. {{#include filename.txt}}
any interesting files insrc/cool-feature/README.md
.- Add any shell commands to interact with the example to the
src/cool-feature/README.md
. Make sure to document them. - (Optional) Use
<!-- cmdrun cmake ... -->
or similar inside a```
code block to run that command and use its output at build time. - Create a corresponding
.devcontainer/cool-feature/devcontainer.json
that will open the example's folder. Add any necessary dependencies to the dev container. - Add an "Open in Codespaces" button to the
src/cool-feature/README.md
.