Skip to main content

Markdown Renderer for customtkinter

Project description

ctk-markdown

python customtkinter status PyPI - License

ctk-markdown is a CustomTkinter Markdown renderer based on CTkTextbox. It applies rich tags for headings, lists, tables, code blocks, and inline formatting.

✨ Features

  • Single widget (CTkMarkdown) with Markdown rendering
  • Headings, lists, blockquotes, tables, and code blocks
  • Basic syntax highlighting for Python and JavaScript
  • Clickable external links (opens in default browser)
  • Internal anchor navigation (click a link to scroll to a specific section heading)
  • Copy button for code blocks
  • Theme-aware colors and responsive tables for light and dark appearance modes

📦 Installation

pip install ctk-markdown

🚀 Usage

from ctk_markdown import CTkMarkdown
import customtkinter as ctk

app = ctk.CTk()
frame = ctk.CTkFrame(app)
frame.pack(fill="both", expand=True, padx=16, pady=16)

renderer = CTkMarkdown(frame)
renderer.pack(fill="both", expand=True)
renderer.set_markdown("""# Title\nText with *italic* and **bold**.""")

app.mainloop()

🧠 How it works

The widget inherits from CTkTextbox. Markdown parsing is done line by line and uses Tkinter text tags for styling. Theme colors are applied based on the current CustomTkinter appearance mode.

🧪 Run the demo

python example.py

🤝 Contributing

Contributions are welcome!

  1. Fork the repo
  2. Create a feature branch (feature/my-change)
  3. Commit your changes
  4. Open a Pull Request with a clear description

Ideas:

  • More language grammars for code highlighting
  • Image support

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

ctk_markdown-0.1.4.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctk_markdown-0.1.4-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file ctk_markdown-0.1.4.tar.gz.

File metadata

  • Download URL: ctk_markdown-0.1.4.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ctk_markdown-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c3b18c52babb5a0c7b64c1425faf7d20d94e579d902611fafac6d1322b20b05e
MD5 7762dbcb72111c0f5c02b4bbd10bb231
BLAKE2b-256 f537a673b2ca596c2d79fd0fc8659a4fe5746dc3da3b6a4286e8eb97d53814a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctk_markdown-0.1.4.tar.gz:

Publisher: python-publish.yml on lukagouvea/CTkMarkdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ctk_markdown-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ctk_markdown-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ctk_markdown-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 02b5e6e3253a24b439ec8e980bffe075226cf327b2e6f146f5459964ed7d86a5
MD5 e8f8c8d994d14c9e430d3e625ea187b7
BLAKE2b-256 9f472ac3612c4939be9ff3236f1934102569b371185b7887e1d228563f4183f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctk_markdown-0.1.4-py3-none-any.whl:

Publisher: python-publish.yml on lukagouvea/CTkMarkdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page