Skip to content

Commit

Permalink
fix pydoc-markdown hook (#3238)
Browse files Browse the repository at this point in the history
  • Loading branch information
masci authored Sep 19, 2022
1 parent dcb132b commit 9399ddf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions .github/utils/pydoc-markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ def load_search_paths():
loader = config["loaders"][0]
# `search_path` is a list but we always have only one item in Haystack
search_path = loader["search_path"][0]
# we only need the relative path from the root, let's call `resolve` to
# get rid of the `../../` prefix
search_path = str(pathlib.Path(search_path).resolve())
# `resolve` will prepend a `/` to the path, remove it
paths[search_path[1:]] = fname
# we only need the relative path from the root, let's get rid of
# the `../../` prefix
search_path = search_path.replace("../", "")
paths[search_path] = fname
return paths


Expand Down
4 changes: 2 additions & 2 deletions docs/_src/api/pydoc/primitives.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
loaders:
- type: python
search_path: [../../../../haystack/]
search_path: [../../../../haystack]
modules: ['schema']
ignore_when_discovered: ['__init__']
processors:
- type: filter
expression:
expression:
documented_only: true
do_not_filter_modules: false
skip_empty_modules: true
Expand Down

0 comments on commit 9399ddf

Please sign in to comment.