Open kemingy opened 1 year ago
Hey @kemingy , unfortunately I could not replicate the behaviour.
diff --git a/examples/mkdocs/pyproject.toml b/examples/mkdocs/pyproject.toml
index 5291e54..6dce064 100644
--- a/examples/mkdocs/pyproject.toml
+++ b/examples/mkdocs/pyproject.toml
@@ -5,6 +5,9 @@ search_path = [ "../src" ]
[tool.pydoc-markdown.renderer]
type = "mkdocs"
+[tool.pydoc-markdown.renderer.markdown]
+add_full_prefix = true
+
[[tool.pydoc-markdown.renderer.pages]]
title = "API Documentation"
name = "index"
diff --git a/examples/src/school/__init__.py b/examples/src/school/__init__.py
index 9818a23..8f7fe4f 100644
--- a/examples/src/school/__init__.py
+++ b/examples/src/school/__init__.py
@@ -8,3 +8,8 @@ from ._pupil import Pupil
from ._teacher import Teacher
from ._school import School
from ._api._v1 import SchoolApiV1
+
+
+def demo():
+ "Hello"
+ pass
$ cd examples/mkdocs
$ pydoc-markdown -so
Can you still reproduce the issue?
Environment
Describe the bug
When using the
MarkdownRenderer
withadd_full_prefix
enabled, if there are functions defined in the__init__.py
file, the prefix will also contain__init__.
. Refer to https://github.com/NiklasRosenstein/pydoc-markdown/blob/3aa2fa94f514ee827992e4145a23e1260b5a4efd/src/pydoc_markdown/contrib/renderers/markdown.py#L47-L48Expected behavior
I think
__init__
should be ignored in thedotted_name
function. Let's say you have ademo
function inmy_package/__init__.py
, its title should bemy_package.demo
instead ofmy_package.__init__.demo
.