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
  • Theme-aware colors 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
  • Clickable links

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.1.tar.gz (10.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.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctk_markdown-0.1.1.tar.gz
  • Upload date:
  • Size: 10.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.1.tar.gz
Algorithm Hash digest
SHA256 6ac2eee225ca264814bfc3bbce0b0dafa3ca598c593ca096abd473f2ee2ad5c6
MD5 12e0588022ce811e437f019453d670ad
BLAKE2b-256 0acdde867ecb7f540635c5a9cd049920dafede292048ada983059680e96d46ab

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ctk_markdown-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 256c332e9d31b11fa89de3a51860aa617112621f1dead6b9916e371b91f4fd62
MD5 c72f37df6cd0abe808ce9d5783b2679b
BLAKE2b-256 7be3b6cc0ef489608f00840756c4b7b1faf0ee46d8f74051b085b9a334e05ae5

See more details on using hashes here.

Provenance

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