Skip to content

Commit 7915e5f

Browse files
StartAutomatingStartAutomating
authored andcommitted
docs: Turtle.js.get_JavaScript - Adding example and notice ( Fixes #324 )
1 parent 43ea67a commit 7915e5f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Turtle.types.ps1xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8640,6 +8640,23 @@ return $javaScript
86408640
These are portions of the class.
86418641

86428642
To create our class, we simply join these properties together, and output a javascript object.
8643+
.NOTES
8644+
This is an experimental feature and is subject to change and improvement.
8645+
.EXAMPLE
8646+
$turtleJs = [PSCustomObject]@{PSTypeName='Turtle.js'}
8647+
$html = @(
8648+
"<html><body>"
8649+
"<svg id='output' width='100%' height='100%'>"
8650+
"<path id='outputPath' stroke='#4488ff' />"
8651+
"</svg>"
8652+
"<script>"
8653+
"const turtle = $turtleJS"
8654+
"turtle.go('ROTATE', 45,'forward', 42)"
8655+
"document.getElementById('outputPath').setAttribute('d',turtle.pathData)"
8656+
"document.getElementById('output').setAttribute('viewBox', ``0 0 `${turtle.width} `${turtle.height}`` )"
8657+
"</script>"
8658+
"</body></html>"
8659+
) > ./TurtleTest.html
86438660
#>
86448661
param()
86458662

0 commit comments

Comments
 (0)