diff --git a/docs/Makefile b/docs/Makefile index eec2c40e..3e52dc87 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -36,8 +36,8 @@ update_files: @python $(SOURCEDIR)/insert_labels.py @echo "Removing unnecessary strings for better formatting" @python $(SOURCEDIR)/remove_string.py -#@echo "Removing duplicated files" -# @python $(SOURCEDIR)/remove_files.py + @echo "Removing duplicated files" + @python $(SOURCEDIR)/remove_files.py @echo "Renaming and updating file" @python $(SOURCEDIR)/change_api_file_name.py diff --git a/docs/source/remove_files.py b/docs/source/remove_files.py index 56f023c5..065c3d78 100644 --- a/docs/source/remove_files.py +++ b/docs/source/remove_files.py @@ -15,7 +15,7 @@ def remove_file(directory: str): # remove modules.rst try: - for filename in os.listdir(directory): + for _ in os.listdir(directory): module_file = os.path.join(directory, "modules.rst") os.remove(module_file) except Exception: @@ -23,7 +23,7 @@ def remove_file(directory: str): # remove components.rst, core.rst, prompt.rst, ... try: - for filename in os.listdir(directory): + for _ in os.listdir(directory): name = directory.split("/")[-1] + ".rst" module_file = os.path.join(directory, name) os.remove(module_file) @@ -32,34 +32,34 @@ def remove_file(directory: str): # remove api files to avoid showing duplicated section - target_files = [ - "components.model_client.openai_client.rst", - "components.retriever.faiss_retriever.rst", - "components.reasoning.chain_of_thought.rst", - "components.model_client.groq_client.rst", - "components.retriever.bm25_retriever.rst", - "components.model_client.google_client.rst", - "components.model_client.transformers_client.rst", - "components.model_client.utils.rst", - "components.retriever.llm_retriever.rst", - "components.agent.react.rst", - "components.model_client.anthropic_client.rst", - "components.output_parsers.outputs.rst", - "components.model_client.cohere_client.rst", - "components.retriever.reranker_retriever.rst", - "components.data_process.data_components.rst", - "components.data_process.text_splitter.rst", - "components.memory.memory.rst", - # "components.retriever.postgres_retriever.rst", - ] - try: - for filename in os.listdir(directory): - if filename in target_files: - filepath = os.path.join(directory, filename) - os.remove(filepath) - print(f"{filepath} is removed") - except Exception: - print(f"No target files to remove in {directory}") + # target_files = [ + # "components.model_client.openai_client.rst", + # "components.retriever.faiss_retriever.rst", + # "components.reasoning.chain_of_thought.rst", + # "components.model_client.groq_client.rst", + # "components.retriever.bm25_retriever.rst", + # "components.model_client.google_client.rst", + # "components.model_client.transformers_client.rst", + # "components.model_client.utils.rst", + # "components.retriever.llm_retriever.rst", + # "components.agent.react.rst", + # "components.model_client.anthropic_client.rst", + # "components.output_parsers.outputs.rst", + # "components.model_client.cohere_client.rst", + # "components.retriever.reranker_retriever.rst", + # "components.data_process.data_components.rst", + # "components.data_process.text_splitter.rst", + # "components.memory.memory.rst", + # # "components.retriever.postgres_retriever.rst", + # ] + # try: + # for filename in os.listdir(directory): + # if filename in target_files: + # filepath = os.path.join(directory, filename) + # os.remove(filepath) + # print(f"{filepath} is removed") + # except Exception: + # print(f"No target files to remove in {directory}") remove_file("./source/apis/components")