Skip to main content

Thonny plugin: syntax highlighting for HTML files

Project description

thonny-html-highlight

Syntax highlighting for HTML files in the Thonny IDE.

By default Thonny treats .html and .htm files as plain text. This plugin adds colour highlighting for:

  • Tag names (div, span, a, …)
  • Attribute names (class, href, data-value, …)
  • Attribute values ("foo", 'bar', …)
  • HTML comments (<!-- … -->)
  • DOCTYPE declarations (<!DOCTYPE html>)
  • Entity references (&amp;, &#169;, &#xA9;, …)
  • Angle-bracket punctuation

Requirements

  • Thonny 5.0 or later
  • Python 3.13 or later (bundled with Thonny 5)

Installation

Via Thonny's built-in package manager (recommended)

  1. Open Thonny.
  2. Go to Tools → Manage packages…
  3. Search for thonny-html-highlight.
  4. Click Install.
  5. Restart Thonny.

Via pip / uv (command line)

# Using pip
pip install thonny-html-highlight

# Using uv
uv pip install thonny-html-highlight

Then restart Thonny.

From source (development)

git clone https://github.com/mrmatho/thonny-html-highlight.git
cd thonny-html-highlight
uv pip install -e .

Restart Thonny after installing.

Usage

Open any .html or .htm file in Thonny — highlighting is applied automatically. No configuration is required.

Known limitations

  • Content inside <script> and <style> tags is treated as HTML, which may produce incorrect highlighting for JavaScript or CSS within those blocks.
  • Colours follow Thonny's default light theme. Integration with custom syntax themes is planned for a future release.

Development

# Run tests
uv run pytest

# Run tests with verbose output
uv run pytest -v

Licence

MIT

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

thonny_html_highlight-0.1.1b1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

thonny_html_highlight-0.1.1b1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file thonny_html_highlight-0.1.1b1.tar.gz.

File metadata

  • Download URL: thonny_html_highlight-0.1.1b1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thonny_html_highlight-0.1.1b1.tar.gz
Algorithm Hash digest
SHA256 af8779d71960ec3355159a415aa7cafef274836d87c963b8a219da925e968873
MD5 4df1b8ab937957ce93d8a8120a43562b
BLAKE2b-256 c69da65488c371332ea258f3bbf0ccbdb5ca74ca76271711715c654582a05dcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for thonny_html_highlight-0.1.1b1.tar.gz:

Publisher: publish.yml on mrmatho/thonny-html-highlight

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

File details

Details for the file thonny_html_highlight-0.1.1b1-py3-none-any.whl.

File metadata

File hashes

Hashes for thonny_html_highlight-0.1.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 292efb11692de2d954ab780c46da2eb4ff838ca3cdf29c7c6de35862995f169d
MD5 677a3f6156b8e12019870ed4b09e486f
BLAKE2b-256 cc686c16fb998c7f267316e56a3f775ccd3208a9a0a12493769ecd1802683d6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for thonny_html_highlight-0.1.1b1-py3-none-any.whl:

Publisher: publish.yml on mrmatho/thonny-html-highlight

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