Skip to content

Commit 8af0bce

Browse files
authored
Merge pull request #451 from zong-zhe/kcl-mod-doc
feat: add doc for include and exclude in package section
2 parents 1732bb2 + e972c36 commit 8af0bce

File tree

6 files changed

+114
-6
lines changed
  • docs/user_docs/guides/package-management/4-how-to
  • i18n/zh-CN/docusaurus-plugin-content-docs
    • current/user_docs/guides/package-management/4-how-to
    • version-0.10/user_docs/guides/package-management/4-how-to
    • version-0.9/user_docs/guides/package-management/4-how-to
  • versioned_docs
    • version-0.10/user_docs/guides/package-management/4-how-to
    • version-0.9/user_docs/guides/package-management/4-how-to

6 files changed

+114
-6
lines changed

docs/user_docs/guides/package-management/4-how-to/8-kcl_mod.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@ In the MVP version, the sections we plan to support are as follows:
1212
- [version](#package) — The version of the package.
1313
- [edition](#package) — The KCL compiler edition.
1414
- [description](#package) — The description of the package.
15+
- [include](#package) - The include file paths when packaging and publishing.
16+
- [exclude](#package) - The exclude file paths when packaging and publishing.
1517
- Dependency tables:
1618
- [dependencies](#dependencies) - Package library dependencies.
1719
- Compiler settings:
18-
- [profile] - The compiler settings.
20+
- profile - The compiler settings.
1921
- [entries](#entries) - The entry points of the package when compiling.
2022

2123
## package
2224

2325
The first section in a `kcl.mod` is [package].
2426

25-
```
27+
```toml
2628
[package]
2729
name = "hello_world" # the name of the package
2830
version = "0.1.0" # the current version, obeying semver
2931
edition = "0.5.0" # the KCL compiler version
3032
description = "This is a hello world package." # the description of the package
33+
include = ["src/", "README.md", "LICENSE"] # the include file paths when packaging and publishing
34+
exclude = ["target/", ".git/", "*.log"] # the exclude file paths when packaging and publishing
3135
```
3236

3337
## dependencies

i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/8-kcl_mod.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- [version](#package) — 包的版本。
1313
- [edition](#package) — KCL 编译器版本。
1414
- [description](#package) — 包的描述。
15+
- [include](#include) - 在打包和发布时包含的文件。
16+
- [exclude](#exclude) - 在打包和发布时排除的文件。
1517
- 依赖表:
1618
- [dependencies](#dependencies) - 包库依赖项。
1719
- 编译器设置:
@@ -72,6 +74,36 @@ edition = "0.5.0"
7274
description = "This is my package."
7375
```
7476

77+
### 2.5. include
78+
79+
你可以使用 `include` 字段指定打包和发布时包含的文件。
80+
81+
`include``package` 部分的字段。
82+
83+
```toml
84+
[package]
85+
name = "hello_world"
86+
version = "0.1.0"
87+
edition = "0.5.0"
88+
description = "This is a hello world package."
89+
include = ["src/", "README.md", "LICENSE"] # 打包和发布时包含的文件
90+
```
91+
92+
### 2.6. exclude
93+
94+
你可以使用 `exclude` 字段指定打包和发布时排除的文件。
95+
96+
`exclude``package` 部分的字段。
97+
98+
```toml
99+
[package]
100+
name = "hello_world"
101+
version = "0.1.0"
102+
edition = "0.5.0"
103+
description = "This is a hello world package."
104+
exclude = ["target/", ".git/", "*.log"] # 打包和发布时排除的文件
105+
```
106+
75107
## 3. dependencies
76108

77109
你的 kcl 包可以依赖于来自 OCI 仓库、Git 存储库或本地文件系统子目录的其他库。

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- [version](#package) — 包的版本。
1313
- [edition](#package) — KCL 编译器版本。
1414
- [description](#package) — 包的描述。
15+
- [include](#include) - 在打包和发布时包含的文件。
16+
- [exclude](#exclude) - 在打包和发布时排除的文件。
1517
- 依赖表:
1618
- [dependencies](#dependencies) - 包库依赖项。
1719
- 编译器设置:
@@ -72,6 +74,36 @@ edition = "0.5.0"
7274
description = "This is my package."
7375
```
7476

77+
### 2.5. include
78+
79+
你可以使用 `include` 字段指定打包和发布时包含的文件。
80+
81+
`include``package` 部分的字段。
82+
83+
```toml
84+
[package]
85+
name = "hello_world"
86+
version = "0.1.0"
87+
edition = "0.5.0"
88+
description = "This is a hello world package."
89+
include = ["src/", "README.md", "LICENSE"] # 打包和发布时包含的文件
90+
```
91+
92+
### 2.6. exclude
93+
94+
你可以使用 `exclude` 字段指定打包和发布时排除的文件。
95+
96+
`exclude``package` 部分的字段。
97+
98+
```toml
99+
[package]
100+
name = "hello_world"
101+
version = "0.1.0"
102+
edition = "0.5.0"
103+
description = "This is a hello world package."
104+
exclude = ["target/", ".git/", "*.log"] # 打包和发布时排除的文件
105+
```
106+
75107
## 3. dependencies
76108

77109
你的 kcl 包可以依赖于来自 OCI 仓库、Git 存储库或本地文件系统子目录的其他库。

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
- [version](#package) — 包的版本。
1313
- [edition](#package) — KCL 编译器版本。
1414
- [description](#package) — 包的描述。
15+
- [include](#include) - 在打包和发布时包含的文件。
16+
- [exclude](#exclude) - 在打包和发布时排除的文件。
1517
- 依赖表:
1618
- [dependencies](#dependencies) - 包库依赖项。
1719
- 编译器设置:
@@ -72,6 +74,36 @@ edition = "0.5.0"
7274
description = "This is my package."
7375
```
7476

77+
### 2.5. include
78+
79+
你可以使用 `include` 字段指定打包和发布时包含的文件。
80+
81+
`include``package` 部分的字段。
82+
83+
```toml
84+
[package]
85+
name = "hello_world"
86+
version = "0.1.0"
87+
edition = "0.5.0"
88+
description = "This is a hello world package."
89+
include = ["src/", "README.md", "LICENSE"] # 打包和发布时包含的文件
90+
```
91+
92+
### 2.6. exclude
93+
94+
你可以使用 `exclude` 字段指定打包和发布时排除的文件。
95+
96+
`exclude``package` 部分的字段。
97+
98+
```toml
99+
[package]
100+
name = "hello_world"
101+
version = "0.1.0"
102+
edition = "0.5.0"
103+
description = "This is a hello world package."
104+
exclude = ["target/", ".git/", "*.log"] # 打包和发布时排除的文件
105+
```
106+
75107
## 3. dependencies
76108

77109
你的 kcl 包可以依赖于来自 OCI 仓库、Git 存储库或本地文件系统子目录的其他库。

versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/8-kcl_mod.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@ In the MVP version, the sections we plan to support are as follows:
1212
- [version](#package) — The version of the package.
1313
- [edition](#package) — The KCL compiler edition.
1414
- [description](#package) — The description of the package.
15+
- [include](#package) - The include file paths when packaging and publishing.
16+
- [exclude](#package) - The exclude file paths when packaging and publishing.
1517
- Dependency tables:
1618
- [dependencies](#dependencies) - Package library dependencies.
1719
- Compiler settings:
18-
- [profile] - The compiler settings.
20+
- profile - The compiler settings.
1921
- [entries](#entries) - The entry points of the package when compiling.
2022

2123
## package
2224

2325
The first section in a `kcl.mod` is [package].
2426

25-
```
27+
```toml
2628
[package]
2729
name = "hello_world" # the name of the package
2830
version = "0.1.0" # the current version, obeying semver
2931
edition = "0.5.0" # the KCL compiler version
3032
description = "This is a hello world package." # the description of the package
33+
include = ["src/", "README.md", "LICENSE"] # the include file paths when packaging and publishing
34+
exclude = ["target/", ".git/", "*.log"] # the exclude file paths when packaging and publishing
3135
```
3236

3337
## dependencies

versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/8-kcl_mod.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@ In the MVP version, the sections we plan to support are as follows:
1212
- [version](#package) — The version of the package.
1313
- [edition](#package) — The KCL compiler edition.
1414
- [description](#package) — The description of the package.
15+
- [include](#package) - The include file paths when packaging and publishing.
16+
- [exclude](#package) - The exclude file paths when packaging and publishing.
1517
- Dependency tables:
1618
- [dependencies](#dependencies) - Package library dependencies.
1719
- Compiler settings:
18-
- [profile] - The compiler settings.
20+
- profile - The compiler settings.
1921
- [entries](#entries) - The entry points of the package when compiling.
2022

2123
## package
2224

2325
The first section in a `kcl.mod` is [package].
2426

25-
```
27+
```toml
2628
[package]
2729
name = "hello_world" # the name of the package
2830
version = "0.1.0" # the current version, obeying semver
2931
edition = "0.5.0" # the KCL compiler version
3032
description = "This is a hello world package." # the description of the package
33+
include = ["src/", "README.md", "LICENSE"] # the include file paths when packaging and publishing
34+
exclude = ["target/", ".git/", "*.log"] # the exclude file paths when packaging and publishing
3135
```
3236

3337
## dependencies

0 commit comments

Comments
 (0)