Skip to main content

A Pygments lexer plugin for SimStm

Project description

SimStm Pygments Lexer Plugin

A Pygments plugin that provides syntax highlighting support for the SimStm language.
SimStm is a small, stack-based language used for defining simulation control flows.

This plugin adds a custom lexer so that .stm files can be syntax-highlighted in Pygments-supported tools (e.g., Sphinx, code formatters, converters, etc.).


General

  • Project Name: SimStm Pygments Lexer
  • Language Supported: SimStm
  • Lexer Type: Pygments plugin
  • License: MIT

This project is useful for:

  • Rendering .stm files with syntax highlighting in HTML, LaTeX, or terminal output using Pygments
  • Integrating SimStm support in Sphinx documentation
  • Editor plugin integrations that use Pygments lexers

Installation (for users)

You can install the lexer directly from PyPI:

pip install simstm-pygments-lexer

Usage with pygmentize

pygmentize -l simstm -f html -o output.html yourfile.stm

Or with style options:

pygmentize -l simstm -f html -O full,style=monokai -o out.html yourfile.stm

-l simstm selects this custom lexer.


Usage in Sphinx

To enable SimStm highlighting in Sphinx:

  1. Add simstm-pygments-lexer to your project's requirements.txt
  2. Use .. code-block:: simstm or .. highlight:: simstm in your .rst or .md docs

Development Setup

Clone the project

git clone https://github.com/YOUR_USERNAME/simstm-pygments-lexer.git
cd simstm-pygments-lexer

Set up environment with Hatch

Make sure Hatch is installed:

pip install hatch

Then create the virtual environment:

hatch env create

This will install pytest and other dev dependencies.


Running Tests

There are two test commands:

  • Run tests normally:

    hatch run test
    
  • Generate reference files:

    hatch run gen
    

Tests compare lexer output to expected golden files under tests/examplefiles.

Build and Publish

To build the distribution:

hatch build

To publish to PyPI.org:

pip install twine
twine upload dist/*

Contributing

Feel free to open pull requests for:

  • Language updates or extensions
  • Additional tests
  • Bug fixes

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

pygments_plugin_simstm-0.0.0a2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

pygments_plugin_simstm-0.0.0a2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pygments_plugin_simstm-0.0.0a2.tar.gz.

File metadata

File hashes

Hashes for pygments_plugin_simstm-0.0.0a2.tar.gz
Algorithm Hash digest
SHA256 ba0b45bdd71fd2c972fca355e3f4087b245795a3c85000322c895be6145f9436
MD5 be42920487c58a8d5a1046a244cdd2b7
BLAKE2b-256 636d7b3d25afb4b8521f023dcd80c7dd056e14f0b605862fa571eb2d26e7e332

See more details on using hashes here.

File details

Details for the file pygments_plugin_simstm-0.0.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for pygments_plugin_simstm-0.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 dbd4f17a3dd95b9cf78314db8a1aed1e11d470164483c0d5317299090449c98d
MD5 864ccf2438cb5f4175294e483da25555
BLAKE2b-256 92d8d7d633c70728c0a34d41b9e66f36ffef366efeffe30beb6b6b6fb131b303

See more details on using hashes here.

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