Skip to content

Commit 701f15d

Browse files
docs: Updating README
Adding more sections
1 parent 55fb151 commit 701f15d

File tree

2 files changed

+147
-16
lines changed

2 files changed

+147
-16
lines changed

README.md

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ cd ./Turtle
5555
Import-Module ./ -Force -PassThru
5656
5757
~~~
58+
59+
### Turtle GitHub Action
60+
61+
Turtle has a GitHub action, and can be run in a workflow.
62+
63+
To use the turtle action, simply refer to this repository:
64+
65+
~~~yaml
66+
- name: UseTurtle
67+
uses: StartAutomating/Turtle@main
68+
~~~
69+
70+
This will run any *.turtle.ps1 files found in your repository, and check in any files that have changed.
71+
72+
What does this give us?
73+
74+
**We Can Generate Turtle Graphics in GitHub Workflows**
75+
5876
### Getting Started
5977

6078
Once we've imported Turtle, we can create any number of turtles, and control them with commands and methods.
@@ -269,16 +287,56 @@ Pop-Location
269287
<img src='./Examples/EndlessSnowflake.svg' alt='Endless Snowflake Pattern' width='100%' />
270288
</div>
271289

272-
### Turtle GitHub Action
290+
### Turtles in HTML
273291

274-
Turtle has a GitHub action, and can be run in a workflow.
292+
SVG is HTML.
275293

276-
To use the turtle action, simply refer to this repository:
294+
So, because our Turtle is built atop of an SVG path, our Turtle _is_ HTML.
277295

278-
~~~yaml
279-
- name: UseTurtle
280-
uses: StartAutomating/Turtle@main
296+
Don't believe me? Try this?
297+
298+
~~~PowerShell
299+
turtle SierpinskiTriangle |
300+
Set-Turtle Stroke '#4488ff' |
301+
Save-Turtle ./SierpinskiTriangle.html
281302
~~~
282303

283-
This will run any *.turtle.ps1 files found in your repository, and check in any files that have changed.
304+
Anything we do with our turtle should work within a webpage.
305+
306+
There are a few properties of the turtle that may be helpful:
307+
308+
* .Canvas returns the turtle rendered in an HTML canvas
309+
* .OffsetPath returns the turtle as an offset path
310+
* .ClipPath returns the turtle as a clip path
311+
312+
313+
### Turtles in Raster
314+
315+
Because our Turtle can be painted onto an HTML canvas, we can easily turn it into a raster format, like PNG.
316+
317+
This works by launching the browser in headless mode, rasterizing the image, and returning the bytes.
318+
319+
Any turtle can be saved as a PNG, JPEG, and WEBP.
320+
321+
~~~PowerShell
322+
turtle SierpinskiTriangle |
323+
Set-Turtle Stroke '#4488ff' |
324+
Save-Turtle ./SierpinskiTriangle.png
325+
~~~
326+
327+
328+
### Turtles are Cool
329+
330+
You should now have some sense of how cool Turtle graphics can be, and how easy it is to get stared.
331+
332+
Play around. Draw something. Please provide feedback by filing an issue or starting a discussion.
333+
334+
Open an issue if you want a new shape or fractal.
335+
336+
File a pull request if you have some cool changes to make.
337+
338+
Have fun!
339+
340+
Hope this helps!
341+
284342

README.md.ps1

Lines changed: 82 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,32 @@ Import-Module ./ -Force -PassThru
7878

7979
#endregion Installation
8080

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+
81107
#region Getting Started
82108
@"
83109
### Getting Started
@@ -364,27 +390,74 @@ $(
364390

365391
#endregion LSystems
366392

393+
#region Turtles in HTML
394+
@"
367395
396+
### Turtles in HTML
368397
369-
#region Turtle PowerShell GitHub Action
398+
SVG is HTML.
370399
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
371423
@"
372424
373-
### Turtle GitHub Action
425+
### Turtles in Raster
374426
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.
376428
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.
378430
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
382437
~~~
383438
384-
This will run any *.turtle.ps1 files found in your repository, and check in any files that have changed.
385439
"@
440+
#endregion Turtles in PNG
386441

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
388461

389462

390463
# "![SierpinskiTriangle](./Examples/EndlessSierpinskiTrianglePattern.svg)"

0 commit comments

Comments
 (0)