From 7acf5d524431a881b4613759e11244e598b70205 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Wed, 23 May 2018 16:53:10 +0300 Subject: docs: use SolidityLexer from pygments_lexer_solidity package. --- docs/conf.py | 2 +- docs/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/conf.py b/docs/conf.py index 7e107f2a..0cc245b5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ import re def setup(sphinx): thisdir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, thisdir + '/utils') - from SolidityLexer import SolidityLexer + from pygments_lexer_solidity import SolidityLexer sphinx.add_lexer('Solidity', SolidityLexer()) # -- General configuration ------------------------------------------------ diff --git a/docs/requirements.txt b/docs/requirements.txt index 0607b1ef..30af17ab 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,2 @@ sphinx_rtd_theme>=0.3.1 +pygments-lexer-solidity>=0.2 -- cgit v1.2.3 From 6b64dc01101535668223cad2a74c1d5dac3dbfc5 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Wed, 23 May 2018 16:53:33 +0300 Subject: docs: remove utils/SolidityLexer.py Note that some features present in this local module have not been included in the upstream package yet!.. --- docs/utils/SolidityLexer.py | 82 --------------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 docs/utils/SolidityLexer.py (limited to 'docs') diff --git a/docs/utils/SolidityLexer.py b/docs/utils/SolidityLexer.py deleted file mode 100644 index 50f51cf4..00000000 --- a/docs/utils/SolidityLexer.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import copy - -from pygments.lexer import RegexLexer, ExtendedRegexLexer, bygroups, using, \ - include, this -from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number, Other, Punctuation, Literal - -__all__ = ['SolidityLexer'] - -class SolidityLexer(RegexLexer): - name = "Solidity" - aliases = ['sol', 'solidity'] - filenames = ['*.sol'] - mimetypes = [] - flags = re.DOTALL - tokens = { - 'commentsandwhitespace': [ - (r'\s+', Text), - (r'