@@ -78,6 +78,32 @@ Import-Module ./ -Force -PassThru
78
78
79
79
# endregion Installation
80
80
81
+ # region Turtle PowerShell GitHub Action
82
+
83
+ @"
84
+
85
+ ### Turtle GitHub Action
86
+
87
+ Turtle has a GitHub action, and can be run in a workflow.
88
+
89
+ To use the turtle action, simply refer to this repository:
90
+
91
+ ~~~yaml
92
+ - name: UseTurtle
93
+ uses: StartAutomating/Turtle@main
94
+ ~~~
95
+
96
+ This will run any *.turtle.ps1 files found in your repository, and check in any files that have changed.
97
+
98
+ What does this give us?
99
+
100
+ **We Can Generate Turtle Graphics in GitHub Workflows**
101
+
102
+ "@
103
+
104
+ # endregion Turtle PowerShell GitHub Action
105
+
106
+
81
107
# region Getting Started
82
108
@"
83
109
### Getting Started
364
390
365
391
# endregion LSystems
366
392
393
+ # region Turtles in HTML
394
+ @"
367
395
396
+ ### Turtles in HTML
368
397
369
- # region Turtle PowerShell GitHub Action
398
+ SVG is HTML.
370
399
400
+ So, because our Turtle is built atop of an SVG path, our Turtle _is_ HTML.
401
+
402
+ Don't believe me? Try this?
403
+
404
+ ~~~PowerShell
405
+ turtle SierpinskiTriangle |
406
+ Set-Turtle Stroke '#4488ff' |
407
+ Save-Turtle ./SierpinskiTriangle.html
408
+ ~~~
409
+
410
+ Anything we do with our turtle should work within a webpage.
411
+
412
+ There are a few properties of the turtle that may be helpful:
413
+
414
+ * `.Canvas` returns the turtle rendered in an HTML canvas
415
+ * `.OffsetPath` returns the turtle as an offset path
416
+ * `.ClipPath` returns the turtle as a clip path
417
+
418
+ "@
419
+ # endregion Turtles in HTML
420
+
421
+
422
+ # region Turtles in PNG
371
423
@"
372
424
373
- ### Turtle GitHub Action
425
+ ### Turtles in Raster
374
426
375
- Turtle has a GitHub action, and can be run in a workflow .
427
+ Because our Turtle can be painted onto an HTML canvas, we can easily turn it into a raster format, like PNG .
376
428
377
- To use the turtle action, simply refer to this repository:
429
+ This works by launching the browser in headless mode, rasterizing the image, and returning the bytes.
378
430
379
- ~~~yaml
380
- - name: UseTurtle
381
- uses: StartAutomating/Turtle@main
431
+ Any turtle can be saved as a `PNG`, `JPEG`, and `WEBP`.
432
+
433
+ ~~~PowerShell
434
+ turtle SierpinskiTriangle |
435
+ Set-Turtle Stroke '#4488ff' |
436
+ Save-Turtle ./SierpinskiTriangle.png
382
437
~~~
383
438
384
- This will run any *.turtle.ps1 files found in your repository, and check in any files that have changed.
385
439
"@
440
+ # endregion Turtles in PNG
386
441
387
- # endregion Turtle PowerShell GitHub Action
442
+ # region Call To Action
443
+ @"
444
+
445
+ ### Turtles are Cool
446
+
447
+ You should now have some sense of how cool Turtle graphics can be, and how easy it is to get stared.
448
+
449
+ Play around. Draw something. Please provide feedback by filing an issue or starting a discussion.
450
+
451
+ Open an issue if you want a new shape or fractal.
452
+
453
+ File a pull request if you have some cool changes to make.
454
+
455
+ Have fun!
456
+
457
+ Hope this helps!
458
+
459
+ "@
460
+ # endregion Call To Action
388
461
389
462
390
463
# ""
0 commit comments