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 -f html -o output.html yourfile.stm

Or with style options:

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

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:

hatch publish

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.0a3.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.0a3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pygments_plugin_simstm-0.0.0a3.tar.gz
Algorithm Hash digest
SHA256 c67433f5a53034b80823a7225a8cdd1c337bd9ecb29d2469a8dac23d998905ae
MD5 973e8ffee3fa8bb4a3180ead25aefe76
BLAKE2b-256 2befeefc39a9ea637b984406a582a42e7420bd0a9d2a284a2be1461e740c9ba1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pygments_plugin_simstm-0.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 f75c13befe3fd0631d445692636c887b945feee68bff56bca4c2f8cd0cff334b
MD5 807e898601af3eb77a1f113de51fef04
BLAKE2b-256 26322623bf226111519bb9627ef074158e3a0ec80c669b8bfaca94f4cc58cfef

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