codapi/README.md

56 lines
2.2 KiB
Markdown
Raw Normal View History

2023-12-17 19:59:53 +00:00
# Interactive code examples
2023-11-24 23:02:45 +00:00
2023-12-17 19:59:53 +00:00
_for documentation, education and fun_ 🎉
2023-11-24 23:02:45 +00:00
2023-12-17 19:59:53 +00:00
Codapi is a platform for embedding interactive code snippets directly into your product documentation, online course or blog post.
2023-11-24 23:02:45 +00:00
```
┌───────────────────────────────┐
2023-12-04 17:35:09 +00:00
│ def greet(name): │
│ print(f"Hello, {name}!") │
2023-11-24 23:02:45 +00:00
│ │
2023-12-04 17:35:09 +00:00
│ greet("World") │
2023-11-24 23:02:45 +00:00
└───────────────────────────────┘
2023-12-04 17:35:09 +00:00
Run ► Edit ✓ Done
2023-11-24 23:02:45 +00:00
┌───────────────────────────────┐
│ Hello, World! │
└───────────────────────────────┘
```
Codapi manages sandboxes (isolated execution environments) and provides an API to execute code in these sandboxes. It also provides a JavaScript widget [codapi-js](https://github.com/nalgeon/codapi-js) for easier integration.
Highlights:
2023-12-17 19:59:53 +00:00
- Automatically converts static code examples into mini-playgrounds.
2023-11-24 23:02:45 +00:00
- Lightweight and easy to integrate.
2023-12-17 19:59:53 +00:00
- Sandboxes for any programming language, database, or software.
- Open source. Uses the permissive Apache-2.0 license.
2023-11-24 23:02:45 +00:00
2023-12-10 21:49:51 +00:00
For an introduction to Codapi, see this post: [Interactive code examples for fun and profit](https://antonz.org/code-examples/).
2023-11-24 23:02:45 +00:00
## Installation
See [Installing Codapi](docs/install.md) for details.
2024-06-12 22:03:31 +00:00
## Usage
2023-11-24 23:02:45 +00:00
2024-06-12 22:03:31 +00:00
See [API](docs/api.md) to run sandboxed code using the HTTP API.
2023-11-24 23:02:45 +00:00
2024-06-12 22:03:31 +00:00
See [codapi-js](https://github.com/nalgeon/codapi-js) to embed the JavaScript widget into a web page.
2023-11-24 23:02:45 +00:00
## Contributing
2023-12-04 17:30:07 +00:00
Contributions are welcome. For anything other than bugfixes, please first open an issue to discuss what you want to change.
2023-11-25 20:44:32 +00:00
Be sure to add or update tests as appropriate.
2023-11-24 23:02:45 +00:00
2024-06-12 22:01:09 +00:00
## Funding
2023-11-24 23:02:45 +00:00
2024-06-12 22:01:09 +00:00
Codapi is mostly a [one-man](https://antonz.org/) project, not backed by a VC fund or anything.
2023-11-24 23:02:45 +00:00
2024-06-12 22:01:09 +00:00
If you find Codapi useful, please consider sponsoring it on GitHub. It really helps to move the project forward.
2023-11-24 23:02:45 +00:00
2024-06-12 22:01:09 +00:00
♥ [Become a sponsor](https://github.com/sponsors/nalgeon) to support Codapi.
2023-11-24 23:02:45 +00:00
2023-12-01 05:21:35 +00:00
★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features.