Skip to content

Commit

Permalink
Docs: Cleanup auto-generated reference docs (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Feb 17, 2024
1 parent 65b86dd commit 9becf13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _Note: Additional secret store options may be supported in the future. [More inf
### Retrieving Secrets

```python
from airbyte_lib import get_secret, SecretSource
from airbyte import get_secret, SecretSource

source = get_connection("source-github")
source.set_config(
Expand Down
6 changes: 3 additions & 3 deletions airbyte/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.

"""All exceptions used in the Airbyte Lib.
"""All exceptions used in the PyAirbyte.
This design is modeled after structlog's exceptions, in that we bias towards auto-generated
property prints rather than sentence-like string concatenation.
Expand Down Expand Up @@ -111,7 +111,7 @@ def __repr__(self) -> str:

@dataclass
class AirbyteLibInternalError(AirbyteError):
"""An internal error occurred in Airbyte Lib."""
"""An internal error occurred in PyAirbyte."""

guidance = "Please consider reporting this error to the Airbyte team."
help_url = NEW_ISSUE_URL
Expand All @@ -125,7 +125,7 @@ class AirbyteLibInputError(AirbyteError, ValueError):
"""The input provided to PyAirbyte did not match expected validation rules.
This inherits from ValueError so that it can be used as a drop-in replacement for
ValueError in the Airbyte Lib API.
ValueError in the PyAirbyte API.
"""

# TODO: Consider adding a help_url that links to the auto-generated API reference.
Expand Down
17 changes: 7 additions & 10 deletions docs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,25 @@


def run() -> None:
"""Generate docs for all public modules in airbyte_lib and save them to docs/generated.
Public modules are:
* The main airbyte_lib module
* All directory modules in airbyte_lib that don't start with an underscore.
"""
public_modules = ["airbyte"]
"""Generate docs for all public modules in AirbyteLib and save them to docs/generated."""
public_modules = []

# recursively delete the docs/generated folder if it exists
if pathlib.Path("docs/generated").exists():
shutil.rmtree("docs/generated")

# All files and folders in `airbyte_lib` that don't start with "_" are treated as public.
# All files and folders that don't start with "_" are treated as public.
for submodule in os.listdir("airbyte"):
submodule_path = pathlib.Path(f"airbyte/{submodule}")
if not submodule.startswith("_"):
public_modules.append(submodule_path)

pdoc.render.configure(
template_directory="docs",
show_source=False,
search=False,
show_source=True,
search=True,
logo="https://docs.airbyte.com/img/logo-dark.png",
favicon="https://docs.airbyte.com/img/favicon.png",
)
pdoc.pdoc(
*public_modules,
Expand Down

0 comments on commit 9becf13

Please sign in to comment.