Skip to content

Commit

Permalink
Merge pull request #149 from Peefy/polish-all-documents
Browse files Browse the repository at this point in the history
chore: grammar check for all documents
  • Loading branch information
Peefy authored Aug 31, 2023
2 parents 9e65b1a + f738dea commit 5bffc9e
Show file tree
Hide file tree
Showing 126 changed files with 265 additions and 263 deletions.
6 changes: 3 additions & 3 deletions docs/reference/lang/codelab/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ else:
cpu = _cpu
memory = _cpu * 2
_command = ["nginx"] # a list
_command = _command + ["-f", "file"] # Append itemsinto command using + operator to contact two lists
command = [c.lower() for c in _command] # Take eachelement in the list to lowercase
_command = _command + ["-f", "file"] # Append items into command using + operator to contact two lists
command = [c.lower() for c in _command] # Take each element in the list to lowercase
_labels = {
run = "my-nginx"
if _env:
Expand Down Expand Up @@ -375,7 +375,7 @@ import my_config
print(my_config.labels) # debugging by print
# test
assert len(my_config.labels) > 0, "labels can't beempty" # use len() to get list length
assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length
assert "env" in my_config.labels, "env label is a must"
assert my_config.cpu >= 256, "cpu cannot be less than256"
```
Expand Down
4 changes: 1 addition & 3 deletions docs/reference/lang/spec/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,7 @@ An index expression appearing on the left side of an assignment causes the speci

```python
a = range(3) # a == [0, 1, 2]
a[2] = 7 # a == [0, 1, 7]

coins["suzie b"] = 100
b = a[2] # 2
```

It is a dynamic error to attempt to update an element of an immutable type, such as a list or string, or a frozen value of a mutable type.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/xlang-api/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ message KclErrorInfo {
}
// ----------------------------------------------------------------------------
// service requset/response
// service request/response
// ----------------------------------------------------------------------------
// gpyrpc.BuiltinService
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/cli/kcl/fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ kcl-fmt your_config_path -R
```

* Args
* `-R|--recursive` Whether to recursively traverse subfolders
* `-R|--recursive` Whether to recursively traverse subfolder
* `-w|--fmt-output` Whether to output to STDOUT, without `-w` indicates in-place modification.

## Display of formatting files
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/cli/kcl/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The KCL Lint tool supports checking some warning-level defects in KCL code and s

## Example

### Project Struct
### Project Structure

```text
.
Expand Down
12 changes: 8 additions & 4 deletions docs/tools/cli/openapi/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ sidebar_position: 1

The kcl-openapi tool can be installed in following ways:

- [go install](#11-go-install)
- [curl|sh install (MacOS & Linux)](#12-curlsh-install-macos--linux)
- [download from release](#13-dowload-from-release)
- [Quick Start](#quick-start)
- [1. Install KCLOpenAPI Tool](#1-install-kclopenapi-tool)
- [1.1 go install](#11-go-install)
- [1.2 Curl|sh install (MacOS \& Linux)](#12-curlsh-install-macos--linux)
- [1.3 Download from release](#13-download-from-release)
- [1.4 Verify your installation](#14-verify-your-installation)
- [2. Generate KCL Files](#2-generate-kcl-files)

## 1.1 go install

Expand All @@ -26,7 +30,7 @@ If you don't have go, you can install the CLI with this one-liner:
curl -fsSL https://kcl-lang.io/script/install-kcl-openapi.sh | /bin/bash
```

## 1.3 Dowload from release
## 1.3 Download from release

```shell
# 1. download the released binary from:
Expand Down
54 changes: 27 additions & 27 deletions docs/tools/cli/openapi/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ Zero or more attributes can be defined in the KCL schema. The declaration of att

The mapping between them and the OpenAPI spec is as follows:

| Elements of KCL Schema Attribute | Corresponding Elements in OpenAPI |
| ------------------------------------------- | ------------------------------------- |
| attribute annotation | Not supported. We are planning to add an extension `deprecate` field to the KCL-OpenAPI |
| attribute name | The key of the property under the `property` object |
| attribute optional modifiers(`?`) | In each element in the `definition` object, here's an optional `required` field which lists the all the required attributes of that model, and the attributes not listed are optional |
| attribute type | The basic types can be declared by a combination of `type` and `format`, and the schema type is declared by a `$ref` to the schema definition. KCL-OpenAPI spec adds a `x-kcl-types` extension to indicate a type union. `enum` indicates a union of several literal types. For the type declartion in KCL-OpenAPI, see the chapter - [basic data types](#basic-data-types)|
| attribute default value | The value of the `default` field is used to set the default value for the attribute |
| Elements of KCL Schema Attribute | Corresponding Elements in OpenAPI |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| attribute annotation | Not supported. We are planning to add an extension `deprecate` field to the KCL-OpenAPI |
| attribute name | The key of the property under the `property` object |
| attribute optional modifiers(`?`) | In each element in the `definition` object, here's an optional `required` field which lists the all the required attributes of that model, and the attributes not listed are optional |
| attribute type | The basic types can be declared by a combination of `type` and `format`, and the schema type is declared by a `$ref` to the schema definition. KCL-OpenAPI spec adds a `x-kcl-types` extension to indicate a type union. `enum` indicates a union of several literal types. For the type declaration in KCL-OpenAPI, see the chapter - [basic data types](#basic-data-types) |
| attribute default value | The value of the `default` field is used to set the default value for the attribute |

Example:

Expand Down Expand Up @@ -144,19 +144,19 @@ schema Pet:

### Schema Index Signature

In the KCL schema, the index signatures can be used to define attributes with unfined attribute names. The KCL schema index signature contains the following elements:
In the KCL schema, the index signatures can be used to define attributes with undefined attribute names. The KCL schema index signature contains the following elements:

- Type of the key in the index signature: Declared in square brackets. It must be the basic type
- Type of value in the index signature: Declared after the colon in the square brackets. It can be any valid KCL type
- Ellipses(`...`) in the index signature: In the square brackets, before the type declaration of the key. It indicates that the index signature is only used to constrain attributes not defined in the schema. The absentation of the symbol indicates that all defined and undefined attributes in the schema are constrained by the index signature.
- Ellipses(`...`) in the index signature: In the square brackets, before the type declaration of the key. It indicates that the index signature is only used to constrain attributes not defined in the schema. The assentation of the symbol indicates that all defined and undefined attributes in the schema are constrained by the index signature.
- Alias for key in index signature: Declared in square brackets, immediately after the left square bracket and takes the form of `<name>:`. The alias can then be used to reference the index signature by name
- The default value of the index signature: Assign a value to the index signature as the default value

The index signature with its key in `string` type can be described based on the field `additionalProperties`. Other index signatures with a key in types besides `string`, and the `check` expressions used to validate the index signature are not supported by the KCL OpenAPI spec.

The mapping between them and the OpenAPI spec is as follows:

| Elements of KCL Index Signature | Corresponding Elements in OpenAPI |
| Elements of KCL Index Signature | Corresponding Elements in OpenAPI |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Type of the key in the KCL index signature | Only string type is allowed in OpenAPI |
| Type of the value in the KCL index signature | Declared by the `type` in the `additionalProperties` field |
Expand Down Expand Up @@ -214,7 +214,7 @@ working in progress

OpenAPI supports models to be declared inline. But KCL currently does not support that. The model defined inline in OpenAPI will be converted to a schema with a name in KCL. And the naming convention will be:

| element to define an inline schema in OpenAPI | the name of the corresponding KCL schema |
| element to define an inline schema in OpenAPI | the name of the corresponding KCL schema |
| --------------------------------------------- | -------------------------------------------------------------- |
| inline Property | add the Property name at the end of the outer schema Name |
| AdditionalProperties | add "AdditionalProperties" at the end of the outer schema Name |
Expand Down Expand Up @@ -334,7 +334,7 @@ KCL documents consist of module documents and schema documents. And only the sch

The mapping between them and the OpenAPI spec is as follows:

| Elements of KCL Schema Document | Corresponding Elements in OpenAPI |
| Elements of KCL Schema Document | Corresponding Elements in OpenAPI |
| --------------------------------------- | ------------------------------------------------------- |
| Schema Description | The value of the `description` field of the data model |
| Schema Attribute Doc | The value of the `description` field of the property |
Expand Down Expand Up @@ -411,23 +411,23 @@ schema Pet:
```
## Basic Data Types

| JSON Schema type | swagger type | KCL type | comment |
| ---------------- | --------------------------- | --------------- | ----------- |
| boolean | boolean | bool | |
| number | number | float | |
| | number format double | **unsupported** | |
| | number format float | float | |
| integer | integer | int (32) | |
| | integer format int64 | **unsupported** | |
| | integer format int32 | int (32) | |
| string | string | str | |
| | string format byte | str | |
| | string format int-or-string | int \| str | |
| | string format binay | str | |
| JSON Schema type | swagger type | KCL type | comment |
| ---------------- | --------------------------- | --------------- | --------------------------------------------------------------------------- |
| boolean | boolean | bool | |
| number | number | float | |
| | number format double | **unsupported** | |
| | number format float | float | |
| integer | integer | int (32) | |
| | integer format int64 | **unsupported** | |
| | integer format int32 | int (32) | |
| string | string | str | |
| | string format byte | str | |
| | string format int-or-string | int \| str | |
| | string format binary | str | |
| | string format date | unsupported | As defined by full-date - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) |
| | string format date-time | unsupported | As defined by date-time - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) |
| | string format password | unsupported | for swagger: A hint to UIs to obscure input |
| | datetime | datetime | |
| | string format password | unsupported | for swagger: A hint to UIs to obscure input |
| | datetime | datetime | |

## Reference

Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/guides/ci-integration/_3-jenkins-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: github-ci
sidebar_label: Github CI
---

Comming Soon
Coming Soon

## Introduction

Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/guides/package-management/2-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ USAGE:

COMMANDS:
init initialize new module in current directory
add add new dependancy
add add new dependency
pkg package a kcl package into tar
metadata output the resolved dependencies of a package
run compile kcl package.
Expand Down
4 changes: 2 additions & 2 deletions docs/user_docs/support/faq-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ Numbers represent **explicit indentation indicators** in YAML. For long strings
For example, for the following KCL code:

```python
longStringStartWithEndline = """
longStringStartWithNewline = """
This is the second line
This is the third line
"""
```

```yaml
longStringStartWithEndline: |2
longStringStartWithNewline: |2
This is the second line
This is the third line
Expand Down
2 changes: 1 addition & 1 deletion examples/codelab/simple/my_config_test.k
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import .my_config
print(my_config.labels) # debugging by print

# test
assert len(my_config.labels) > 0, "labels can't beempty" # use len() to get list length
assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length
assert "env" in my_config.labels, "env label is a must"
assert my_config.cpu >= 256, "cpu cannot be less than256"
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ import my_config
print(my_config.labels) # 通过打印调试
# test
assert len(my_config.labels) > 0, "labels can't beempty" # 使用 len() 得到列表长度
assert len(my_config.labels) > 0, "labels can't be empty" # 使用 len() 得到列表长度
assert "env" in my_config.labels, "env label is a must"
assert my_config.cpu >= 256, "cpu cannot be less than256"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,9 @@ An index expression appearing on the left side of an assignment causes the speci

```python
a = range(3) # a == [0, 1, 2]
a[2] = 7 # a == [0, 1, 7]
b = a[2] # 2


coins["suzie b"] = 100
```

It is a dynamic error to attempt to update an element of an immutable type, such as a list or string, or a frozen value of a mutable type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: gitlab-ci
sidebar_label: Gitlab CI
---

Comming Soon
Coming Soon

## Introduction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: github-ci
sidebar_label: Github CI
---

Comming Soon
Coming Soon

## Introduction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ USAGE:

COMMANDS:
init initialize new module in current directory
add add new dependancy
add add new dependency
pkg package a kcl package into tar
metadata output the resolved dependencies of a package
run compile kcl package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ var: 1
比如对于如下 KCL 代码:

```python
longStringStartWithEndline = """
longStringStartWithNewline = """
This is the second line
This is the third line
"""
```

```yaml
longStringStartWithEndline: |2
longStringStartWithNewline: |2
This is the second line
This is the third line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ else:
cpu = _cpu
memory = _cpu * 2
_command = ["nginx"] # a list
_command = _command + ["-f", "file"] # Append itemsinto command using + operator to contact two lists
command = [c.lower() for c in _command] # Take eachelement in the list to lowercase
_command = _command + ["-f", "file"] # Append items into command using + operator to contact two lists
command = [c.lower() for c in _command] # Take each element in the list to lowercase
_labels = {
run = "my-nginx"
if _env:
Expand Down Expand Up @@ -375,7 +375,7 @@ import my_config
print(my_config.labels) # debugging by print
# test
assert len(my_config.labels) > 0, "labels can't beempty" # use len() to get list length
assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length
assert "env" in my_config.labels, "env label is a must"
assert my_config.cpu >= 256, "cpu cannot be less than256"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,9 @@ An index expression appearing on the left side of an assignment causes the speci

```python
a = range(3) # a == [0, 1, 2]
a[2] = 7 # a == [0, 1, 7]
b = a[2] # 2


coins["suzie b"] = 100
```

It is a dynamic error to attempt to update an element of an immutable type, such as a list or string, or a frozen value of a mutable type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ var: 1
比如对于如下 KCL 代码:

```python
longStringStartWithEndline = """
longStringStartWithNewline = """
This is the second line
This is the third line
"""
```

```yaml
longStringStartWithEndline: |2
longStringStartWithNewline: |2
This is the second line
This is the third line
Expand Down
Loading

0 comments on commit 5bffc9e

Please sign in to comment.