Skip to content

Commit 43ea67a

Browse files
docs: Turtle.js.get_JavaScript - Adding example and notice ( Fixes #324 )
1 parent 8c0c2f0 commit 43ea67a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Types/Turtle.js/get_JavaScript.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99
These are portions of the class.
1010
1111
To create our class, we simply join these properties together, and output a javascript object.
12+
.NOTES
13+
This is an experimental feature and is subject to change and improvement.
14+
.EXAMPLE
15+
$turtleJs = [PSCustomObject]@{PSTypeName='Turtle.js'}
16+
$html = @(
17+
"<html><body>"
18+
"<svg id='output' width='100%' height='100%'>"
19+
"<path id='outputPath' stroke='#4488ff' />"
20+
"</svg>"
21+
"<script>"
22+
"const turtle = $turtleJS"
23+
"turtle.go('ROTATE', 45,'forward', 42)"
24+
"document.getElementById('outputPath').setAttribute('d',turtle.pathData)"
25+
"document.getElementById('output').setAttribute('viewBox', ``0 0 `${turtle.width} `${turtle.height}`` )"
26+
"</script>"
27+
"</body></html>"
28+
) > ./TurtleTest.html
1229
#>
1330
param()
1431

0 commit comments

Comments
 (0)