mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-26 13:18:34 +07:00
Docs: sync content from original repo
This commit is contained in:
@@ -90,7 +90,7 @@ class DocMigrationHelper:
|
||||
# 收集可能的路径
|
||||
potential_paths = []
|
||||
|
||||
# 处理文件扩展名 (.mdx -> .md)
|
||||
# 处理文件扩展名 (.mdx -> )
|
||||
rest_path = os.path.join(*parts[1:])
|
||||
if rest_path.endswith(".mdx"):
|
||||
rest_path = rest_path[:-4] + ".md"
|
||||
@@ -489,7 +489,7 @@ class DocMigrationHelper:
|
||||
changes.append((full_match, new_text, 'Frame组件图片'))
|
||||
|
||||
# 3. 查找并替换文档引用链接
|
||||
# [link text](./path/to/file.md) 或 [link text](path/to/file.md)
|
||||
# [link text](./path/to/file) 或 [link text](path/to/file)
|
||||
doc_link_pattern = re.compile(r'\[([^\]]+)\]\((\./[^)]+\.md(?:#[^)]*)?|\.\./[^)]+\.md(?:#[^)]*)?|[^)]+\.md(?:#[^)]*)?)\)')
|
||||
for match in doc_link_pattern.finditer(content):
|
||||
link_text = match.group(1)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"""
|
||||
This script automatically fixes relative path references in Markdown files.
|
||||
It searches for links to .md and .mdx files and replaces them with the correct format
|
||||
for Mintlify documentation, changing links like [text](file.md) or [text](file.mdx) to [text](./file).
|
||||
for Mintlify documentation, changing links like [text](file) or [text](file.mdx) to [text](./file).
|
||||
|
||||
使用方法:
|
||||
1. 在命令行中运行: python fix_markdown_links.py [directory]
|
||||
|
||||
Reference in New Issue
Block a user