Skip to content

Commit 544f526

Browse files
committed
Merge branch 'main' of https://github.com/processing/p5.js-website into feedbackExample
2 parents db426cb + 90ff8b9 commit 544f526

36 files changed

+4122
-3852
lines changed

.gitattributes

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Set default behaviour to automatically normalize line endings.
2+
* text=auto
3+
4+
# prevents git from converting LF to CRLF, which causes issues
5+
# when assembling example pages on Windows
6+
data/examples/**/*.js eol=lf
7+
8+
# Denote all files that are truly binary and should not be modified.
9+
*.ai binary
10+
*.gif binary
11+
*.ico binary
12+
*.jpg binary
13+
*.mov binary
14+
*.mp3 binary
15+
*.mp4 binary
16+
*.ogg binary
17+
*.ogv binary
18+
*.otf binary
19+
*.pdf binary
20+
*.png binary
21+
*.ttf binary
22+
*.wav binary
23+
*.webm binary
24+
*.zip binary

.github/ISSUE_TEMPLATE/discussion.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: 💭 Discussion
22
description: This template is for starting a discussion.
3-
labels: [discussion]
3+
labels: [ Discussion ]
44
body:
5-
- type: textarea
6-
attributes:
7-
label: Topic
8-
description: What do you want to discuss with the group?
9-
validations:
10-
required: true
5+
- type: textarea
6+
attributes:
7+
label: Topic
8+
description: What do you want to discuss with the group?
9+
validations:
10+
required: true

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 🌱 New Feature Request
22
description: Request a new feature be added.
3-
labels: [feature request]
3+
labels: [ Feature Request ]
44
body:
55
- type: textarea
66
attributes:
@@ -27,7 +27,7 @@ body:
2727
- Showcase
2828
- Other (specify if possible)
2929
validations:
30-
required: true
30+
required: true
3131

3232
- type: textarea
3333
attributes:

.github/ISSUE_TEMPLATE/found-a-bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "🐛 Found a Bug"
22
description: Report p5.js website bugs (broken or incorrect behaviour).
3-
labels: [ bug ]
3+
labels: [ Bug ]
44
body:
55
- type: markdown
66
attributes:

.github/ISSUE_TEMPLATE/improve-translation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "🌐 Improve Translation"
22
description: Make a suggestion or report a problem about the translation of p5.js website.
3-
labels: [ translation ]
3+
labels: [ Translation ]
44
body:
55
- type: markdown
66
attributes:

.github/workflows/update-documentation.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010

1111
jobs:
1212
build:
13-
name: Update p5.js documentation
13+
name: Update p5.js documentation and library files
1414
runs-on: ubuntu-latest
1515

1616
steps:
@@ -20,28 +20,18 @@ jobs:
2020
uses: actions/setup-node@v1
2121
with:
2222
node-version: 12.x
23-
- name: Extract documentation from the p5.js repo
23+
- name: Extract documentation and library files from the p5.js repo
2424
run: |
2525
npm install
26-
npm run grunt update-enJSON
26+
npm run grunt update-enJSON --target="${{ steps.p5js.outputs.VERSION }}"
2727
- name: Get p5.js release info
2828
id: p5js
2929
run: |
3030
echo ::set-output name=VERSION::${P5JS_REF/refs\/tags\//}
3131
echo ::set-output name=SHA::${P5JS_SHA}
32-
- name: Get latest p5.min.js build
33-
uses: suisei-cn/actions-download-file@v1
34-
with:
35-
url: https://github.com/processing/p5.js/releases/download/${{github.event.client_payload.ref}}/p5.min.js
36-
target: src/assets/js/
37-
- name: Get latest p5.sound.min.js build
38-
uses: suisei-cn/actions-download-file@v1
39-
with:
40-
url: https://github.com/processing/p5.js/releases/download/${{github.event.client_payload.ref}}/p5.sound.min.js
41-
target: src/assets/js/
4232
- name: Commit changes
4333
uses: EndBug/add-and-commit@v4
4434
with:
45-
message: 'Update Reference files for p5.js ${{ steps.p5js.outputs.VERSION }} release (${{ steps.p5js.outputs.SHA }})'
35+
message: 'Update files for p5.js ${{ steps.p5js.outputs.VERSION }} release (${{ steps.p5js.outputs.SHA }})'
4636
env:
4737
GITHUB_TOKEN: ${{ secrets.DOCS_COMMIT_TOKEN }}

Gruntfile.js

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,22 @@ module.exports = function(grunt) {
342342
dest: 'p5-reference/'
343343
}
344344
},
345-
htmllint: {
346-
all: {
345+
346+
htmlhint: {
347+
html1: {
348+
options: {
349+
'attr-value-double-quotes': false,
350+
'alt-require': true,
351+
'doctype-first': true,
352+
'title-require': true,
353+
'attr-no-duplication': true,
354+
'input-requires-label': true,
355+
'tags-check': true,
356+
'tagname-lowercase': true,
357+
'tagname-specialchars': true,
358+
'empty-tag-not-self-closed': true,
359+
'id-unique': true
360+
},
347361
src: [
348362
'<%= config.dist %>/**/*.html',
349363
'!<%= config.dist %>/**/CHANGES.html',
@@ -352,20 +366,13 @@ module.exports = function(grunt) {
352366
'!<%= config.dist %>/**/learn/*.html',
353367
'!<%= config.dist %>/**/examples/*.html',
354368
'!<%= config.dist %>/**/reference/assets/index.html'
355-
],
356-
options: {
357-
ignore: [
358-
/^This document appears to be written in English/,
359-
/^Bad value https:/,
360-
/^Consider adding a lang attribute to the html/,
361-
/^Attribute paypalexpress not allowed on element script at this point./
362-
]
363-
}
369+
]
364370
}
365371
},
372+
366373
shell: {
367374
generate_dataJSON: {
368-
command: 'npm ci && npm run grunt yui',
375+
command: `git checkout ${grunt.option('target')} && npm ci && npm run grunt yui build`,
369376
options: {
370377
execOptions: {
371378
cwd: 'tmp/p5.js'
@@ -378,7 +385,7 @@ module.exports = function(grunt) {
378385
grunt.registerTask('update-version', function() {
379386
const done = this.async();
380387

381-
const version = require('./src/templates/pages/reference/data.json').project.version;
388+
const version = grunt.option('target').substring(1);
382389

383390
fs.readFile('./src/data/data.yml')
384391
.then(str => {
@@ -402,7 +409,7 @@ module.exports = function(grunt) {
402409
grunt.loadNpmTasks('grunt-file-append');
403410
grunt.loadNpmTasks('grunt-contrib-compress');
404411
grunt.loadNpmTasks('grunt-contrib-requirejs');
405-
grunt.loadNpmTasks('grunt-html');
412+
grunt.loadNpmTasks('grunt-htmlhint');
406413

407414
// i18n tracking task
408415
grunt.registerTask('i18n', function() {
@@ -436,6 +443,14 @@ module.exports = function(grunt) {
436443
// move the data.json files from the cloned p5.js repository to the p5.js-website repository
437444
fse.moveSync(dataJSON_p5js, dataJSON_p5jswebsite, { overwrite: true });
438445
fse.moveSync(dataJSONmin_p5js, dataJSONmin_p5jswebsite, { overwrite: true });
446+
447+
const p5min_src = 'tmp/p5.js/lib/p5.min.js';
448+
const p5min_dest = 'src/assets/js/p5.min.js';
449+
const p5Soundmin_src = 'tmp/p5.js/lib/addons/p5.sound.min.js';
450+
const p5Soundmin_dest = 'src/assets/js/p5.sound.min.js';
451+
fse.moveSync(p5min_src, p5min_dest, { overwrite: true });
452+
fse.moveSync(p5Soundmin_src, p5Soundmin_dest, { overwrite: true });
453+
439454
// delete the tmp folder that contained the p5.js repository
440455
fse.removeSync('tmp/');
441456
});
@@ -451,8 +466,8 @@ module.exports = function(grunt) {
451466
'clone_p5js_repo',
452467
'generate_dataJSON',
453468
'move_dataJSON',
454-
'generate_enJSON',
455-
// 'json-to-fluent'
469+
'update-version',
470+
'generate_enJSON'
456471
]);
457472

458473
// multi-tasks: collections of other tasks
@@ -476,19 +491,18 @@ module.exports = function(grunt) {
476491

477492
// runs tasks in order
478493
grunt.registerTask('build', [
479-
'update-version',
494+
// 'update-version',
480495
'exec',
481496
'clean',
482497
'requirejs:yuidoc_theme',
483498
'requirejs',
484-
// 'fluent-to-json',
485499
'copy',
486500
'optimize',
487501
'assemble',
488502
'file_append',
489503
'compress',
490504
'i18n',
491-
'htmllint'
505+
'htmlhint'
492506
]);
493507

494508
// runs with just grunt command

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Once added, a steward's username will remain in the [stewards section of the rea
2424
| Overall | [@Qianqianye](https://github.com/Qianqianye), [@limzykenneth](https://github.com/limzykenneth) |
2525
| Reference | [@Divyansh013](https://github.com/Divyansh013) |
2626
| Example | GSoC 2022: [@Malayvasa](https://github.com/Malayvasa) (Contributor), [@tyler-yin](https://github.com/tyler-yin)(Mentor); [@3ru](https://github.com/3ru) |
27-
| Teach | GSoC 2022: [@Gracia-zhang](https://github.com/Gracia-zhang) (Contributor), [@yinhwa](https://github.com/yinhwa)(Mentor) |
27+
| Teach | GSoC 2022: [@Gracia-zhang](https://github.com/Gracia-zhang) (Contributor), [@yinhwa](https://github.com/yinhwa)(Mentor); [@SarveshLimaye](https://github.com/SarveshLimaye)|
2828
| Showcase | GSoC 2022: [@anniezhengg](https://github.com/anniezhengg) (Contributor), [@raclim](https://github.com/raclim)(Mentor) |
2929
| Learn | [@nickmcintyre](https://github.com/nickmcintyre) |
3030
| Libraries | [@Qianqianye](https://github.com/Qianqianye) |
@@ -36,17 +36,16 @@ Once added, a steward's username will remain in the [stewards section of the rea
3636
| Language | Steward(s) |
3737
| -------- | ------------------------- |
3838
| Overall |[@Qianqianye](https://github.com/Qianqianye), [@limzykenneth](https://github.com/limzykenneth) |
39-
| Spanish |[@Guirdo](https://github.com/Guirdo), [@Andreu-G](https://github.com/Andreu-G) |
39+
| Spanish |[@Guirdo](https://github.com/Guirdo), [@Andreu-G](https://github.com/Andreu-G), [@dnd-alv](https://github.com/dnd-alv) |
4040
| Chinese | [@unicar9](https://github.com/unicar9), [@Gracia-zhang](https://github.com/Gracia-zhang), [@pentalei](https://github.com/pentalei) |
41-
| Korean | [@yinhwa](https://github.com/yinhwa), [@almchung](https://github.com/almchung), [@jhongover9000](https://github.com/jhongover9000), [@sssueing](https://github.com/sssueing), [@GeryGeryGery](https://github.com/GeryGeryGery) |
41+
| Korean | [@yinhwa](https://github.com/yinhwa), [@almchung](https://github.com/almchung), [@jhongover9000](https://github.com/jhongover9000), [@sssueing](https://github.com/sssueing), [@GeryGeryGery](https://github.com/GeryGeryGery), [@sosunnyproject](https://github.com/sosunnyproject) |
4242
| Hindi | [@adarrssh](https://github.com/adarrssh), [@Divyansh013](https://github.com/Divyansh013), [@deepchauhan](https://github.com/deepchauhan), [@SarveshLimaye](https://github.com/SarveshLimaye)|
4343

4444
Other Language Steward(s):
4545
* Portuguese: [@raphaelavelar](https://github.com/raphaelavelar)
4646

4747
## Setup
4848

49-
0. Ensure Java is installed. Not installed? Head over to [Java](https://www.oracle.com/java/technologies/downloads/) for installation.
5049
1. Install [node.js](https://nodejs.org/en/download/).
5150
2. Clone this repo by typing ```git clone https://github.com/processing/p5.js-website/``` in terminal.
5251
3. Navigate to the `p5.js-website` directory in the terminal and type `npm install`.

contributor_docs/i18n_contribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ The en.json is made up of three sections:
211211
- p5.js documentation, also extracted from the data.json file. This section contains a key for each p5.js Class (i.e., "p5.Color"), which holds information about the Class itself and its Methods and Fields.
212212
In this section, you might find HTML Anchor elements. You only need to translate the text between the two tags. For example, in `<a href=\"#/p5.Color\">p5.Color</a>`, you need to translate the second 'p5.Color' and leave the rest as is.
213213

214-
All the translation swaps of the Reference pages happen is [this function](https://github.com/processing/p5.js-website/blob/main/src/templates/pages/reference/index.hbs#L61).
214+
All the translation swaps of the Reference pages happen in [this function](https://github.com/processing/p5.js-website/blob/main/src/templates/pages/reference/index.hbs#L61).
215215
Any entries in the JSON object which are not filled in will be left in English when the page is loaded.
216216

217217
The translated versions of the JSON file need to be manually created and updated.

0 commit comments

Comments
 (0)