diff --git a/docs/reference/model/yaml.md b/docs/reference/model/yaml.md index ccedfe00..e2615f58 100644 --- a/docs/reference/model/yaml.md +++ b/docs/reference/model/yaml.md @@ -57,6 +57,19 @@ dump_to_file( Serialize a KCL object `data` to a YAML formatted str and write it into the file `filename`. +## dump_to_file + +```python +dump_all_to_file( + data: [any], + filename: str, + ignore_private: bool = False, + ignore_none: bool = False +) -> None +``` + +Serialize a sequence of KCL objects into a YAML stream str and write it into the file `filename`. + ## validate ```python diff --git a/docs/user_docs/guides/package-management/4-how-to/10-kpm_git.md b/docs/user_docs/guides/package-management/4-how-to/10-kpm_git.md index e76aa29c..79a0e3b0 100644 --- a/docs/user_docs/guides/package-management/4-how-to/10-kpm_git.md +++ b/docs/user_docs/guides/package-management/4-how-to/10-kpm_git.md @@ -16,7 +16,7 @@ More Details - [Download Private Repository Using Git](https://docs.github.com/e ## Add a Git Repository as a Dependency -You can use `kcl mod add` to add a Git repository as a dependency to the KCL package. +You can use `kcl mod add` to add a Git repository as a dependency to the KCL package. Take `https://github.com/kcl-lang/konfig` as an example. The command is as follows: @@ -26,7 +26,7 @@ kcl mod add git://github.com/kcl-lang/konfig --commit 78ba6e9 # Add a Git reposi kcl mod add git://github.com/kcl-lang/konfig --branch main # Add a Git repository with a branch ``` -The way shown above is to add a Git repository as a dependency with Https protocol. +The way shown above is to add a Git repository as a dependency with Https protocol. You can also use the `ssh` protocol or some other protocols to add a Git repository as a dependency as follows: ```shell @@ -34,5 +34,3 @@ kcl mod add --git https://github.com/kcl-lang/konfig --tag v0.4.0 # Add a Git re kcl mod add --git https://github.com/kcl-lang/konfig --branch main # Add a Git repository with a branch and Https protocol kcl mod add --git ssh://github.com/kcl-lang/konfig --commit 78ba6e9 # Add a Git repository with a commit and ssh protocol ``` - - diff --git a/docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 6d58fb84..acae43b5 100644 --- a/docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ The default content of the configuration file is as follows: ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2024-08-29-kubecon2024/index.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2024-08-29-kubecon2024/index.md index 6fddbd6c..324df9d7 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-blog/2024-08-29-kubecon2024/index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2024-08-29-kubecon2024/index.md @@ -86,4 +86,4 @@ KCL 和 kusionstack 社区也同 crossplane 社区的同时进行了令人开心 - [Kusion Github 仓库](https://github.com/KusionStack/kusion) - [Konfig Github 仓库](https://github.com/KusionStack/konfig) -欢迎加入我们的社区进行交流 👏👏👏:[https://github.com/kcl-lang/community](https://github.com/kcl-lang/community) \ No newline at end of file +欢迎加入我们的社区进行交流 👏👏👏:[https://github.com/kcl-lang/community](https://github.com/kcl-lang/community) diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/yaml.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/yaml.md index f8f8384f..c3aa76ca 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/yaml.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/yaml.md @@ -58,6 +58,19 @@ dump_to_file( 将 KCL 对象 `data` 序列化为 YAML 格式的字符串,并将其写入文件 `filename` 中。 +## dump_to_file + +```python +dump_all_to_file( + data: [any], + filename: str, + ignore_private: bool = False, + ignore_none: bool = False +) -> None +``` + +将 KCL 对象列表序列化为 YAML Stream 格式,并将其写入文件 `filename` 中。 + ## validate ```python diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 470a6596..70731630 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/base64.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/base64.md index 0db738f0..37092e7c 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/base64.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/base64.md @@ -14,6 +14,6 @@ weight: 100 ## decode -`decode(value: str, encoding: str = "utf-8") -> str` +`decode(value: str) -> str` -使用注册的编码器对字符串 `value` 进行解码。 +使用注册的编码器对字符串 `value` 进行解码,解码的结果是一个 utf8 字符串 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/crypto.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/crypto.md index d72db890..243c150e 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/crypto.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/crypto.md @@ -42,6 +42,12 @@ weight: 100 使用注册编码器和 `SHA512` 算法对字符串 `value` 进行加密。 +## blake3 + +`sha512(value: str, encoding: str = "utf-8") -> str` + +使用注册编码器和 `BLAKE3` 算法对字符串 `value` 进行加密。 + ## uuid `uuid() -> str` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/yaml.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/yaml.md index f8f8384f..c3aa76ca 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/yaml.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/yaml.md @@ -58,6 +58,19 @@ dump_to_file( 将 KCL 对象 `data` 序列化为 YAML 格式的字符串,并将其写入文件 `filename` 中。 +## dump_to_file + +```python +dump_all_to_file( + data: [any], + filename: str, + ignore_private: bool = False, + ignore_none: bool = False +) -> None +``` + +将 KCL 对象列表序列化为 YAML Stream 格式,并将其写入文件 `filename` 中。 + ## validate ```python diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 470a6596..70731630 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 470a6596..70731630 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 470a6596..70731630 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 470a6596..70731630 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ KCL 包管理工具的配置文件位于 `$KCL_PKG_PATH/.kpm/config/kpm.json`, ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/versioned_docs/version-0.10/reference/model/base64.md b/versioned_docs/version-0.10/reference/model/base64.md index 3f6e617b..615b7f48 100644 --- a/versioned_docs/version-0.10/reference/model/base64.md +++ b/versioned_docs/version-0.10/reference/model/base64.md @@ -14,6 +14,6 @@ Encode the string `value` using the codec registered for encoding. ## decode -`decode(value: str, encoding: str = "utf-8") -> str` +`decode(value: str) -> str` -Decode the string `value` using the codec registered for encoding. +Decode the string `value` using the codec registered to the utf8 string for encoding. diff --git a/versioned_docs/version-0.10/reference/model/crypto.md b/versioned_docs/version-0.10/reference/model/crypto.md index 21c5d274..34d8629a 100644 --- a/versioned_docs/version-0.10/reference/model/crypto.md +++ b/versioned_docs/version-0.10/reference/model/crypto.md @@ -42,6 +42,12 @@ Encrypt the string `value` using `SHA384` and the codec registered for encoding. Encrypt the string `value` using `SHA512` and the codec registered for encoding. +## blake3 + +`blake3(value: str, encoding: str = "utf-8") -> str` + +Encrypt the string `value` using `BLAKE3` and the codec registered for encoding. + ## uuid `uuid() -> str` diff --git a/versioned_docs/version-0.10/reference/model/yaml.md b/versioned_docs/version-0.10/reference/model/yaml.md index ccedfe00..e2615f58 100644 --- a/versioned_docs/version-0.10/reference/model/yaml.md +++ b/versioned_docs/version-0.10/reference/model/yaml.md @@ -57,6 +57,19 @@ dump_to_file( Serialize a KCL object `data` to a YAML formatted str and write it into the file `filename`. +## dump_to_file + +```python +dump_all_to_file( + data: [any], + filename: str, + ignore_private: bool = False, + ignore_none: bool = False +) -> None +``` + +Serialize a sequence of KCL objects into a YAML stream str and write it into the file `filename`. + ## validate ```python diff --git a/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/10-kpm_git.md b/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/10-kpm_git.md index 58100c03..79a0e3b0 100644 --- a/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/10-kpm_git.md +++ b/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/10-kpm_git.md @@ -16,7 +16,7 @@ More Details - [Download Private Repository Using Git](https://docs.github.com/e ## Add a Git Repository as a Dependency -You can use `kcl mod add` to add a Git repository as a dependency to the KCL package. +You can use `kcl mod add` to add a Git repository as a dependency to the KCL package. Take `https://github.com/kcl-lang/konfig` as an example. The command is as follows: @@ -26,7 +26,7 @@ kcl mod add git://github.com/kcl-lang/konfig --commit 78ba6e9 # Add a Git reposi kcl mod add git://github.com/kcl-lang/konfig --branch main # Add a Git repository with a branch ``` -The way shown above is to add a Git repository as a dependency with Https protocol. +The way shown above is to add a Git repository as a dependency with Https protocol. You can also use the `ssh` protocol or some other protocols to add a Git repository as a dependency as follows: ```shell diff --git a/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 389e8dab..acae43b5 100644 --- a/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/versioned_docs/version-0.10/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -25,7 +25,7 @@ You can adjust the registry and repository name of the OCI registry by the follo ### By environment variable -You can adjust the configuration of OCI Registry by setting the three environment variables `KPM_REG`, `KPM_REGO`, and `OCI_REG_PLAIN_HTTP`. +You can adjust the configuration of OCI Registry by setting the three environment variables `KPM_REG`, `KPM_REGO`. ```shell # set default registry @@ -43,7 +43,7 @@ The default content of the configuration file is as follows: ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/versioned_docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/versioned_docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 389e8dab..2cc7ca60 100644 --- a/versioned_docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/versioned_docs/version-0.7/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ The default content of the configuration file is as follows: ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/10-kpm_git.md b/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/10-kpm_git.md index 58100c03..79a0e3b0 100644 --- a/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/10-kpm_git.md +++ b/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/10-kpm_git.md @@ -16,7 +16,7 @@ More Details - [Download Private Repository Using Git](https://docs.github.com/e ## Add a Git Repository as a Dependency -You can use `kcl mod add` to add a Git repository as a dependency to the KCL package. +You can use `kcl mod add` to add a Git repository as a dependency to the KCL package. Take `https://github.com/kcl-lang/konfig` as an example. The command is as follows: @@ -26,7 +26,7 @@ kcl mod add git://github.com/kcl-lang/konfig --commit 78ba6e9 # Add a Git reposi kcl mod add git://github.com/kcl-lang/konfig --branch main # Add a Git repository with a branch ``` -The way shown above is to add a Git repository as a dependency with Https protocol. +The way shown above is to add a Git repository as a dependency with Https protocol. You can also use the `ssh` protocol or some other protocols to add a Git repository as a dependency as follows: ```shell diff --git a/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 389e8dab..2cc7ca60 100644 --- a/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ The default content of the configuration file is as follows: ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ``` diff --git a/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 389e8dab..2cc7ca60 100644 --- a/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/versioned_docs/version-0.9/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -43,7 +43,7 @@ The default content of the configuration file is as follows: ```json { "DefaultOciRegistry": "ghcr.io", - "DefaultOciRepo": "kcl-lang", + "DefaultOciRepo": "kcl-lang" } ```