Skip to content

jcbhmr/cmakebyexample.jcbhmr.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You're probably looking for cmakebyexample.jcbhmr.com 😉

Development

mdBook CMake

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):

  1. Add it to src/SUMMARY.md like - [Cool feature](cool-feature/README.md).
  2. Create a src/cool-feature/README.md.
  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.
  4. {{#include filename.txt}} any interesting files in src/cool-feature/README.md.
  5. Add any shell commands to interact with the example to the src/cool-feature/README.md. Make sure to document them.
  6. (Optional) Use <!-- cmdrun cmake ... --> or similar inside a ``` code block to run that command and use its output at build time.
  7. Create a corresponding .devcontainer/cool-feature/devcontainer.json that will open the example's folder. Add any necessary dependencies to the dev container.
  8. Add an "Open in Codespaces" button to the src/cool-feature/README.md.

Releases

No releases published

Packages

No packages published

Languages