Skip to content

Commit ce48a5b

Browse files
authored
Merge pull request #1012 from processing/pr-1009-2.0
Detailed example attribution (2.0/beta branch)
2 parents 874d129 + e3e0b53 commit ce48a5b

File tree

63 files changed

+984
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+984
-17
lines changed

docs/content_overview.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,73 @@
1111
- Stored in `/src/content/examples/`
1212
- All translations are stored and edited directly in this repo under the corresponding language folder in `/src/content/examples/`
1313

14+
All original examples (created new for p5.js) since 2024 are collectively attributed to p5.js Contributors under the CC-BY-NC-SA 4.0 license. However, examples that build on prior work (under a compatible license) can be attributed in more detail, to make sure that authorship is clear in citation, and code history is available to viewers.
15+
16+
To add attribution, you can use the following block in the headers, listing in **chronological** order all attribution. Below is the example from `examples/animation-and-variables-conditions/`:
17+
18+
```yaml
19+
remix:
20+
- description: Inspired by
21+
attribution:
22+
- name: Name Name
23+
URL: a-valid-link
24+
code:
25+
- label: pre-2023 code
26+
URL: a-valid-link
27+
- description: Revised by
28+
attribution:
29+
- name: Name Name
30+
URL: a-valid-link
31+
code:
32+
- label: 2023 revision code
33+
URL: a-valid-link
34+
35+
- collectivelyAttributedSince: 2024
36+
```
37+
38+
This will result in a block that lists, in order, the initial inspiration; any revision or other remix; and the collective attribution statement that begins in 2024: "From 2024 onwards, edited and maintained by p5.js Contributors and the Processing Foundation. Licensed under CC BY-NC-SA 4.0."
39+
40+
A remix can be many things ([here is an example analysis of sketch remixing (PDF)](https://dl.acm.org/doi/pdf/10.1145/3563657.3595969)); the `description` will be by default "Remixed by", so a more specific description is recommended.
41+
42+
To credit individuals, you can use the following descriptions, with `attribution.name` including the name of the author or contributor, with an optional link.
43+
44+
* Remixed by
45+
* Revised by
46+
* Created by
47+
48+
```yaml
49+
remix:
50+
- description: Created by
51+
attribution:
52+
- name: Someone
53+
URL: ...
54+
```
55+
56+
To credit a specific work that was (1) not created by the p5.js contributors since 2024 and (2) is under a compatible license, you can use the following descriptions. Here, `attribution.name` should include both the person and a specific work of theirs that was the inspiration.
57+
58+
* Inspired by
59+
* Based on
60+
61+
```yaml
62+
remix:
63+
- description: Inspired by
64+
attribution:
65+
- name: Someone's prior work
66+
URL: ...
67+
```
68+
69+
Each item in the remix history must have an at least one person listed in the attribution section. When multiple people are listed, their names will be shown **in that order**. For people, URLs are optional but recommended.
70+
71+
These attribution histories **do not need to be individually translated** for each sketch. It is enough to make sure that the descriptions (like 'Created by' and so on) appear in the different language strings in `src/content/ui/`. Then, these will be used for all examples. See [Localization](./localization.md) for more info. If you use special descriptions or names in the attribution, these do need either new strings, or localization in the respective example translations (in `src/content/examples/{language}`).
72+
73+
If the `collectivelyAttributedSince` information is missing, then no year will be included, but the collective attribution statement will still show: "Edited and maintained by p5.js Contributors and the Processing Foundation. Licensed under CC BY-NC-SA 4.0." You'll see this in examples that were part of a major revision project with specific attribution, but have collective authorship before and after. Note that the collective attribution message either does not specify a year,
74+
or specifies 2024. To add a new possible value, update:
75+
76+
1. `content/examples/config.ts` to include new permitted values;
77+
2. and `content/ui/{language}.yaml` strings for attribution to include the text
78+
79+
---
80+
1481
## Tutorials
1582

1683
- Stored in `/src/content/tutorials/`

src/content/examples/config.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { z, defineCollection, reference } from "astro:content";
22

3+
34
/**
45
* Content collection for the Examples section of the site.
56
* Each file represents a single example.
@@ -17,5 +18,37 @@ export const examplesCollection = defineCollection({
1718
relatedReference: z.array(reference("reference")).optional(),
1819
featuredImage: image(),
1920
featuredImageAlt: z.string().optional().default(""),
21+
22+
// Optional list of remixes to add to license
23+
remix: z
24+
.array(
25+
z.object({
26+
description: z.string().default("Remixed by"),
27+
attribution: z
28+
.array(
29+
z.object({
30+
name: z.string(),
31+
URL: z.string().optional(),
32+
})
33+
)
34+
.optional(),
35+
code: z
36+
.array(
37+
z.object({
38+
label: z.string(),
39+
URL: z.string(),
40+
})
41+
)
42+
.optional(),
43+
// Collective attribution message either does not specify a year,
44+
// or specifies 2024. To add a new possible value, update:
45+
// 1) content/examples/config.ts to include new permitted values;
46+
// 2) and content/ui/*.yaml strings for attribution to include the text
47+
collectivelyAttributedSince: z.literal(2024).optional(),
48+
})
49+
)
50+
.optional()
51+
.default([]),
2052
}),
2153
});
54+

src/content/examples/en/01_Shapes_And_Color/00_Shape_Primitives/description.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ oneLineDescription: Draw 2D shapes.
66
relatedReference:
77
- en/p5/arc
88
- en/p5/ellipse
9+
10+
remix:
11+
- description: Revised in 2023 by
12+
attribution:
13+
- name: Darren Kessner
14+
URL: https://github.com/dkessner
15+
- description: Created by
16+
attribution:
17+
- name: Caleb Foss
18+
URL: https://github.com/calebfoss
19+
- name: Darren Kessner
20+
URL: https://github.com/dkessner
21+
code:
22+
- label: 2023 code
23+
URL: https://github.com/processing/p5.js-example/tree/main/examples/01_Shapes_And_Color/00_Shape_Primitives
24+
- label: pre-2023 code
25+
URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/01_Form/01_Shape_Primitives.js
26+
- collectivelyAttributedSince: 2024
927
---
1028

1129
This program demonstrates the use of the basic shape

src/content/examples/en/01_Shapes_And_Color/01_Color/description.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ featuredImage: "../../../images/featured/01_Shapes_And_Color-01_Color-thumbnail.
33
featuredImageAlt: A few basic shapes drawn in different colors over a blue background.
44
title: Color
55
oneLineDescription: Add color to your sketch.
6+
7+
remix:
8+
- description: Created by
9+
attribution:
10+
- name: Caleb Foss
11+
URL: https://github.com/calebfoss
12+
- name: Darren Kessner
13+
URL: https://github.com/dkessner
14+
code:
15+
- label: 2023 code
16+
URL: https://github.com/processing/p5.js-example/tree/main/examples/01_Shapes_And_Color/01_Color
17+
- collectivelyAttributedSince: 2024
18+
619
---
720

821
This expands on the Shape Primitives example by adding

src/content/examples/en/02_Animation_And_Variables/00_Drawing_Lines/description.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ featuredImage: "../../../images/featured/02_Animation_And_Variables-00_Drawing_L
33
featuredImageAlt: A squiggly rainbow line on a black background.
44
title: Drawing Lines
55
oneLineDescription: Draw with the mouse.
6+
7+
remix:
8+
- description: Revised by
9+
attribution:
10+
- name: Darren Kessner
11+
URL: https://github.com/dkessner
12+
code:
13+
- label: pre-2023 code
14+
URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/17_Drawing/00_Continuous_Lines.js
15+
- label: 2023 revision code
16+
URL: https://github.com/processing/p5.js-example/tree/main/examples/02_Animation_And_Variables/00_Drawing_Lines
617
---
718

819
Click and drag the mouse to draw a line.

src/content/examples/en/02_Animation_And_Variables/01_Animation_With_Events/description.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ featuredImage: "../../../images/featured/02_Animation_And_Variables-01_Animation
33
featuredImageAlt: A small green circle on a black background.
44
title: Animation with Events
55
oneLineDescription: Pause and resume animation.
6+
7+
remix:
8+
- description: Revised by
9+
attribution:
10+
- name: Darren Kessner
11+
URL: https://github.com/dkessner
12+
code:
13+
- label: 2023 code
14+
URL: https://github.com/processing/p5.js-example/tree/main/examples/02_Animation_And_Variables/01_Animation_With_Events
15+
- label: pre-2023 code
16+
URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/00_Structure/06_Redraw.js
617
---
718

819
This example demonstrates the use of

src/content/examples/en/02_Animation_And_Variables/02_Mobile_Device_Movement/description.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ featuredImageAlt: White circles on a black background, with varying degrees of t
44
title: Mobile Device Movement
55
oneLineDescription: Animate based on device motion.
66
featured: true
7+
8+
remix:
9+
- description: Revised by
10+
attribution:
11+
- name: Kasey Lichtlyter
12+
URL: https://www.klich.co/
13+
code:
14+
- label: 2023 code
15+
URL: https://github.com/processing/p5.js-example/tree/main/examples/02_Animation_And_Variables/02_Mobile_Device_Movement
16+
- label: pre-2023 code
17+
URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/35_Mobile/02_Acceleration_Color.js
718
---
819

920
The <a href="https://p5js.org/reference/p5/deviceMoved" target="_blank">deviceMoved()</a>

src/content/examples/en/02_Animation_And_Variables/03_Conditions/description.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ featuredImage: "../../../images/featured/02_Animation_And_Variables-03_Condition
33
featuredImageAlt: A small black circle on a rainbow, lattice-shaped path, on top of a grey and white striped background.
44
title: Conditions
55
oneLineDescription: Use if and else statements to make decisions while your sketch runs.
6+
7+
remix:
8+
- description: Inspired by
9+
attribution:
10+
- name: the Conditional Shapes Example by Prof. WM Harris
11+
URL: https://archive.p5js.org/examples/control-conditional-shapes.html
12+
code:
13+
- URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/04_Control/05_Logical_Operators_2.js
14+
label: pre-2023 code
15+
- description: Revised by
16+
attribution:
17+
- name: Caleb Foss
18+
URL: https://github.com/calebfoss
19+
code:
20+
- URL: https://github.com/processing/p5.js-example/tree/main/examples/02_Animation_And_Variables/03_Conditions
21+
label: 2023 revision code
22+
- collectivelyAttributedSince: 2024
23+
624
---
725

826
If and else statements allow a

src/content/examples/en/03_Imported_Media/00_Words/description.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ featuredImage: "../../../images/featured/03_Imported_Media-00_Words-thumbnail.pn
33
featuredImageAlt: Three columns of the words “ichi,” “ni,” “san,” and “shi” on a white background. The first column is right aligned, the middle column is center aligned, and the left column is left aligned.
44
title: Words
55
oneLineDescription: Load fonts and draw text.
6+
7+
remix:
8+
- description: Revised by
9+
attribution:
10+
- name: Kasey Lichtlyter
11+
URL: https://www.klich.co/
12+
code:
13+
- label: 2023 code
14+
URL: https://github.com/processing/p5.js-example/tree/main/examples/01_Shapes_And_Color/01_Color
15+
- label: pre-2023 code
16+
URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/19_Typography/01_Words.js
17+
618
---
719

820
The <a href="https://p5js.org/reference/p5/text" target="_blank">text()</a> function is used for inserting text into the canvas.

src/content/examples/en/03_Imported_Media/01_Copy_Image_Data/description.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ featuredImage: "../../../images/featured/03_Imported_Media-01_Copy_Image_Data-th
33
featuredImageAlt: Black-and-white photograph of a parrot. A curvy line is drawn across the image; within the confines of that line, color is added to the photograph.
44
title: Copy Image Data
55
oneLineDescription: Paint from an image file onto the canvas.
6+
7+
remix:
8+
- description: Revised by
9+
attribution:
10+
- name: Kasey Lichtlyter
11+
URL: https://www.klich.co/
12+
code:
13+
- label: 2023 code
14+
URL: https://github.com/processing/p5.js-example/tree/main/examples/03_Imported_Media/01_Copy_Image_Data
15+
- label: pre-2023 code
16+
URL: https://github.com/processing/p5.js-website-legacy/blob/main/src/data/examples/en/05_Image/10_Copy_Method.js
17+
618
---
719

820
Using the <a href="https://p5js.org/reference/p5/copy" target="_blank">copy()</a>

0 commit comments

Comments
 (0)