Embeddable code editor for python apps
Project description
Cupcake: Embeddable Code Editor
Cupcake is an Embeddable modern-looking code editor for python tkinter applications. It has rich Autocompletions, Minimap and Semantic Syntax highlighting. Cupcake is written in pure python with the tkinter library. It is the code editor which powers Biscuit.
import tkinter as tk
from cupcake import Editor, Languages
root = tk.Tk()
root.minsize(800, 600)
e = Editor(root, language=Languages.TYPESCRIPT)
e.pack(expand=1, fill=tk.BOTH)
e.content.insert("end", """
// check this out
import "./theme.scss";
import "./global.css";
import App from './App.svelte';
const app = new App({
target: document.body
});
export default app;
""")
root.mainloop()
see examples for instructions on Diff viewer, Image viewer and Theming
Syntax Highlighting & Minimap
Auto completions
Installation
Cupcake can be installed by running:
pip install cupcake-editor
Cupcake requires Python 3.10+ to run.
Quick start
Here is a quick example of embedding cupcake in your project:
import tkinter as tk
from cupcake import Editor
root = tk.Tk()
root.minsize(800, 600)
editor = Editor(root)
editor.pack(expand=1, fill=tk.BOTH)
root.mainloop()
Examples!
Examples demonstrating how to use cupcake are in the examples directory. You can learn how to integrate the editor to your app with these. You can run the examples like python -m examples.hello
Features
- Syntax Highlighting (over 500+ languages supported)
- Auto=Completions (words + keywords)
- Auto-Indentation
- Diff Viewer
- Minimap
- Breadcrumbs and Pathview tree
- Image Viewer
- Fully Customizable and Themable
- Language Detection from File Extensions
- Code Folding
Contributing
Your contributions and support are greatly appreciated! 🧡 See contributing for further details such as coding guidelines and tools used.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cupcake_editor-0.25.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99696d5fb858c78dfd477bf318e13464f39f4496836a0587417b03e3f4aa028d |
|
MD5 | 544d0f5e150f4374d3f8689b411591d8 |
|
BLAKE2b-256 | 2e916e68700ec7ced9b4e630f97c54cf81c42846c3131e32ebb1aa4e2c9a4712 |