Skip to content

Commit

Permalink
merging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-gan committed Dec 5, 2023
1 parent ea68efc commit f0eec43
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/api_reference/create_api_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ def _load_package_modules(
return modules_by_namespace


def _construct_doc(package_namespace: str, members_by_namespace: Dict[str, ModuleMembers]) -> str:
def _construct_doc(
package_namespace: str, members_by_namespace: Dict[str, ModuleMembers]
) -> str:
"""Construct the contents of the reference.rst file for the given package.
Args:
Expand Down Expand Up @@ -309,7 +311,7 @@ def _package_dir(package_name: str = "langchain") -> Path:


def _out_file_path(package_name: str = "langchain") -> Path:
"""Return the path to the file containing the documentation. """
"""Return the path to the file containing the documentation."""
name_prefix = {
"langchain": "",
"experimental": "experimental_",
Expand All @@ -319,20 +321,20 @@ def _out_file_path(package_name: str = "langchain") -> Path:


def _doc_first_line(package_name: str = "langchain") -> str:
"""Return the path to the file containing the documentation. """
name_prefix = {
"""Return the path to the file containing the documentation."""
prefix = {
"langchain": "",
"experimental": "experimental",
"core": "core",
}
return f".. {name_prefix[package_name]}_api_reference:\n\n"
return f".. {prefix[package_name]}_api_reference:\n\n"


def main() -> None:
"""Generate the api_reference.rst file for each package."""
_build_rst_file(package_name="core")
_build_rst_file(package_name="langchain")
# _build_rst_file(package_name="experimental")
# _build_rst_file(package_name="core")
_build_rst_file(package_name="experimental")


if __name__ == "__main__":
Expand Down

0 comments on commit f0eec43

Please sign in to comment.