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.3.tar.gz (12.3 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.3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctk_markdown-0.1.3.tar.gz
  • Upload date:
  • Size: 12.3 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.3.tar.gz
Algorithm Hash digest
SHA256 6c0e2c34a68900980eea0f710d663c9448a8b613ec15869911b1af7e0988d97f
MD5 8901acbd50fdb8a242a625d0d2cf0eb1
BLAKE2b-256 51289e9db73244acb0c241a1e8f9da74101ab29c68b6fd0b0cf1d471c55aea32

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctk_markdown-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: ctk_markdown-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7c47ffc5a10cdf8edb4af9e602a645d401397b08b0a0bbee3fdca16575ecc6
MD5 57798f48a0db61915b4342a9902f4119
BLAKE2b-256 5b81aa3a047d84572b01a74beae3953edfe01e89a213aa83145e76925d7cdfd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctk_markdown-0.1.3-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