Closed AchimKern closed 4 years ago
in other words, is there a way to configure/run something like this when documentation is created
import sys
from unittest.mock import MagicMock as mock
sys.modules["td"] = mock()
In Version 0.8.1, on_config
option was added. See this example
In your case, please try:
# setup.py
import sys
from unittest.mock import MagicMock as mock
def on_config():
sys.modules["td"] = mock()
and
# mkdocs.yml
plugins:
- mkapi:
src_dirs: [<path_to_setup.py>]
on_config: setup.on_config
wow. thank you. this seems to be working perfectly
Hi ,
I would like do to document a project that makes heavy use of external libraries where I don't have access to the sources. Does mkapi offer something similar to mocks in sphinxs/autodoc autodoc_mock_imports = ["django","td"]?
Thanks in advance