From 8056bf8b9fcd4c70807b3bb133c17b4f90a66cf9 Mon Sep 17 00:00:00 2001 From: Shoujian Zheng Date: Thu, 29 Feb 2024 20:49:23 +0800 Subject: [PATCH] fix: doesn't modify the assert links in the mdx files --- pages/documentation/design/deducer-design.zh-CN.mdx | 8 ++++---- scripts/update-docs.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/documentation/design/deducer-design.zh-CN.mdx b/pages/documentation/design/deducer-design.zh-CN.mdx index 8d9295a..529b84e 100644 --- a/pages/documentation/design/deducer-design.zh-CN.mdx +++ b/pages/documentation/design/deducer-design.zh-CN.mdx @@ -285,13 +285,13 @@ buildQueue("queue2", createAndConfigQueue).subscribe(async () => { 能够深入依赖库,获取指定类型的继承链,包括类实现方法的继承链,得到下图所示的关系 -![Class Inheritance](../../../assets/deducer-design-class-inheritance.png) +![Class Inheritance](../../../public/assets/deducer-design-class-inheritance.png) ### 分析过程 #### 1)寻找 构造特殊对象的语句 与 调用特殊方法的语句 -![Call Graph](../../../assets/deducer-design-call-graph.png) +![Call Graph](../../../public/assets/deducer-design-call-graph.png) 上图是示例程序的 Call Graph,从 Call Graph 中,可以看到程序调用了 `buildQueue`、`createAndConfigQueue`、`resource.Queue` 函数,其中 `resource.Queue` 是 Pluto 资源特殊类型。我们自顶向下进行遍历每个函数,遍历时首先判断该函数是否特殊对象的构造过程或特殊方法的调用过程。 @@ -312,10 +312,10 @@ buildQueue("queue2", createAndConfigQueue).subscribe(async () => { #### 2)寻找构造的若干个特殊对象 程序的控制流图: -![Control Flow Graph](../../../assets/deducer-design-cfg.png) +![Control Flow Graph](../../../public/assets/deducer-design-cfg.png) 程序的数据流图: -![Data Flow Graph](../../../assets/deducer-design-dfg.png) +![Data Flow Graph](../../../public/assets/deducer-design-dfg.png) 接下来,需要确定程序构造了哪些特殊对象、每个特殊对象构造时传入的参数是什么。 diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh index 39fd6ea..479f2fd 100644 --- a/scripts/update-docs.sh +++ b/scripts/update-docs.sh @@ -12,11 +12,11 @@ cp -r pluto/assets public/ echo "Adjust some content to better fit the website." pushd pages # Replace `assets` with `public/assets` in .md files, preserving any preceding ../. -find . -type f -name "*.md" -exec sed -i -E 's@((\.\./)+)assets@\1public/assets@g' {} + +find . -type f -name "*.md" -o -name "*.mdx" -exec sed -i -E 's@((\.\./)+)assets@\1public/assets@g' {} + # When utilizing the img tag in Markdown and attempting to access assets via a relative path, # adjust it to an absolute path based on the public directory. -find . -type f -name "*.md" -exec sed -i -E 's@src="((\.\./)+)public/assets@src="/assets@g' {} + +find . -type f -name "*.md" -o -name "*.mdx" -exec sed -i -E 's@src="((\.\./)+)public/assets@src="/assets@g' {} + # Disable the modification of website language through links in the text. perl -i -0pe 's@\s*
\s*.*?简体中文 @@gs' ./index.en.md ./index.zh-CN.md