Skip to content

Commit 54561a2

Browse files
committed
feat: add yaml.dump_all_to_file documents and format all documents
Signed-off-by: peefy <xpf6677@163.com>
1 parent d8b13b0 commit 54561a2

File tree

22 files changed

+86
-24
lines changed

22 files changed

+86
-24
lines changed

docs/reference/model/yaml.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ dump_to_file(
5757

5858
Serialize a KCL object `data` to a YAML formatted str and write it into the file `filename`.
5959

60+
## dump_to_file
61+
62+
```python
63+
dump_all_to_file(
64+
data: [any],
65+
filename: str,
66+
ignore_private: bool = False,
67+
ignore_none: bool = False
68+
) -> None
69+
```
70+
71+
Serialize a sequence of KCL objects into a YAML stream str and write it into the file `filename`.
72+
6073
## validate
6174

6275
```python

docs/user_docs/guides/package-management/4-how-to/10-kpm_git.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ More Details - [Download Private Repository Using Git](https://docs.github.com/e
1616

1717
## Add a Git Repository as a Dependency
1818

19-
You can use `kcl mod add` to add a Git repository as a dependency to the KCL package.
19+
You can use `kcl mod add` to add a Git repository as a dependency to the KCL package.
2020

2121
Take `https://github.com/kcl-lang/konfig` as an example. The command is as follows:
2222

@@ -26,13 +26,11 @@ kcl mod add git://github.com/kcl-lang/konfig --commit 78ba6e9 # Add a Git reposi
2626
kcl mod add git://github.com/kcl-lang/konfig --branch main # Add a Git repository with a branch
2727
```
2828

29-
The way shown above is to add a Git repository as a dependency with Https protocol.
29+
The way shown above is to add a Git repository as a dependency with Https protocol.
3030
You can also use the `ssh` protocol or some other protocols to add a Git repository as a dependency as follows:
3131

3232
```shell
3333
kcl mod add --git https://github.com/kcl-lang/konfig --tag v0.4.0 # Add a Git repository with a tag and Https protocol
3434
kcl mod add --git https://github.com/kcl-lang/konfig --branch main # Add a Git repository with a branch and Https protocol
3535
kcl mod add --git ssh://github.com/kcl-lang/konfig --commit 78ba6e9 # Add a Git repository with a commit and ssh protocol
3636
```
37-
38-

docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The default content of the configuration file is as follows:
4343
```json
4444
{
4545
"DefaultOciRegistry": "ghcr.io",
46-
"DefaultOciRepo": "kcl-lang",
46+
"DefaultOciRepo": "kcl-lang"
4747
}
4848
```
4949

i18n/zh-CN/docusaurus-plugin-content-blog/2024-08-29-kubecon2024/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ KCL 和 kusionstack 社区也同 crossplane 社区的同时进行了令人开心
8686
- [Kusion Github 仓库](https://github.com/KusionStack/kusion)
8787
- [Konfig Github 仓库](https://github.com/KusionStack/konfig)
8888

89-
欢迎加入我们的社区进行交流 👏👏👏:[https://github.com/kcl-lang/community](https://github.com/kcl-lang/community)
89+
欢迎加入我们的社区进行交流 👏👏👏:[https://github.com/kcl-lang/community](https://github.com/kcl-lang/community)

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/yaml.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ dump_to_file(
5858

5959
将 KCL 对象 `data` 序列化为 YAML 格式的字符串,并将其写入文件 `filename` 中。
6060

61+
## dump_to_file
62+
63+
```python
64+
dump_all_to_file(
65+
data: [any],
66+
filename: str,
67+
ignore_private: bool = False,
68+
ignore_none: bool = False
69+
) -> None
70+
```
71+
72+
将 KCL 对象列表序列化为 YAML Stream 格式,并将其写入文件 `filename` 中。
73+
6174
## validate
6275

6376
```python

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`,
4343
```json
4444
{
4545
"DefaultOciRegistry": "ghcr.io",
46-
"DefaultOciRepo": "kcl-lang",
46+
"DefaultOciRepo": "kcl-lang"
4747
}
4848
```
4949

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/base64.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ weight: 100
1414

1515
## decode
1616

17-
`decode(value: str, encoding: str = "utf-8") -> str`
17+
`decode(value: str) -> str`
1818

19-
使用注册的编码器对字符串 `value` 进行解码
19+
使用注册的编码器对字符串 `value` 进行解码,解码的结果是一个 utf8 字符串

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/crypto.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ weight: 100
4242

4343
使用注册编码器和 `SHA512` 算法对字符串 `value` 进行加密。
4444

45+
## blake3
46+
47+
`sha512(value: str, encoding: str = "utf-8") -> str`
48+
49+
使用注册编码器和 `BLAKE3` 算法对字符串 `value` 进行加密。
50+
4551
## uuid
4652

4753
`uuid() -> str`

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/yaml.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ dump_to_file(
5858

5959
将 KCL 对象 `data` 序列化为 YAML 格式的字符串,并将其写入文件 `filename` 中。
6060

61+
## dump_to_file
62+
63+
```python
64+
dump_all_to_file(
65+
data: [any],
66+
filename: str,
67+
ignore_private: bool = False,
68+
ignore_none: bool = False
69+
) -> None
70+
```
71+
72+
将 KCL 对象列表序列化为 YAML Stream 格式,并将其写入文件 `filename` 中。
73+
6174
## validate
6275

6376
```python

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`,
4343
```json
4444
{
4545
"DefaultOciRegistry": "ghcr.io",
46-
"DefaultOciRepo": "kcl-lang",
46+
"DefaultOciRepo": "kcl-lang"
4747
}
4848
```
4949

0 commit comments

Comments
 (0)