Skip to content

Commit e3d692d

Browse files
authored
Merge pull request #516 from eliasp/typos-and-wording
Clean-up for wording, typos, grammar, etc.
2 parents 582281d + 6d6959f commit e3d692d

File tree

13 files changed

+60
-41
lines changed

13 files changed

+60
-41
lines changed

docs/community/release-policy/kcl.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ The KCL project version release strategy is as follows:
3030
- Testing and Feedback: Before releasing the feature, allow some peers/users to try and test these new features through written documentation rather than oral descriptions. Receive feedback and make improvements.
3131
- Release and Announcements: Write Release Notes, PR articles, interpret scenarios and new features, and promote through various channels.
3232

33-
> Note: All the above information is public and should be made available for all community developers to participate, discuss, and contribute.
33+
> **NOTE:**
34+
> All the above information is public and should be made available for all community developers to participate, discuss, and contribute.

docs/reference/lang/codelab/schema.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ nginx = Deployment {
159159

160160
## 5. Write More Complex Logic in Schema
161161

162-
Suppose we have some schema logic, we can wrapper it into schema:
162+
Suppose we have some schema logic, we can wrap it into a schema:
163163

164164
```python
165165
schema Deployment[priority]:
@@ -426,7 +426,7 @@ schema Volume:
426426
hostPath: str
427427
```
428428

429-
Since the attributes defined by the schema are **required** by default, the verification that judges that the variable cannot be None/Undefined can be omitted.
429+
Since the attributes defined by the schema are **required** by default, no check to ensure they are not `None`/`Undefined` is needed.
430430

431431
```python
432432
schema Volume:
@@ -474,7 +474,7 @@ Stderr:
474474
Schema check is failed to check condition: regex.match(image, "^[a-zA-Z]+:\d+\.\d+\.\d+$"), "image name should be like 'nginx:1.14.2'"
475475
```
476476

477-
> The verification capability of KCL covers the verification defined by Openapi so that we can write any API verifications through KCL.
477+
> The verification capability of KCL covers the verification defined by OpenAPI so that we can write any API verifications through KCL.
478478
479479
## 9. Create New Schema via Schema Inheritance
480480

@@ -485,7 +485,7 @@ Usually, schema Deployment will be used in multiple scenarios. We can directly u
485485
For example, we can use the Deployment schema as a basis, to define the nginx's base schema, and extend the definition
486486
in each scenario.
487487

488-
In this case, we define some commonly used attributes. Please note that we mark the name to be immutable with the 'final' keyword to prevent it from being overwritten.
488+
In this case, we define some commonly used attributes. Please note that to prevent the attribut `name` from being overwritten as immutable by assigning its final value.
489489

490490
```python
491491
schema Nginx(Deployment):
@@ -604,7 +604,8 @@ mixin PersistentVolumeClaimMixin for PVCProtocol:
604604
}
605605
```
606606
607-
> Note: for the `k8s.api.core.v1` import to work, we need to initialize a module and add the `k8s` module as a dependency:
607+
> **NOTE:**
608+
> For the `k8s.api.core.v1` import to work, we need to initialize a module and add the `k8s` module as a dependency:
608609
>
609610
> ```bash
610611
> kcl mod init

docs/reference/lang/codelab/simple.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ image: nginx:1.14.2
108108
service: my-service
109109
```
110110

111-
.. note::
112-
KCL has rich support of operators and string member functions, please read manual and specification for more details.
111+
> **NOTE:**
112+
> KCL has rich support of operators and string member functions, please read the manual and specification for more details.
113113

114114
## 4. Write Collections
115115

@@ -183,8 +183,8 @@ else:
183183
cpu = _cpu
184184
memory = _cpu * 2
185185
_command = ["nginx"] # a list
186-
_command = _command + ["-f", "file"] # Append items into command using + operator to contact two lists
187-
command = [c.lower() for c in _command] # Take each element in the list to lowercase
186+
_command = _command + ["-f", "file"] # Append items into command using + operator to concatenate two lists
187+
command = [c.lower() for c in _command] # Convert each element in the list to lowercase
188188
_labels = {
189189
run = "my-nginx"
190190
if _env:

docs/reference/lang/spec/kcl-spec.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ description: KCL Spec
1010

1111
### Keywords and reserved words
1212

13-
The following are the keywords of the KCL:
13+
The following identifiers are used as reserved words, or keywords of the language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:
1414

15-
```python
15+
```
1616
True False None Undefined import
1717
and or in is not
1818
as if else elif for
@@ -21,9 +21,9 @@ all any map filter lambda
2121
rule
2222
```
2323

24-
The following are reserved words for the KCL:
24+
The following tokens are not used, but they are reserved as possible future keywords:
2525

26-
```python
26+
```
2727
pass return validate rule flow
2828
def del raise except try
2929
finally while from with yield
@@ -32,13 +32,13 @@ global nonlocal struct class final
3232

3333
### Line comment
3434

35-
```python
35+
```
3636
# a comment
3737
```
3838

3939
### Operators
4040

41-
```python
41+
```
4242
+ - * ** / // %
4343
<< >> & | ^ < >
4444
~ <= >= == != =
@@ -48,7 +48,7 @@ global nonlocal struct class final
4848

4949
### Delimiters
5050

51-
```python
51+
```
5252
( ) [ ] { }
5353
, : . ; @
5454
```
@@ -76,7 +76,7 @@ The following list of operators is ordered from **highest to lowest**:
7676

7777
## Grammar
7878

79-
KCL uses Python's [LarkParser](https://lark-parser.readthedocs.io/en/latest/) tool to describe the grammar, and the specification rules are as follows:
79+
KCL uses the Python-based [LarkParser](https://lark-parser.readthedocs.io/en/latest/) tool to describe the grammar, and the specification rules are as follows:
8080

8181
```bnf
8282
//////////// KCL grammar ////////////

docs/reference/lang/spec/lexical.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ A physical line is a sequence of characters end with a line termination sequence
5656

5757
To join multiple physical lines into one logical line, the `\` character can be used. The character should be the last none-space character in each physical line except the very last line.
5858

59-
> **note**
60-
>
59+
> **NOTE:**
6160
> Any character except the ASCII space, tab (`\t`) and formfeed (`\f`) is considered a none-space character.
6261
6362
- A line ending in a backslash cannot carry a comment (, which will be introduced shortly afterwards).

docs/reference/lang/spec/schema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ The result is a **dict**:
527527
{
528528
'person': {
529529
'name': {
530-
'firstName': 'Jhon',
530+
'firstName': 'John',
531531
'lastName': 'Doe'
532532
}
533533
}
@@ -640,7 +640,7 @@ The result is a **dict**:
640640
'JohnDoe': {
641641
'firstName': 'John'
642642
'lastName': 'Doe'
643-
'fullName': 'John Doe'
643+
'fullName': 'John_Doe'
644644
'subject': 'CS'
645645
}
646646
}

docs/reference/lang/spec/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spam = "ham"
3636
spam = "eggs" # Error: The immutability rule is violated!
3737
```
3838

39-
- A variable starts with the `_` character is mutable.
39+
- A variable starting with the `_` character is mutable.
4040

4141
```python
4242
_spam

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Install the dependency
1818
npm install buffer @wasmer/wasi @kcl-lang/wasm-lib
1919
```
2020

21-
> Note: buffer is required by @wasmer/wasi.
21+
> **NOTE:**
22+
> Buffer is required by @wasmer/wasi.
2223
2324
Write the code
2425

@@ -43,7 +44,8 @@ main();
4344

4445
Here, we use `webpack` to bundle the website, the `webpack.config.js` config as follows.
4546

46-
> Note: This configuration includes necessary settings for @wasmer/wasi and other required plugins.
47+
> **NOTE:**:
48+
> This configuration includes necessary settings for @wasmer/wasi and other required plugins.
4749
4850
```js
4951
const HtmlWebpackPlugin = require("html-webpack-plugin");

docs/user_docs/concepts/package-and-module.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Within a **module**, KCL organizes files grouped by **package**. A package can b
1010

1111
A KCL module contains a configuration laid out in a directory hierarchy. It contains everything that is needed to deterministically determine the outcome of a KCL configuration. The root of this directory is marked by containing a `kcl.mod` directory. The contents of this directory are mostly managed by the kcl tool such as `kpm`, etc. In that sense, `kcl.mod` is analogous to the `.git` directory marking the root directory of a repo, but where its contents are mostly managed by the git tool. Besides, a KCL module is the largest unit of the file organization, has a fixed location of all KCL files and dependencies.
1212

13-
> Note: The use of a KCL module e.g., `kcl.mod` is optional, but required if one wants to manage, distribute, share and reuse code with a semantic version.
13+
> **NOTE:**
14+
> The use of a KCL module e.g., `kcl.mod` is optional, but required if one wants to manage, distribute, share and reuse code with a semantic version.
1415
1516
### Creating a module
1617

@@ -140,7 +141,8 @@ kcl_cli_configs:
140141
kcl -Y kcl.yaml
141142
```
142143

143-
> Note: If we do not specify any input files for KCL, KCL will find the default `kcl.yaml` from the command line execution path to read the input file. Besides, if we tell KCL both the input files and the compilation setting file, KCL will take input files entered by the user as the final value.
144+
> **NOTE:**
145+
> If we do not specify any input files for KCL, KCL will find the default `kcl.yaml` from the command line execution path to read the input file. Besides, if we tell KCL both the input files and the compilation setting file, KCL will take input files entered by the user as the final value.
144146

145147
```bash
146148
# Whether the 'files' field is configured in `kcl.yaml` or not, the final value of input files is ["file1.k", "file2.k"]

docs/user_docs/guides/ci-integration/1-github-actions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ sidebar_label: Github Actions
99

1010
In the GitOps section, we have introduced how to integrate KCL with GitOps. In this section, we will continue to provide sample solutions for KCL and CI integrations. We hope to implement the end-to-end application development process by using containers, Continuous Integration (CI) for generation, and GitOps for Continuous Deployment (CD). In this scheme, we use a **Flask application** and **Github Actions** as examples.
1111

12-
> Note: You can use any containerized application and different CI systems such as **Gitlab CI**, **Jenkins CI**, etc. in this solution.
12+
> **NOTE:**
13+
> You can use any containerized application and different CI systems such as **Gitlab CI**, **Jenkins CI**, etc. in this solution.
1314
1415
The overall workflow is as follows:
1516

docs/user_docs/guides/ci-integration/2-gitlab-ci.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ sidebar_label: Gitlab CI
99

1010
In the GitOps section, we have introduced how to integrate KCL with GitOps. In this section, we will continue to provide sample solutions for KCL and CI integrations. We hope to implement the end-to-end application development process by using containers, Continuous Integration (CI) for generation, and GitOps for Continuous Deployment (CD). In this scheme, we use a **Flask application** and **Gitlab CI** as examples.
1111

12-
> Note: You can use any containerized application and different CI systems such as **Github Actions**, **Jenkins CI**, etc. in this solution.
12+
> **NOTE:**
13+
> You can use any containerized application and different CI systems such as **Github Actions**, **Jenkins CI**, etc. in this solution.
1314
1415
The overall workflow is as follows:
1516

docs/user_docs/support/faq-kcl.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ bob = Person {
7373
}
7474
```
7575

76-
> Note: All KCL variables can be assigned the null value `None` and the undefined value `Undefined`.
76+
> **NOTE:**
77+
> All KCL variables can be assigned the null value `None` and the undefined value `Undefined`.
7778
7879
## 3. What do some KCL variable names prefixed with `_` underscore mean? What's the difference between without the `_` underscore prefix? In what scenarios are they suitable for use?
7980

@@ -172,7 +173,8 @@ _args = [*_args, "end"] # Add elements "end" to the end of the list: ["a", "b",
172173
_args = ["start", *_args] # Add elements "start" to the head of the list: ["start", "a", "b", "x", "c", "end"]
173174
```
174175

175-
> Note: When the consecutive variables are `None/Undefined`, using `+` may cause an error, then we can use the list unpacking operator `*` or use the `or` operator to take the default value of the list to avoid null values judge.
176+
> **NOTE:**
177+
> When the consecutive variables are `None/Undefined`, using `+` may cause an error, then we can use the list unpacking operator `*` or use the `or` operator to take the default value of the list to avoid null values judge.
176178

177179
```python
178180
data1 = [1, 2, 3]
@@ -383,7 +385,8 @@ success = True
383385
_result = "success" if success else "failed"
384386
```
385387

386-
> Note: When writing an if-elif-else block statement, pay attention to the colon `:` after the if condition and keep the indentation consistent.
388+
> **NOTE:**
389+
> When writing an if-elif-else block statement, pay attention to the colon `:` after the if condition and keep the indentation consistent.
387390

388391
In addition, conditional expressions can also be written directly in a list or dict (the difference is that the value to be written in the if expression written in the structure is not a statement):
389392

@@ -964,7 +967,8 @@ employee:
964967
nationality: China
965968
```
966969

967-
> Note: KCL only allows schema single inheritance.
970+
> **NOTE:**
971+
> KCL only allows schema single inheritance.
968972

969973
## 24. How to reuse schema logic through composition?
970974

@@ -1037,7 +1041,8 @@ import ..service # Relative path import, parent directory
10371041
import ...root # Relative path import, parent directory of parent directory
10381042
```
10391043

1040-
> Note that for KCL's entry file `main.k`, it cannot import the folder where it is located, otherwise a circular import error will occur:
1044+
> **NOTE:**
1045+
> For KCL's entry file `main.k`, it cannot import the folder where it is located, otherwise a circular import error will occur:
10411046

10421047
```python
10431048
import model # Error: recursively loading
@@ -1122,7 +1127,8 @@ The continue second line\
11221127
"""
11231128
```
11241129

1125-
Note: Use the line continuation character `\` while maintaining indentation, as follows:
1130+
> **NOTE:**
1131+
> Use the line continuation character `\` while maintaining indentation, as follows:
11261132

11271133
- Error use case:
11281134

@@ -1192,7 +1198,8 @@ theFirstItem = data[0] # Get the element with index 0 in the list, that is, the
11921198
theSecondItem = data[1] # Get the element with index 1 in the list, which is the first element 2
11931199
```
11941200

1195-
> Note: The value of the index cannot exceed the length of the list, otherwise an error will occur, we can use the `len` function to get the length of the list.
1201+
> **NOTE:**
1202+
> The value of the index cannot exceed the length of the list, otherwise an error will occur, we can use the `len` function to get the length of the list.
11961203

11971204
```python
11981205
data = [1, 2, 3]
@@ -1271,7 +1278,8 @@ data2 = data["contains.dot"] # "value3"
12711278
# Note that this is wrong: data3 = data.contains.dot
12721279
```
12731280

1274-
> Note: The above sub-element operators cannot operate on values of non-list/dict/schema collection types, such as integers, nulls, etc.
1281+
> **NOTE:**
1282+
> The above sub-element operators cannot operate on values of non-list/dict/schema collection types, such as integers, nulls, etc.
12751283

12761284
```python
12771285
data = 1
@@ -1363,7 +1371,8 @@ if: 1
13631371
else: s
13641372
```
13651373
1366-
> Note: Prefixing non-keyword identifiers with `$` has the same effect as not adding.
1374+
> **NOTE:**
1375+
> Prefixing non-keyword identifiers with `$` has the same effect as not adding.
13671376

13681377
```python
13691378
_a = 1
@@ -1386,7 +1395,8 @@ int: 1
13861395
str: 2
13871396
```
13881397
1389-
> Note: If there are no special requirements, it is not recommended that the names of variables take these built-in types, because in some languages, they exist as keywords.
1398+
> **NOTE:**
1399+
> If there are no special requirements, it is not recommended that the names of variables take these built-in types, because in some languages, they exist as keywords.
13901400
13911401
## 33. How to implement enumeration in KCL?
13921402
@@ -1564,7 +1574,8 @@ data = { # The merged writing order of the same attribute labels does not affect
15641574
} # The final data value is {"labels": {"key1": "value1", "key2": "value2"}}
15651575
```
15661576

1567-
Note: The merge attribute operator will check the merged values ​​for conflicts, and report an error when the configuration values ​​that need to be merged conflict.
1577+
> **NOTE:**
1578+
> The merge attribute operator will check the merged values for conflicts and report an error when the configuration values that need to be merged conflict.
15681579
15691580
```python
15701581
data = {

docs/user_docs/support/faq-yaml.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ string2: 'here''s to "quotes"'
1717
string3: here's to "quotes"
1818
```
1919
20-
> Note: KCL's strategy for outputting YAML strings is to output unquoted strings or double-quoted strings preferentially when single quotes appear in the string content, and output single-quoted strings in other cases to avoid the burden of understanding.
20+
> **NOTE:**
21+
> KCL's strategy for outputting YAML strings is to output unquoted strings or double-quoted strings preferentially when single quotes appear in the string content, and output single-quoted strings in other cases to avoid the burden of understanding.
2122
2223
For more details, please refer to [YAML Spec v1.2](https://yaml.org/spec/1.2.1/)
2324

0 commit comments

Comments
 (0)