Skip to content

xibaoer/codapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive code examples

for documentation, education and fun 🎉

Codapi is a platform for embedding interactive code snippets directly into your product documentation, online course or blog post.

┌───────────────────────────────┐
│ def greet(name):              │
│   print(f"Hello, {name}!")    │
│                               │
│ greet("World")                │
└───────────────────────────────┘
  Run ►  Edit  ✓ Done
┌───────────────────────────────┐
│ 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 for easier integration.

Highlights:

  • Automatically converts static code examples into mini-playgrounds.
  • Lightweight and easy to integrate.
  • Sandboxes for any programming language, database, or software.
  • Open source. Uses the permissive Apache-2.0 license.

For an introduction to Codapi, see this post: Interactive code examples for fun and profit.

Installation

See Installing Codapi for details.

Usage

See API to run sandboxed code using the HTTP API.

See codapi-js to embed the JavaScript widget into a web page.

Contributing

Contributions are welcome. For anything other than bugfixes, please first open an issue to discuss what you want to change.

Be sure to add or update tests as appropriate.

Funding

Codapi is mostly a one-man project, not backed by a VC fund or anything.

If you find Codapi useful, please consider sponsoring it on GitHub. It really helps to move the project forward.

Become a sponsor to support Codapi.

Subscribe to stay on top of new features.

About

在线运行代码片段的 Go 服务。该项目提供了一个 API 服务,可以在线运行 Python、TypeScript、C、Go 等 30 种编程语言的代码片段,可用于在文档和教程中展示交互式的代码示例

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 98.8%
  • Makefile 1.1%
  • Dockerfile 0.1%