Skip to content

Commit 1f0b821

Browse files
authored
Merge pull request #124 from akhmerov/issue-104
explain how to use hide-code in correctness checks
2 parents 0661045 + 50e6878 commit 1f0b821

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/source/index.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,16 @@ produces:
147147

148148
print('this code is invisible')
149149

150-
or vice versa with ``:hide-output:``::
150+
this option is particularly useful if you want to embed correctness checks in building your documentation::
151+
152+
.. jupyter-execute::
153+
:hide-code:
154+
155+
assert everything_works, "There's a bug somewhere"
156+
157+
This way even though the code won't make it into the documentation, the build will fail if running the code fails.
158+
159+
Similarly, outputs are hidden with ``:hide-output:``::
151160

152161
.. jupyter-execute::
153162
:hide-output:

0 commit comments

Comments
 (0)