Selaa lähdekoodia

update titles

ruki 4 kuukautta sitten
vanhempi
sitoutus
64d9bd375c

+ 4 - 2
docs/api/description/global-interfaces.md

@@ -49,6 +49,8 @@ target("test")
     add_files("src/*.c")
 ```
 
+#### Add helper configurations {add-helper-configurations}
+
 Above v2.8.5 can includes include some built-in helper configuration scripts, e.g.:
 
 ```lua
@@ -79,7 +81,7 @@ only introduces the helper scripts related to check_cfuncs in the check director
 
 With `@builtin` we can distinguish between the files in the current user's project directory and the built-in files in the xmake installation directory.
 
-#### Scope Description
+#### Scope Description {#scope-description}
 
 Configurations introduced by `includes` inherit and take effect in a tree-like hierarchy. That is, global configurations in the current `xmake.lua` file will apply to all `includes` sub-xmake.lua files. For example:
 
@@ -106,7 +108,7 @@ For example, if the imported `foo/xmake.lua` contains a global `add_defines` con
 This scope isolation can avoid many hidden configuration conflicts and scope pollution. In highly nested project configurations, implicit global imports can cause many problems.
 :::
 
-#### Modular and Reusable Configurations
+#### Modular and Reusable Configurations {#modular-reusable}
 
 So, if I want to modularize and reuse configurations, how should I do it? Simply encapsulate the configurations you want to reuse within a function, for example:
 

+ 4 - 4
docs/zh/api/description/global-interfaces.md

@@ -37,7 +37,7 @@ target("test")
     add_files("src/*.c")
 ```
 
-#### 递归引入子配置
+#### 递归引入子配置 {#recursively-add-configurations}
 
 我们也可以通过模式匹配的方式,递归添加多个工程子目录文件:
 
@@ -49,7 +49,7 @@ target("test")
     add_files("src/*.c")
 ```
 
-#### 引入内置的辅助配置
+#### 引入内置的辅助配置 {#add-helper-configurations}
 
 2.8.5 版本可以 includes 包含内置的一些辅助配置脚本,例如:
 
@@ -81,7 +81,7 @@ includes("@builtin/check/check_cfuncs.lua")
 
 而通过 `@builtin` 我们就能很好的区分是引入当前用户工程目录下的文件,还是 xmake 安装目录下的内置文件。
 
-#### 作用域说明
+#### 作用域说明 {#scope-description}
 
 includes 引入的配置是按树状层级结构来继承生效的,也就是当前 xmake.lua 中的全局配置,会对所有 includes 的子 xmake.lua 配置生效,例如:
 
@@ -108,7 +108,7 @@ target("test")
 这种作用域隔离,能规避很多隐藏的配置冲突和作用域污染,在嵌套层级过多的工程配置中,隐式的全局引入,会导致很多的问题。
 :::
 
-#### 模块化复用配置
+#### 模块化复用配置 {#modular-reusable}
 
 那如果我想模块化复用配置,应该怎么做呢?只需要通过 function 去封装下需要复用的配置就行了,例如: