From cdc8e2d0c2019272ed5f9634e486cea51bc51765 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Fri, 17 May 2024 15:59:27 -0700 Subject: [PATCH] docs: resolve local links script escape (#21840) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing warnings. Needs to be propagated to 0.1 branch if this works. ![Screenshot 2024-05-17 at 2 34 15 PM](https://github.com/langchain-ai/langchain/assets/9557659/e6ac95a9-5686-4747-9ab8-4cb49942dc8d) --- docs/scripts/copy_templates.py | 4 ++-- docs/scripts/resolve_local_links.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/scripts/copy_templates.py b/docs/scripts/copy_templates.py index 403a54693d6..015c01611ef 100644 --- a/docs/scripts/copy_templates.py +++ b/docs/scripts/copy_templates.py @@ -21,7 +21,7 @@ if __name__ == "__main__": with open(full_destination, "r") as f: content = f.read() # remove images - content = re.sub("\!\[.*?\]\((.*?)\)", "", content) + content = re.sub(r"\!\[.*?\]\((.*?)\)", "", content) with open(full_destination, "w") as f: f.write(content) @@ -39,7 +39,7 @@ sidebar_class_name: hidden content = f.read() # replace relative links - content = re.sub("\]\(\.\.\/", "](/docs/templates/", content) + content = re.sub(r"\]\(\.\.\/", "](/docs/templates/", content) with open(templates_index_intermediate, "w") as f: f.write(sidebar_hidden + content) diff --git a/docs/scripts/resolve_local_links.py b/docs/scripts/resolve_local_links.py index 1a329cdc66f..99414e3c803 100644 --- a/docs/scripts/resolve_local_links.py +++ b/docs/scripts/resolve_local_links.py @@ -11,7 +11,7 @@ def update_links(doc_path, docs_link): content = f.read() # replace relative links - content = re.sub("\]\(\.\/", f"]({docs_link}", content) + content = re.sub(r"\]\(\.\/", f"]({docs_link}", content) with open(DOCS_DIR / doc_path, "w") as f: f.write(content)