pygments-lexer-solidity

Solidity lexer for Pygments


Keywords
pygments lexer syntax highlight solidity sol ethereum
License
BSD-3-Clause
Install
pip install pygments-lexer-solidity==0.4.0

Documentation

pygments-lexer-solidity

Solidity lexer for Pygments, distributed as a PyPI package.

If you want pretty syntax highlighting in documentation for Solidity files, and you're using Pygments, this might just be the thing for you.

Currently, Solidity keywords up to version 0.4.22 are included, to the best of my ability. MRs are welcome!

Installation

pip install pygments-lexer-solidity

Usage

Depends on doc-building infrastructure.

Sphinx

Have this in Sphinx's conf.py:

from sphinx.highlighting import lexers
from pygments_lexer_solidity import SolidityLexer
lexers['solidity'] = SolidityLexer()

Then use .. code-block:: solidity for Solidity code blocks.

License

BSD 2-clause simplified. See LICENSE.txt.