From 693b88e5f8e2af23a3784518c012230c8cf4d463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 14 Jul 2021 19:32:42 +0200 Subject: [PATCH] docs: Force highlighter to work despite errors on snippets that it cannot parse --- docs/abi-spec.rst | 1 + docs/common-patterns.rst | 2 ++ docs/contracts/libraries.rst | 1 + docs/control-structures.rst | 1 + docs/examples/blind-auction.rst | 1 + docs/ir/ir-breaking-changes.rst | 1 + docs/style-guide.rst | 2 ++ docs/types/mapping-types.rst | 1 + docs/types/value-types.rst | 3 +++ docs/units-and-global-variables.rst | 1 + 10 files changed, 14 insertions(+) diff --git a/docs/abi-spec.rst b/docs/abi-spec.rst index 8ecbedfe1..1b61351fa 100644 --- a/docs/abi-spec.rst +++ b/docs/abi-spec.rst @@ -237,6 +237,7 @@ Examples Given the contract: .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.4.16 <0.9.0; diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 58fb39ea2..86c81dbfb 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -130,6 +130,7 @@ The use of **function modifiers** makes these restrictions highly readable. .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; @@ -293,6 +294,7 @@ function finishes. will run even if the function explicitly returns. .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; diff --git a/docs/contracts/libraries.rst b/docs/contracts/libraries.rst index a6a062501..dbb36f317 100644 --- a/docs/contracts/libraries.rst +++ b/docs/contracts/libraries.rst @@ -130,6 +130,7 @@ internal functions in libraries in order to implement custom types without the overhead of external function calls: .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.8 <0.9.0; diff --git a/docs/control-structures.rst b/docs/control-structures.rst index d74a863a7..95a55f6c6 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -660,6 +660,7 @@ The following example shows how you can use ``require`` to check conditions on i and ``assert`` for internal error checking. .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0 <0.9.0; diff --git a/docs/examples/blind-auction.rst b/docs/examples/blind-auction.rst index ce72cdf18..c00bbf212 100644 --- a/docs/examples/blind-auction.rst +++ b/docs/examples/blind-auction.rst @@ -192,6 +192,7 @@ invalid bids. .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; diff --git a/docs/ir/ir-breaking-changes.rst b/docs/ir/ir-breaking-changes.rst index cbc797346..5bd6c8bdf 100644 --- a/docs/ir/ir-breaking-changes.rst +++ b/docs/ir/ir-breaking-changes.rst @@ -226,6 +226,7 @@ The new code generator performs cleanup after any operation that can result in d For example: .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.1; diff --git a/docs/style-guide.rst b/docs/style-guide.rst index e05f9349a..9e0fba5f6 100644 --- a/docs/style-guide.rst +++ b/docs/style-guide.rst @@ -998,6 +998,7 @@ No: Yes: .. code-block:: solidity + :force: x = 3; x = 100 / 10; @@ -1007,6 +1008,7 @@ Yes: No: .. code-block:: solidity + :force: x=3; x = 100/10; diff --git a/docs/types/mapping-types.rst b/docs/types/mapping-types.rst index 29a00a196..c026d73f2 100644 --- a/docs/types/mapping-types.rst +++ b/docs/types/mapping-types.rst @@ -122,6 +122,7 @@ top of them and iterate over that. For example, the code below implements an the ``sum`` function iterates over to sum all the values. .. code-block:: solidity + :force: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.8 <0.9.0; diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index 5df4557a7..008d31683 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -239,6 +239,7 @@ It is possible to query the balance of an address using the property ``balance`` and to send Ether (in units of wei) to a payable address using the ``transfer`` function: .. code-block:: solidity + :force: address payable x = address(0x123); address myAddress = address(this); @@ -535,6 +536,7 @@ quote a backslash character and then (without separator) the character sequence ``abcdef``. .. code-block:: solidity + :force: "\n\"\'\\abc\ def" @@ -641,6 +643,7 @@ be passed via and returned from external function calls. Function types are notated as follows: .. code-block:: solidity + :force: function () {internal|external} [pure|view|payable] [returns ()] diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst index df79d1b13..0e2ce34a2 100644 --- a/docs/units-and-global-variables.rst +++ b/docs/units-and-global-variables.rst @@ -10,6 +10,7 @@ Ether Units A literal number can take a suffix of ``wei``, ``gwei`` or ``ether`` to specify a subdenomination of Ether, where Ether numbers without a postfix are assumed to be Wei. .. code-block:: solidity + :force: assert(1 wei == 1); assert(1 gwei == 1e9);