# Godbolt examples in CMake documentation

**URL:** https://discourse.cmake.org/t/godbolt-examples-in-cmake-documentation/5762
**Category:** Development
**Created:** [May 30, 2022, 6:43pm UTC](https://discourse.cmake.org/t/godbolt-examples-in-cmake-documentation/5762 "2022-05-30T18:43:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![friendlyanon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/friendlyanon/32/970_2.png) [@friendlyanon](https://discourse.cmake.org/u/friendlyanon)
#### Post date: [May 30, 2022, 6:43pm UTC](https://discourse.cmake.org/t/godbolt-examples-in-cmake-documentation/5762/1 "2022-05-30T18:43:13Z")

</div>

The Godbolt compiler explorer has gained an IDE tree ability not that long, which I think could be used to host examples embedded in the CMake documentation. Here is one example: [Compiler Explorer](https://godbolt.org/z/YznfMhnh1)

People often complain about the lack of extensive examples in the CMake docs and I think this would be an ideal way to address that, since people can take these examples and toy with them from the comfort of their browsers.

I haven’t looked at it more closely, but I’m sure there is an API to programmatically create godbolt links with a desired layout.

I’m curious what people’s opinion on this is.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [May 30, 2022, 7:24pm UTC](https://discourse.cmake.org/t/godbolt-examples-in-cmake-documentation/5762/2 "2022-05-30T19:24:59Z")

</div>

I found some elements of an API in [this project](https://github.com/ethanhs/cce/blob/master/src/requests.rs). The docs are [here](https://github.com/compiler-explorer/compiler-explorer/blob/faf6e9dce11b23c7ef997c026f2ab9661e9dda9f/docs/API.md) but they don’t seem to be enough for CMake code and sources to be added.

It seems something that’d be handy to have though.
