Skip to content

Commit 5bffc9e

Browse files
authored
Merge pull request #149 from Peefy/polish-all-documents
chore: grammar check for all documents
2 parents 9e65b1a + f738dea commit 5bffc9e

File tree

126 files changed

+265
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+265
-263
lines changed

docs/reference/lang/codelab/simple.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ else:
182182
cpu = _cpu
183183
memory = _cpu * 2
184184
_command = ["nginx"] # a list
185-
_command = _command + ["-f", "file"] # Append itemsinto command using + operator to contact two lists
186-
command = [c.lower() for c in _command] # Take eachelement in the list to lowercase
185+
_command = _command + ["-f", "file"] # Append items into command using + operator to contact two lists
186+
command = [c.lower() for c in _command] # Take each element in the list to lowercase
187187
_labels = {
188188
run = "my-nginx"
189189
if _env:
@@ -375,7 +375,7 @@ import my_config
375375
print(my_config.labels) # debugging by print
376376
377377
# test
378-
assert len(my_config.labels) > 0, "labels can't beempty" # use len() to get list length
378+
assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length
379379
assert "env" in my_config.labels, "env label is a must"
380380
assert my_config.cpu >= 256, "cpu cannot be less than256"
381381
```

docs/reference/lang/spec/expressions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,9 +811,7 @@ An index expression appearing on the left side of an assignment causes the speci
811811

812812
```python
813813
a = range(3) # a == [0, 1, 2]
814-
a[2] = 7 # a == [0, 1, 7]
815-
816-
coins["suzie b"] = 100
814+
b = a[2] # 2
817815
```
818816

819817
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.

docs/reference/xlang-api/rest-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ message KclErrorInfo {
176176
}
177177
178178
// ----------------------------------------------------------------------------
179-
// service requset/response
179+
// service request/response
180180
// ----------------------------------------------------------------------------
181181
182182
// gpyrpc.BuiltinService

docs/tools/cli/kcl/fmt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ kcl-fmt your_config_path -R
2525
```
2626

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

3131
## Display of formatting files

docs/tools/cli/kcl/lint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The KCL Lint tool supports checking some warning-level defects in KCL code and s
88

99
## Example
1010

11-
### Project Struct
11+
### Project Structure
1212

1313
```text
1414
.

docs/tools/cli/openapi/quick-start.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ sidebar_position: 1
88

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

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

1519
## 1.1 go install
1620

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

29-
## 1.3 Dowload from release
33+
## 1.3 Download from release
3034

3135
```shell
3236
# 1. download the released binary from:

docs/tools/cli/openapi/spec.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ Zero or more attributes can be defined in the KCL schema. The declaration of att
9595

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

98-
| Elements of KCL Schema Attribute | Corresponding Elements in OpenAPI |
99-
| ------------------------------------------- | ------------------------------------- |
100-
| attribute annotation | Not supported. We are planning to add an extension `deprecate` field to the KCL-OpenAPI |
101-
| attribute name | The key of the property under the `property` object |
102-
| 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 |
103-
| 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)|
104-
| attribute default value | The value of the `default` field is used to set the default value for the attribute |
98+
| Elements of KCL Schema Attribute | Corresponding Elements in OpenAPI |
99+
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100+
| attribute annotation | Not supported. We are planning to add an extension `deprecate` field to the KCL-OpenAPI |
101+
| attribute name | The key of the property under the `property` object |
102+
| 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 |
103+
| 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) |
104+
| attribute default value | The value of the `default` field is used to set the default value for the attribute |
105105

106106
Example:
107107

@@ -144,19 +144,19 @@ schema Pet:
144144

145145
### Schema Index Signature
146146

147-
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:
147+
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:
148148

149149
- Type of the key in the index signature: Declared in square brackets. It must be the basic type
150150
- Type of value in the index signature: Declared after the colon in the square brackets. It can be any valid KCL type
151-
- 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.
151+
- 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.
152152
- 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
153153
- The default value of the index signature: Assign a value to the index signature as the default value
154154

155155
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.
156156

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

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

215215
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:
216216

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

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

337-
| Elements of KCL Schema Document | Corresponding Elements in OpenAPI |
337+
| Elements of KCL Schema Document | Corresponding Elements in OpenAPI |
338338
| --------------------------------------- | ------------------------------------------------------- |
339339
| Schema Description | The value of the `description` field of the data model |
340340
| Schema Attribute Doc | The value of the `description` field of the property |
@@ -411,23 +411,23 @@ schema Pet:
411411
```
412412
## Basic Data Types
413413

414-
| JSON Schema type | swagger type | KCL type | comment |
415-
| ---------------- | --------------------------- | --------------- | ----------- |
416-
| boolean | boolean | bool | |
417-
| number | number | float | |
418-
| | number format double | **unsupported** | |
419-
| | number format float | float | |
420-
| integer | integer | int (32) | |
421-
| | integer format int64 | **unsupported** | |
422-
| | integer format int32 | int (32) | |
423-
| string | string | str | |
424-
| | string format byte | str | |
425-
| | string format int-or-string | int \| str | |
426-
| | string format binay | str | |
414+
| JSON Schema type | swagger type | KCL type | comment |
415+
| ---------------- | --------------------------- | --------------- | --------------------------------------------------------------------------- |
416+
| boolean | boolean | bool | |
417+
| number | number | float | |
418+
| | number format double | **unsupported** | |
419+
| | number format float | float | |
420+
| integer | integer | int (32) | |
421+
| | integer format int64 | **unsupported** | |
422+
| | integer format int32 | int (32) | |
423+
| string | string | str | |
424+
| | string format byte | str | |
425+
| | string format int-or-string | int \| str | |
426+
| | string format binary | str | |
427427
| | string format date | unsupported | As defined by full-date - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) |
428428
| | string format date-time | unsupported | As defined by date-time - [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) |
429-
| | string format password | unsupported | for swagger: A hint to UIs to obscure input |
430-
| | datetime | datetime | |
429+
| | string format password | unsupported | for swagger: A hint to UIs to obscure input |
430+
| | datetime | datetime | |
431431

432432
## Reference
433433

docs/user_docs/guides/ci-integration/_3-jenkins-ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: github-ci
33
sidebar_label: Github CI
44
---
55

6-
Comming Soon
6+
Coming Soon
77

88
## Introduction
99

docs/user_docs/guides/package-management/2-installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ USAGE:
4040

4141
COMMANDS:
4242
init initialize new module in current directory
43-
add add new dependancy
43+
add add new dependency
4444
pkg package a kcl package into tar
4545
metadata output the resolved dependencies of a package
4646
run compile kcl package.

docs/user_docs/support/faq-yaml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ Numbers represent **explicit indentation indicators** in YAML. For long strings
6060
For example, for the following KCL code:
6161

6262
```python
63-
longStringStartWithEndline = """
63+
longStringStartWithNewline = """
6464
This is the second line
6565
This is the third line
6666
"""
6767
6868
```
6969

7070
```yaml
71-
longStringStartWithEndline: |2
71+
longStringStartWithNewline: |2
7272
7373
This is the second line
7474
This is the third line

0 commit comments

Comments
 (0)