-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea4cfe4
commit f800e81
Showing
5 changed files
with
48 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
from __future__ import annotations | ||
|
||
import os | ||
import pathlib | ||
import shutil | ||
|
||
import pdoc | ||
|
||
import airbyte as ab | ||
|
||
import typing | ||
|
||
typing.TYPE_CHECKING = True | ||
|
||
|
||
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"] | ||
|
||
# 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. | ||
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, | ||
) | ||
pdoc.pdoc( | ||
*public_modules, | ||
output_directory=pathlib.Path("docs/generated"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters