Skip to content

Commit

Permalink
fix: doesn't modify the assert links in the mdx files
Browse files Browse the repository at this point in the history
  • Loading branch information
jianzs committed Feb 29, 2024
1 parent 6e3be14 commit 8056bf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pages/documentation/design/deducer-design.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 资源特殊类型。我们自顶向下进行遍历每个函数,遍历时首先判断该函数是否特殊对象的构造过程或特殊方法的调用过程。

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

接下来,需要确定程序构造了哪些特殊对象、每个特殊对象构造时传入的参数是什么。

Expand Down
4 changes: 2 additions & 2 deletions scripts/update-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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*<br/>\s*.*?简体中文 </a>@@gs' ./index.en.md ./index.zh-CN.md
Expand Down

0 comments on commit 8056bf8

Please sign in to comment.