Skip to content

Commit

Permalink
remove the module.rst and section_name.rst to fix the side bar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Alleria1809 committed Jul 5, 2024
1 parent 6c41b8c commit 5c0508b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
60 changes: 30 additions & 30 deletions docs/source/remove_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ 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:
print(f"No modules.rst to remove in {directory}")

# 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)
Expand All @@ -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")
Expand Down

0 comments on commit 5c0508b

Please sign in to comment.