Skip to content

Commit eae32ae

Browse files
authored
Usage Example Styling Guide (#138)
1 parent 06054b5 commit eae32ae

File tree

12 files changed

+404
-40
lines changed

12 files changed

+404
-40
lines changed

src/content/docs/Products/SplashKit/Splashkit Website/Tutorials Documentation/02-Tutorial-Style-Guide.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,5 +390,9 @@ write_line(name + "'s quest is: " + quest)
390390
Use callouts (also known as [Asides](https://starlight.astro.build/guides/components/#asides)) to
391391
highlight tips or important notes.
392392

393-
:::tip[Make the page interesting] These can help to direct the reader to any extra info, and help to
394-
add more colour to your tutorial guide. :::
393+
:::tip[Make the page interesting]
394+
395+
These can help to direct the reader to any extra info, and help to add more colour to your tutorial
396+
guide.
397+
398+
:::

src/content/docs/Products/SplashKit/Splashkit Website/Usage Examples/01-overview.mdx

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Usage examples demonstrate a specific Splashkit function within a simple, small
1515
to keep the program minimal while clearly showing how the function works.
1616

1717
For instance, the `write_line` example on the Splashkit site found
18-
[here](https://splashkit.io/api/terminal/#write-line-5), clicking on the `See Code Example` shows
19-
how the `write_line` function works, with a brief title of the program, program code, and a
20-
screenshot of the output.
18+
[here](https://splashkit.io/api/terminal/#write-line), clicking on the `See Code Example` shows how
19+
the `write_line` function works, with a brief title of the program, program code, and a screenshot
20+
of the output.
2121

2222
The following pages cover all the steps to create, submit, and review usage examples for the
2323
Splashkit website.
@@ -46,16 +46,28 @@ Splashkit website.
4646
- **C#**: Provide both a version using top-level statements and an Object-Oriented (OOP) version.
4747
- **Python**: Write a Python version that is straightforward and reflects the same functionality.
4848

49-
4. **Capture Output Screenshots and Write Explanations**:
50-
Run each program version, take screenshots of the output, and write a brief explanation for each
51-
language version. Describe what the program does, which function it demonstrates, and highlight
52-
any important details.
49+
4. **Create a Title for the example**:
5350

54-
5. **Add Files to the Correct Folder in the SplashKit Repository**:
55-
Organize your files in the appropriate folders within the SplashKit repository. Ensure file names
56-
and directory paths are consistent with SplashKit’s structure.
51+
- Think of a title that describes the overall functionality of the program.
52+
- Be creative with this title. It should not be the name of the function, or use the word
53+
"Example".
5754

58-
6. **Submit a Pull Request for Usage Examples**:
55+
5. **Capture Output of Program**: Run the program in any of the languages to capture the details of
56+
the program running. You might do this with a screenshot, screen recording converted to a GIF, or
57+
an audio recording.
58+
59+
| Output Format | Accepted File Type | Example of when to use |
60+
| ---------------- | ------------------ | --------------------------------------------------------- |
61+
| Screenshots | `.png` file | Simple program without any user inputs or animations. |
62+
| Screen Recording | `.gif` file | The program has user inputs or animations to demonstrate. |
63+
| Audio Recording | `.webm` file | The program include audio sounds. |
64+
65+
6. **Add Files to the Correct Folder in the SplashKit Repository**:
66+
67+
- Copy your files into the appropriate folder within the `splashkit.io-starlight` repository.
68+
- Ensure file names and directory paths are consistent with SplashKit’s structure.
69+
70+
7. **Submit a Pull Request for Usage Examples**:
5971
Follow the steps in the
6072
[Pull Requests for Usage Examples guide](/products/splashkit/splashkit-website/usage-examples/03-usage-pull-request).
6173
Use the provided PR template, describe your example clearly, and attach explanations and
@@ -80,8 +92,7 @@ Splashkit website.
8092
href="/products/splashkit/splashkit-website/usage-examples/04-usage-peer-review"
8193
/>
8294
<LinkCard
83-
title="Updating Usage Examples"
84-
description="How to update usage examples for the Splashkit website, including the necessary
85-
steps and guidelines."
86-
href="/products/splashkit/splashkit-website/usage-examples/05-updating-examples"
95+
title="Style Guide for Usage Examples"
96+
description="General rules to follow when creating usage examples."
97+
href="/products/splashkit/splashkit-website/usage-examples/05-usage-example-style-guide"
8798
/>

src/content/docs/Products/SplashKit/Splashkit Website/Usage Examples/02-creating-usage-examples.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ This guide explains how to create a usage example for the Splashkit website.
1515
### What are Usage Examples?
1616

1717
Usage examples demonstrate a specific Splashkit function within a simple, small program. The goal is
18-
to keep the program minimal while clearly showing how the function works.
18+
to keep the program minimal while clearly showing how the function works or how it can be utilised.
1919

2020
For instance, the `write_line` example on the Splashkit site shows how the `write_line` function
21-
works, with a brief explanation, program code, and a screenshot of the output.
21+
works, with a relevant title, program code, and a file showing the program output.
2222

2323
![example showing on site for write line function](./images/usageexample.png)
2424

@@ -43,8 +43,8 @@ In a separate pull request, to add to existing examples:
4343

4444
The planner board has numerous usage example suggestions for various functions, however you are
4545
welcomed and encouraged to come up with your own creative ideas for these. Scroll through the
46-
[Developer Documentation](https://splashkit.io/api/) to find various functions you could use for
47-
the usage example, when coming up with an idea, make sure to also check to see if anyone else has
46+
[API Documentation](https://splashkit.io/api/) to find various functions you could use for the
47+
usage example, when coming up with an idea, make sure to also check to see if anyone else has
4848
already done it.
4949

5050
The goal is to create **one usage example per function** in the SplashKit library. Building out

src/content/docs/Products/SplashKit/Splashkit Website/Usage Examples/03-usage-pull-request.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Describe the example and what it demonstrates.
4343
Splashkit Function: `function_name`
4444

4545
# Files Included
46-
- [ ] Title and explanation (.txt)
46+
- [ ] Relevant title for the example (.txt)
4747
- [ ] C++ code (SplashKit)
4848
- [ ] C++ code (Beyond SplashKit - In separate pull request)
4949
- [ ] C# code (Top-Level statements)

src/content/docs/Products/SplashKit/Splashkit Website/Usage Examples/04-usage-peer-review.mdx

Lines changed: 103 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,109 @@ will need to follow the steps for reviewing usage examples.
1414

1515
When reviewing an example, follow these steps:
1616

17-
1. Test each code file on your machine.
18-
2. Check the structure and functionality of the code in each language.
19-
3. Review the preview on the website.
17+
### 1. Test the code
2018

21-
If there are any issues comment on the pull request with the necessary changes. Once those changes
22-
are made, then use the following template as your comment in the pull request.
19+
Compile/run each code file on your machine.
2320

24-
```shell
21+
- Are there any errors?
22+
- Are there any warnings?
23+
- Does the program run as expected?
24+
25+
### 2. Analyse the effectiveness
26+
27+
Consider the function being demonstrated and how it might be used by a SplashKit user.
28+
29+
- Does the code example demonstrate the usefulness of the function?
30+
- Or, do the code example give more insight into how the function works?
31+
- Is the example simple enough for an SIT102 or SIT771 student to follow, while still being an
32+
interesting example?
33+
34+
### 3. Compare and analyse the code
35+
36+
Check the structure and functionality of the code in each language.
37+
38+
- Does the sequence of code match for all code files?
39+
- Do the code comments match across all code files?
40+
- Does the code follow the
41+
[style guide](/products/splashkit/splashkit-website/usage-examples/05-usage-example-style-guide)
42+
requirements?
43+
- Is the Object Oriented C# code using the Object Oriented format where possible/relevant?
44+
- Is the python code using the correct function names? (These function names will often differ from
45+
other languages due to python not handling function overloads)
46+
47+
### 4. Test in localhost
48+
49+
Check the example displays correctly in your local development environment.
50+
51+
- Does the website build successfully with `npm run build`?
52+
- Does the example display under the correct function when previewing the website with
53+
`npm run preview`?
54+
- Is the correct function highlighted in the example code?
55+
56+
### 5. Request changes
57+
58+
Add your review comments on the pull request on GitHub.
59+
60+
- Add comments for individual lines, or groups of lines in the code files. This helps the original
61+
contributor to understand exactly what the issue is related to.
62+
- Use professional language, and be polite but assertive.
63+
- Include the correct version of code where relevant, or any suggested improvements.
64+
- Ask questions if something is confusing or unclear.
65+
66+
:::note
67+
68+
**First Peer Review:**
69+
70+
- It is _very unlikely_ that you will approve a pull request on first review without any changes.
71+
- We all miss things in our own code, which is why peer reviews are so important.
72+
73+
**Second Peer Review:**
74+
75+
- This review is more likely to be able to be approved without changes being requested.
76+
- However, it is important to check that the first reviewer did not miss anything that _should have
77+
been found_ in the first review.
78+
- You might also have experience that allows you to consider other aspects that the first reviewer
79+
would not have noticed.
80+
81+
:::
82+
83+
### 6. Continue discussion about changes on the pull request
84+
85+
Check for replies on the pull request from the original contributor.
86+
87+
- These comments might be requesting more information about your suggested changes, so it is
88+
important to respond quickly.
89+
- Discussions may include some debate on the best way forward. Be open to the ideas suggested by the
90+
other person, and include evidence to back up your reasoning.
91+
- If needed, either the reviewer or the original contributor can reach out to your Mentor to help
92+
decide what the outcome should be.
93+
- Check for a comment from the original contributor that the requested changes have been made.
94+
95+
### 7. Review the pull request again
96+
97+
Repeat steps 1 - 4 above.
98+
99+
- It is important to review the pull request thoroughly to ensure that the changes have not caused
100+
other issues.
101+
- You may notice other issues once changes have been made. This is okay, and is part of the
102+
development process.
103+
- Ensure that the pull request will be able to be merged upstream to the live site before you
104+
approve it.
105+
106+
### 8. Approve the pull request
107+
108+
Once all the requested changes have been made, approve the pull request using the following template
109+
in the comment of the approving review:
110+
111+
```plaintext
25112
# Peer Review
26113
27114
I've reviewed the ...
28115
29-
# Checks
116+
## Checks
117+
30118
- [ ] All required files are present.
31-
- [ ] Title and explanation (.txt)
119+
- [ ] Example Title (.txt)
32120
- [ ] C++ code (SplashKit)
33121
- [ ] C# code (top-level statements)
34122
- [ ] C# code (Object-Oriented Programming)
@@ -39,12 +127,18 @@ I've reviewed the ...
39127
- [ ] Code clearly demonstrates the function.
40128
- [ ] All versions maintain the same structure and comments.
41129
42-
# Tests done
130+
## Code Tests done
131+
43132
- [ ] C++ SplashKit code ran correctly.
44133
- [ ] C++ Beyond SplashKit code ran correctly.
45134
- [ ] C# top level code ran correctly.
46135
- [ ] C# OOP code ran correctly.
47136
- [ ] Python code ran correctly.
137+
138+
## Website Tests done
139+
140+
- [ ] npm run build
141+
- [ ] npm run preview
48142
```
49143

50144
Ensure while doing peer reviews that you also follow the

0 commit comments

Comments
 (0)