Skip to content

Commit

Permalink
feat: Generate API docs (#262)
Browse files Browse the repository at this point in the history
* ignore docs generation by-products

* add pydoc config file

* hatch run docs

* generate docs as smoke test

* split the steps for easier debugging

* split pydoc config

* update pydoc pattern

* single-page version

* newline

* upd parent category

---------

Co-authored-by: Daria Fokina <[email protected]>
  • Loading branch information
masci and dfokina authored Jan 25, 2024
1 parent 1bbce8b commit 4ebedd4
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/chroma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ jobs:
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all

- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
run: hatch run cov
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ dmypy.json

# IDEs
.vscode

# Docs generation artifacts
_readme_*.md
31 changes: 31 additions & 0 deletions integrations/chroma/pydoc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
loaders:
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
search_path: [../src]
modules: [
"haystack_integrations.components.retrievers.chroma.retriever",
"haystack_integrations.document_stores.chroma.document_store",
"haystack_integrations.document_stores.chroma.errors",
"haystack_integrations.document_stores.chroma.utils",
]
ignore_when_discovered: ["__init__"]
processors:
- type: filter
expression:
documented_only: true
do_not_filter_modules: false
skip_empty_modules: true
- type: smart
- type: crossref
renderer:
type: haystack_pydoc_tools.renderers.ReadmePreviewRenderer
excerpt: Chroma integration for Haystack
category_slug: haystack-integrations
title: Chroma
slug: integrations-chroma
order: 1
markdown:
descriptive_class_title: false
descriptive_module_title: true
add_method_class_prefix: true
add_member_class_prefix: false
filename: _readme_chroma.md
4 changes: 4 additions & 0 deletions integrations/chroma/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ git_describe_command = 'git describe --tags --match="integrations/chroma-v[0-9]*
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
Expand All @@ -59,6 +60,9 @@ cov = [
"test-cov",
"cov-report",
]
docs = [
"pydoc-markdown pydoc/config.yml"
]

[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10"]
Expand Down

0 comments on commit 4ebedd4

Please sign in to comment.