Skip to content

Commit 6324688

Browse files
authored
Merge pull request #11420 from ethereum/docs-sphinx-4-compatibility-fixes
[DOCS] Sphinx 4.x.y compatibility fixes
2 parents 69714b2 + 98c4830 commit 6324688

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ prerelease.txt
3434
/build*
3535
emscripten_build/
3636
docs/_build
37+
docs/_static/robots.txt
3738
__pycache__
3839
docs/utils/*.pyc
3940
/deps/downloads/

docs/assembly.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ Both expressions can also be assigned to.
141141

142142
Local Solidity variables are available for assignments, for example:
143143

144-
.. code::
144+
.. code-block:: solidity
145+
:force:
145146
146147
// SPDX-License-Identifier: GPL-3.0
147148
pragma solidity >=0.7.0 <0.9.0;

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
def setup(sphinx):
2727
thisdir = os.path.dirname(os.path.realpath(__file__))
2828
sys.path.insert(0, thisdir + '/utils')
29-
sphinx.add_lexer('Solidity', SolidityLexer())
30-
sphinx.add_lexer('Yul', YulLexer())
29+
sphinx.add_lexer('Solidity', SolidityLexer)
30+
sphinx.add_lexer('Yul', YulLexer)
3131

32-
sphinx.add_stylesheet('css/custom.css')
32+
sphinx.add_css_file('css/custom.css')
3333

3434
# -- General configuration ------------------------------------------------
3535

docs/contributing.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ We mainly use `AFL <https://lcamtuf.coredump.cx/afl/>`_ for fuzzing. You need to
263263
install the AFL packages from your repositories (afl, afl-clang) or build them manually.
264264
Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compiler:
265265

266-
::
266+
.. code-block:: shell
267267
268268
cd build
269269
# if needed
@@ -273,7 +273,7 @@ Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compile
273273
274274
At this stage you should be able to see a message similar to the following:
275275

276-
::
276+
.. code-block:: text
277277
278278
Scanning dependencies of target solfuzzer
279279
[ 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:
284284
285285
If the instrumentation messages did not appear, try switching the cmake flags pointing to AFL's clang binaries:
286286

287-
::
287+
.. code-block:: shell
288288
289289
# if previously failed
290290
make clean
@@ -293,7 +293,7 @@ If the instrumentation messages did not appear, try switching the cmake flags po
293293
294294
Otherwise, upon execution the fuzzer halts with an error saying binary is not instrumented:
295295

296-
::
296+
.. code-block:: text
297297
298298
afl-fuzz 2.52b by <[email protected]>
299299
... (truncated messages)
@@ -317,7 +317,7 @@ Next, you need some example source files. This makes it much easier for the fuzz
317317
to find errors. You can either copy some files from the syntax tests or extract test files
318318
from the documentation or the other tests:
319319

320-
::
320+
.. code-block:: shell
321321
322322
mkdir /tmp/test_cases
323323
cd /tmp/test_cases
@@ -334,7 +334,7 @@ that result in similar behaviour of the binary.
334334

335335
Now run the fuzzer (the ``-m`` extends the size of memory to 60 MB):
336336

337-
::
337+
.. code-block:: shell
338338
339339
afl-fuzz -m 60 -i /tmp/test_cases -o /tmp/fuzzer_reports -- /path/to/solfuzzer
340340

docs/examples/micropayment.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ The functions ``prefixed`` and ``recoverSigner`` do this in the ``claimPayment``
139139
The full contract
140140
-----------------
141141

142-
::
142+
.. code-block:: solidity
143+
:force:
143144
144145
// SPDX-License-Identifier: GPL-3.0
145146
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.
335336
The full contract
336337
-----------------
337338

338-
::
339+
.. code-block:: solidity
340+
:force:
339341
340342
// SPDX-License-Identifier: GPL-3.0
341343
pragma solidity >=0.7.0 <0.9.0;

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
sphinx_rtd_theme>=0.3.1
22
pygments-lexer-solidity>=0.7.0
33
sphinx-a4doc>=1.2.1
4+
5+
# Sphinx 2.1.0 is the oldest version that accepts a lexer class in add_lexer()
6+
sphinx>=2.1.0

0 commit comments

Comments
 (0)