Skip to content

Commit b443018

Browse files
authored
docs: Fix to use startProfile() and run KCL examples (#7792)
* docs: Fix to use startProfile() * Fix to run KCL examples in docs * Update docs and images
1 parent a00f566 commit b443018

File tree

7 files changed

+17
-15
lines changed

7 files changed

+17
-15
lines changed

docs/kcl-lang/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Array types can also include length information: `[T; n]` denotes an array of le
2222

2323
Ranges are a succinct way to create an array of sequential numbers. The syntax is `[start .. end]` where `start` and `end` evaluate to whole numbers (integers). Ranges are inclusive of the start and end. The end must be greater than the start. A range which is exclusive of its end is written with `<end`. Examples:
2424

25-
```kcl,norun
25+
```kcl
2626
[0..3] // [0, 1, 2, 3]
2727
[3..10] // [3, 4, 5, 6, 7, 8, 9, 10]
2828
[3..<10] // [3, 4, 5, 6, 7, 8, 9]

docs/kcl-lang/pipelines.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ This helps keep your code neat and avoid unnecessary declarations.
4242

4343
Say you have a long pipeline of sketch functions, like this:
4444

45-
```norun
45+
```kcl
4646
startSketchOn(XZ)
47+
|> startProfile(at = [0, 0])
4748
|> line(%, end = [3, 4])
4849
|> line(%, end = [10, 10])
4950
|> line(%, end = [-13, -14])
@@ -57,10 +58,11 @@ If a function call uses an unlabeled first parameter, it will default to `%` if
5758
means that `|> line(%, end = [3, 4])` and `|> line(end = [3, 4])` are equivalent! So the above
5859
could be rewritten as
5960

60-
```norun
61+
```kcl
6162
startSketchOn(XZ)
62-
|> line(end = [3, 4])
63-
|> line(end = [10, 10])
64-
|> line(end = [-13, -14])
65-
|> close()
63+
|> startProfile(at = [0, 0])
64+
|> line(end = [3, 4])
65+
|> line(end = [10, 10])
66+
|> line(end = [-13, -14])
67+
|> close()
6668
```

docs/kcl-lang/types.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ arrays can hold objects and vice versa.
1313

1414
Constants are defined with a name and a value, like so:
1515

16-
```
16+
```kcl
1717
myBool = false
1818
```
1919

@@ -24,7 +24,7 @@ Currently you cannot redeclare a constant.
2424

2525
An object is defined with `{}` braces. Here is an example object:
2626

27-
```
27+
```kcl
2828
myObj = { a = 0, b = "thing" }
2929
```
3030

@@ -49,9 +49,9 @@ Tags are used to give a name (tag) to a specific path.
4949
The syntax for declaring a tag is `$myTag` you would use it in the following
5050
way:
5151

52-
```norun
52+
```kcl
5353
startSketchOn(XZ)
54-
|> startProfile(at = origin)
54+
|> startProfile(at = [0, 0])
5555
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
5656
|> angledLine(
5757
angle = segAng(rectangleSegmentA001) - 90,
@@ -97,7 +97,7 @@ use the tag `rectangleSegmentA001` in any function or expression in the file.
9797

9898
However if the code was written like this:
9999

100-
```norun
100+
```kcl
101101
fn rect(origin) {
102102
return startSketchOn(XZ)
103103
|> startProfile(at = origin)
@@ -127,7 +127,7 @@ However you likely want to use those tags somewhere outside the `rect` function.
127127
Tags are accessible through the sketch group they are declared in.
128128
For example the following code works.
129129

130-
```norun
130+
```kcl
131131
fn rect(origin) {
132132
return startSketchOn(XZ)
133133
|> startProfile(at = origin)

docs/kcl-std/functions/std-sketch-getNextAdjacentEdge.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Loading
Loading

0 commit comments

Comments
 (0)