From da40011d8c322e6b027095a35d760fb453cdda1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 20 May 2021 21:02:14 +0200 Subject: [PATCH 1/5] Add generated robots.txt to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0238cc349..9322b0c81 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ prerelease.txt /build* emscripten_build/ docs/_build +docs/_static/robots.txt __pycache__ docs/utils/*.pyc /deps/downloads/ From b7bbf6bd070dea5d5457541da660dc554ac546b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 20 May 2021 21:00:44 +0200 Subject: [PATCH 2/5] docs/contributing.rst: Don't use the default Solidity highlighting for shell and text snippets --- docs/contributing.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 8953ad68e..848aaf773 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -263,7 +263,7 @@ We mainly use `AFL `_ for fuzzing. You need to install the AFL packages from your repositories (afl, afl-clang) or build them manually. Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compiler: -:: +.. code-block:: shell cd build # if needed @@ -273,7 +273,7 @@ Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compile At this stage you should be able to see a message similar to the following: -:: +.. code-block:: text Scanning dependencies of target solfuzzer [ 98%] Building CXX object test/tools/CMakeFiles/solfuzzer.dir/fuzzer.cpp.o @@ -284,7 +284,7 @@ At this stage you should be able to see a message similar to the following: If the instrumentation messages did not appear, try switching the cmake flags pointing to AFL's clang binaries: -:: +.. code-block:: shell # if previously failed make clean @@ -293,7 +293,7 @@ If the instrumentation messages did not appear, try switching the cmake flags po Otherwise, upon execution the fuzzer halts with an error saying binary is not instrumented: -:: +.. code-block:: text afl-fuzz 2.52b by ... (truncated messages) @@ -317,7 +317,7 @@ Next, you need some example source files. This makes it much easier for the fuzz to find errors. You can either copy some files from the syntax tests or extract test files from the documentation or the other tests: -:: +.. code-block:: shell mkdir /tmp/test_cases cd /tmp/test_cases @@ -334,7 +334,7 @@ that result in similar behaviour of the binary. Now run the fuzzer (the ``-m`` extends the size of memory to 60 MB): -:: +.. code-block:: shell afl-fuzz -m 60 -i /tmp/test_cases -o /tmp/fuzzer_reports -- /path/to/solfuzzer From 570ecf1cf193a278c123b577e7f33dedfa239362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 20 May 2021 21:04:51 +0200 Subject: [PATCH 3/5] Replace deprecated Sphinx mehods with newer equivalents --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f0eb06e4d..4c7a67164 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,10 +26,10 @@ from pygments_lexer_solidity import SolidityLexer, YulLexer def setup(sphinx): thisdir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, thisdir + '/utils') - sphinx.add_lexer('Solidity', SolidityLexer()) - sphinx.add_lexer('Yul', YulLexer()) + sphinx.add_lexer('Solidity', SolidityLexer) + sphinx.add_lexer('Yul', YulLexer) - sphinx.add_stylesheet('css/custom.css') + sphinx.add_css_file('css/custom.css') # -- General configuration ------------------------------------------------ From 056e0d3751dc761c4ca1ece7fd33fedbb0bd81d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 20 May 2021 21:19:33 +0200 Subject: [PATCH 4/5] docs: Suppress highlighting errors for snippets that cause errors in pygments-lexer-solidity --- docs/assembly.rst | 3 ++- docs/examples/micropayment.rst | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/assembly.rst b/docs/assembly.rst index d5d73cfb1..a8e36d408 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -141,7 +141,8 @@ Both expressions can also be assigned to. Local Solidity variables are available for assignments, for example: -.. code:: +.. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; diff --git a/docs/examples/micropayment.rst b/docs/examples/micropayment.rst index 065943080..5ef1658ec 100644 --- a/docs/examples/micropayment.rst +++ b/docs/examples/micropayment.rst @@ -139,7 +139,8 @@ The functions ``prefixed`` and ``recoverSigner`` do this in the ``claimPayment`` The full contract ----------------- -:: +.. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; @@ -335,7 +336,8 @@ so it is important that Bob closes the channel before the expiration is reached. The full contract ----------------- -:: +.. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; From 98c4830f2a9f1e03ecfbf6e22f3372e8748db539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 20 May 2021 21:55:19 +0200 Subject: [PATCH 5/5] docs/requirements.txt: Add minimum version for Sphinx --- docs/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 268c6e161..038c22b7c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,6 @@ sphinx_rtd_theme>=0.3.1 pygments-lexer-solidity>=0.7.0 sphinx-a4doc>=1.2.1 + +# Sphinx 2.1.0 is the oldest version that accepts a lexer class in add_lexer() +sphinx>=2.1.0