Skip to content

Commit 8803144

Browse files
committed
Merge branch 'main' of https://github.com/processing/p5.js-website into teach
2 parents 5c5cbfe + 44b8de7 commit 8803144

File tree

8 files changed

+275
-101
lines changed

8 files changed

+275
-101
lines changed

.github/workflows/update-documentation.yml

+4-14
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

+33-19
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ 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) |
4141
| 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)|
@@ -46,7 +46,6 @@ Other Language Steward(s):
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`.

0 commit comments

Comments
 (0)