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.8.0 are included, to the
best of my ability. MRs are welcome!
The Yul intermediate language is also supported, including for
stand-alone code blocks.
Installation
------------
Set up your virtual environment, no matter how you do it.
.. code-block:: shell
% virtualenv .virtualenv/`basename $(pwd)`
% source .virtualenv/`basename $(pwd)`/bin/activate
Then install via PyPI:
.. code-block:: shell
% pip install pygments-lexer-solidity
Or from a local git repo:
.. code-block:: shell
% pip install -r requirements.txt
% pip install -e .
Usage
-----
Depends on doc-building infrastructure.
Sphinx
^^^^^^
Have this in Sphinx's ``conf.py``:
.. code-block:: python
from sphinx.highlighting import lexers
from pygments_lexer_solidity import SolidityLexer, YulLexer
lexers['solidity'] = SolidityLexer()
lexers['yul'] = YulLexer()
Then use ``.. code-block:: solidity`` for Solidity code blocks, or
``.. code-block:: yul`` for Yul.
Command-line
^^^^^^^^^^^^
To test a local copy of the lexer on the CLI:
.. code-block:: shell
% pygmentize -x -l pygments_lexer_solidity/lexer.py:SolidityLexer example.sol
To generate a colorised HTML file:
.. code-block:: shell
% pygmentize -v -O full,style=fruity -o example.sol.html example.sol
License
-------
BSD 2-clause simplified. See ``LICENSE.txt``.
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/veox/pygments-lexer-solidity",
"name": "pygments-lexer-solidity",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pygments lexer syntax highlight solidity sol yul ethereum",
"author": "Noel Maersk",
"author_email": "veox+packages+spamremove@veox.pw",
"download_url": "https://files.pythonhosted.org/packages/ce/d6/294f7957572e9604fdf11fb4acf5273735d7eb8c695a983f29a74846ed88/pygments-lexer-solidity-0.7.0.tar.gz",
"platform": "",
"description": "pygments-lexer-solidity\n=======================\n\nSolidity lexer for Pygments, distributed as a PyPI package.\n\nIf you want pretty syntax highlighting in documentation for Solidity\nfiles, and you're using Pygments, this might just be the thing for you.\n\nCurrently, Solidity keywords up to version 0.8.0 are included, to the\nbest of my ability. MRs are welcome!\n\nThe Yul intermediate language is also supported, including for\nstand-alone code blocks.\n\n\nInstallation\n------------\n\nSet up your virtual environment, no matter how you do it.\n\n.. code-block:: shell\n \n % virtualenv .virtualenv/`basename $(pwd)`\n % source .virtualenv/`basename $(pwd)`/bin/activate\n\nThen install via PyPI:\n\n.. code-block:: shell\n \n % pip install pygments-lexer-solidity\n\nOr from a local git repo:\n\n.. code-block:: shell\n \n % pip install -r requirements.txt\n % pip install -e .\n\n\nUsage\n-----\n\nDepends on doc-building infrastructure.\n\nSphinx\n^^^^^^\n\nHave this in Sphinx's ``conf.py``:\n\n.. code-block:: python\n \n from sphinx.highlighting import lexers\n from pygments_lexer_solidity import SolidityLexer, YulLexer\n lexers['solidity'] = SolidityLexer()\n lexers['yul'] = YulLexer()\n\nThen use ``.. code-block:: solidity`` for Solidity code blocks, or\n``.. code-block:: yul`` for Yul.\n\nCommand-line\n^^^^^^^^^^^^\n\nTo test a local copy of the lexer on the CLI:\n\n.. code-block:: shell\n \n % pygmentize -x -l pygments_lexer_solidity/lexer.py:SolidityLexer example.sol\n\nTo generate a colorised HTML file:\n\n.. code-block:: shell\n \n % pygmentize -v -O full,style=fruity -o example.sol.html example.sol\n\n\nLicense\n-------\n\nBSD 2-clause simplified. See ``LICENSE.txt``.",
"bugtrack_url": null,
"license": "BSD",
"summary": "Solidity lexer for Pygments (includes Yul intermediate language)",
"version": "0.7.0",
"split_keywords": [
"pygments",
"lexer",
"syntax",
"highlight",
"solidity",
"sol",
"yul",
"ethereum"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "22b03aa0709ee1ef4878f2ac5e65ef08",
"sha256": "a347fd96981838331b6d98b0f891776908a49406d343ff2a40a6a1c8475a9350"
},
"downloads": -1,
"filename": "pygments-lexer-solidity-0.7.0.tar.gz",
"has_sig": true,
"md5_digest": "22b03aa0709ee1ef4878f2ac5e65ef08",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7298,
"upload_time": "2021-03-25T20:00:22",
"upload_time_iso_8601": "2021-03-25T20:00:22.844185Z",
"url": "https://files.pythonhosted.org/packages/ce/d6/294f7957572e9604fdf11fb4acf5273735d7eb8c695a983f29a74846ed88/pygments-lexer-solidity-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-03-25 20:00:22",
"github": false,
"gitlab": true,
"bitbucket": false,
"gitlab_user": "veox",
"gitlab_project": "pygments-lexer-solidity",
"lcname": "pygments-lexer-solidity"
}