diff --git a/docs/source/generate_examples.py b/docs/source/generate_examples.py index a274b8e71d462..1a43563e3e5a6 100644 --- a/docs/source/generate_examples.py +++ b/docs/source/generate_examples.py @@ -178,7 +178,7 @@ def determine_category(self) -> str: str: The category of the document. """ # noqa: E501 title = self.title.lower() - with open(self.main_file, "r") as f: + with open(self.main_file) as f: content = f.read().lower() final_category = "Other" for category, category_info in CATEGORIES.items(): @@ -189,7 +189,8 @@ def determine_category(self) -> str: def generate(self) -> str: # Convert the path to a relative path from __file__ - make_relative = lambda path: ROOT_DIR_RELATIVE / path.relative_to(ROOT_DIR) + make_relative = lambda path: ROOT_DIR_RELATIVE / path.relative_to( + ROOT_DIR) content = f"Source <{self.url}>.\n\n" if self.main_file.suffix == ".py": @@ -218,10 +219,12 @@ def generate_examples(): EXAMPLE_DOC_DIR.mkdir(parents=True) # Generate examples_index and examples_{category}_index files - examples_index = Index(title="Examples", - description="A collection of examples demonstrating usage of vLLM.\n\nAll documented examples are autogenerated from examples found in [vllm/examples](https://github.com/vllm-project/vllm/tree/main/examples).", - maxdepth=2, - caption="Categories") + examples_index = Index( + title="Examples", + description= + "A collection of examples demonstrating usage of vLLM.\n\nAll documented examples are autogenerated from examples found in [vllm/examples](https://github.com/vllm-project/vllm/tree/main/examples).", # noqa: E501 + maxdepth=2, + caption="Categories") category_indices = { category: Index(title=category, description=category_info["description"])