-
|
It has been asked a couple of times on stackoverflow and I have the same issue. with that I try to generate documentation from docstrings plugins:
- search
- mkdocstrings:
handlers:
python:
setup_commands:
- import sys
- sys.path.append('../')
- print("system path ----------------------->" + str(sys.path))
selection:
new_path_syntax: true`
with mkdocs build -v I can not see the print but I can see that griffe picked up the modules. with griffe dump MODULENAME I can see the docstrings are picked up. Still mkdocs is not producing any module documentation. mkdocs version is 1.5.3 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
|
Hello. Any output coming from the setup commands is discarded, because the legacy Python handler reads the output of pytkdocs and loads it as JSON. Your print statement would break that if we didn't discard it. Not sure what you mean about forwarding to a file: these are Python statements, not shell commands, so About not seeing any API docs generated, I invite you to open an issue in https://github.com/mkdocstrings/python-legacy. But before that: have you tried the new handler? It's much better than the legacy one :) |
Beta Was this translation helpful? Give feedback.
-
|
Hello, usually I can write log output that way to text files. Not really sure how to diasable the old handler and use the new one. [package.extras] docs = ["mdx-gh-links (>=0.2)", "mkdocs (>=1.5)", "mkdocs-gen-files", "mkdocs-literate-nav", "mkdocs-nature (>=0.6)", "mkdocs-section-index", "mkdocstrings[python]"] testing = ["coverage", "pyyaml"] and in a make file call it like .PHONY: docs-test docs-test: ## Test if documentation can be built without warnings or errors @poetry run mkdocs build -s anything else to be done ? |
Beta Was this translation helpful? Give feedback.
-
In shell scripts yes, not in Python 🙂 With Try this instead: plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [..]See the docs for the I'll move this issue to a discussion since there's nothing actionable for MkDocs. |
Beta Was this translation helpful? Give feedback.
-
|
if I do that I get this error ERROR - Error reading page 'modules.md': 'python_try' ... KeyError: 'python_try' the project structure looks like so according to the documentation I have changed the path setting to paths: [python_try] which works but than the modules page is empty |
Beta Was this translation helpful? Give feedback.
See https://mkdocstrings.github.io/python/usage/configuration/members/#show_submodules to inject docs for submodules recursively :)