/pygments

Pygments is a generic syntax highlighter written in Python

Primary LanguagePythonBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Pygments'

A modified version of the Pygments library with custom lexer and styling for the STG (Spineless Tagless G-machine) language.

Used to render code listings with the minted LaTeX package in magistrsko_delo.

Installation

To install, make sure git is installed and run the following commands

git clone https://github.com/drobilc/pygments.git
cd pygments
pip install .

Development

To install the package in editable mode, run pip install -e . command.

Lexer

  1. To modify the lexer, edit the `pygments/lexers/stg.py </syntax_highlighting/pygments/lexers/stg.py>`__ file.
  2. After making the changes, run tox -e mapfiles to rebuild the lexer mapping.
  3. Delete the magistrsko_delo/_minted-magistrsko_delo directory to remove cached files and rerun the LaTeX compiler to see the changes.

For more information, check out the Pygments lexer development documentation.

Styling

  1. To modify the styling, edit the `pygments/styles/stgyle.py </syntax_highlighting/pygments/styles/stgyle.py>`__ file.
  2. After making the changes, run tox -e mapfiles to rebuild the mappings file.
  3. Delete the magistrsko_delo/_minted-magistrsko_delo directory to remove cached files and rerun the LaTeX compiler to see the changes.

For more information, check out the Pygments style development documentation.