pygments-michelson

Pygments lexer for Michelson contracts


Keywords
pygments, michelson, tezos, lexer
License
MIT
Install
pip install pygments-michelson==1.0.1

Documentation

Pygments Lexer for Michelson contracts

A lexer class for Michelson contracts.

Installing

From pip:

# pip --user install pygments-michelson-1.0.0

Usage

On the command line

$ pygmentize contract.tz

From python script to generate HTML

from pygments import highlight
from pygments_michelson import MichelsonLexer
from pygments.formatters import HtmlFormatter

code = 'parameter unit; storage unit; code { CDR; NIL operation; PAIR };'
print(highlight(code, MichelsonLexer(), HtmlFormatter()))