When using this extension with Sphinx v4, and ImportError occurs as follows:
...
File ".../site-packages/sphinxcontrib/httpexample/directives.py", line 5, in <module>
from sphinx.directives import CodeBlock
ImportError: cannot import name 'CodeBlock' from 'sphinx.directives' (unknown location)
When using this extension with Sphinx v4, and ImportError occurs as follows:
Sphinx v2 deprecated the
sphinx.directives.CodeBlock
in favour ofsphinx.directives.code.CodeBlock
, and Sphinx v4 removed it (https://www.sphinx-doc.org/en/master/extdev/deprecated.html?highlight=CodeBlock). The extension needs to use the new location instead.