Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tomlin7/cupcake

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.

About

Embeddable feature-rich code editor widget for tkinter, with syntax highlighting, completions, minimap and more

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages