docs: resolve local links script escape (#21840)

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)
pull/21530/head^2
Erick Friis 4 months ago committed by GitHub
parent d02380c504
commit cdc8e2d0c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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)

@ -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)

Loading…
Cancel
Save