website icon indicating copy to clipboard operation
website copied to clipboard

Interactive Caddy examples

Open nalgeon opened this issue 11 months ago • 4 comments

Hi Matt! Thank you for this awesome project! And special thanks for writing great documentation, it's one of the best I've ever seen.

I think Caddy docs would be even better if the examples were interactive, so people could change the config files and curl commands, and see it reflected in the responses. Here is an example based on the Getting Started guide: https://codapi.org/try/caddy (source).

You might also be interested in a standalone Caddy playground like this one: https://codapi.org/caddy

The interactive snippets are powered by Codapi, an open source tool for creating interactive technical documentation (disclaimer: I'm the author). The Caddy sandbox is implemented as short-lived, restricted containers that are created for each request with a given configuration and destroyed immediately afterwards.

If you're interested, I'll be happy to send you a PR to backport this into the docs.

nalgeon avatar Mar 03 '24 19:03 nalgeon

In 2022, I led a Writing a Caddy Module workshop for Gophercon EU 2022. The content was deployed as a Hugo generated website. I wished there was a way to make it interactive. If you remember, there was a website called KataCoda, which was bought out by O'Reilly and wished it was around to embed its environment into the workshop's website.

I wished our docs were interactive, which could be thanks to your work! I also wish we could extend the workshop to be interactive. The workshop requires the Go compiler and shell access. Could your project help there as well?

mohammed90 avatar Mar 03 '24 19:03 mohammed90

Thank you for your interest, Mohammed! Regarding the workshop — it depends on how you see it. Technically, Codapi can provide you with a Go compiler and shell access.

But it is not a full-featured online development environment or IDE like GitHub Codespaces, and it does not try to be. The sole focus of Codapi is to provide a great user experience for interactive snippets in documentation, online courses, product demos, etc.

To better understand its approach, please check out the Showcase.

nalgeon avatar Mar 04 '24 08:03 nalgeon

@nalgeon We'd be interested in integrating something like this into our docs :) Could we invite you to our Slack? What email address should I use?

mholt avatar Mar 05 '24 19:03 mholt

This is great! Please use [email protected]

nalgeon avatar Mar 05 '24 20:03 nalgeon