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
.stmfiles 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 simstmselects this custom lexer.
Usage in Sphinx
To enable SimStm highlighting in Sphinx:
- Add
simstm-pygments-lexerto your project'srequirements.txt - Use
.. code-block:: simstmor.. highlight:: simstmin your.rstor.mddocs
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
pytestand 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygments_plugin_simstm-0.0.0a2.tar.gz.
File metadata
- Download URL: pygments_plugin_simstm-0.0.0a2.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba0b45bdd71fd2c972fca355e3f4087b245795a3c85000322c895be6145f9436
|
|
| MD5 |
be42920487c58a8d5a1046a244cdd2b7
|
|
| BLAKE2b-256 |
636d7b3d25afb4b8521f023dcd80c7dd056e14f0b605862fa571eb2d26e7e332
|
File details
Details for the file pygments_plugin_simstm-0.0.0a2-py3-none-any.whl.
File metadata
- Download URL: pygments_plugin_simstm-0.0.0a2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbd4f17a3dd95b9cf78314db8a1aed1e11d470164483c0d5317299090449c98d
|
|
| MD5 |
864ccf2438cb5f4175294e483da25555
|
|
| BLAKE2b-256 |
92d8d7d633c70728c0a34d41b9e66f36ffef366efeffe30beb6b6b6fb131b303
|