Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
f039e59
Add Grunt tasks
yukienomiya Aug 7, 2020
f74332d
Create config file for update-documentation workflow
yukienomiya Aug 7, 2020
0bf9760
Update package-lock.json
yukienomiya Aug 7, 2020
b2c19aa
Update package.json
yukienomiya Aug 7, 2020
32afc77
Create automated_reference_update.md
yukienomiya Aug 7, 2020
ec61d31
Add workflows names to documentation
yukienomiya Aug 8, 2020
7d58bc7
Add Grunt tasks
yukienomiya Aug 7, 2020
e9307df
Create config file for update-documentation workflow
yukienomiya Aug 7, 2020
bd76784
Update package-lock.json
yukienomiya Aug 7, 2020
ad7d31a
Update package.json
yukienomiya Aug 7, 2020
2ba16fd
Create automated_reference_update.md
yukienomiya Aug 7, 2020
1ebc12e
Add workflows names to documentation
yukienomiya Aug 8, 2020
1ad7e4f
Merge branch 'automated-reference-update' of https://github.com/yukie…
yukienomiya Aug 11, 2020
463a96a
Merge branch 'main' of https://github.com/processing/p5.js-website in…
limzykenneth Aug 16, 2020
0ba4cee
Fix "UNKNOWN-PARAM" keys and delete empty strings
yukienomiya Aug 17, 2020
146ff5c
Fix "UNKNOWN-PARAM" keys
yukienomiya Aug 17, 2020
b4c0ad6
Fix "UNKNOWN-PARAM" keys and delete empty strings
yukienomiya Aug 17, 2020
531d5bc
Fix methods and fields keys
yukienomiya Aug 18, 2020
b37bf09
Add missing keys to the translation files
yukienomiya Aug 18, 2020
cd3bebf
Add fixParagraphStructure script
yukienomiya Aug 18, 2020
cfd9537
Delete fixParagraphStructure.js
yukienomiya Aug 18, 2020
096f563
Use fs-extra instead of grunt-shell
yukienomiya Aug 18, 2020
8fe22e8
Use simple-git intead of grunt-shell
yukienomiya Aug 19, 2020
f7c8d3f
Update commit message
yukienomiya Aug 19, 2020
b5dca31
Revert "Delete fixParagraphStructure.js"
yukienomiya Aug 20, 2020
ada17c1
Change delimiter in flatten function
yukienomiya Aug 20, 2020
d9f03d9
Fix Reference translation files
yukienomiya Aug 20, 2020
c745360
Delete fixParagraphStructure.js
yukienomiya Aug 20, 2020
0500212
Add extra translated Classes
yukienomiya Aug 20, 2020
10b6cf4
adding in the entrypoint links to redirect to the new showcase page
connieliu0 Aug 24, 2020
602dce8
added entrypoints for new showcase
connieliu0 Aug 24, 2020
7235a8b
Add Grunt tasks
yukienomiya Aug 7, 2020
3c8cde4
Create config file for update-documentation workflow
yukienomiya Aug 7, 2020
0e05bf6
Update package-lock.json
yukienomiya Aug 7, 2020
a05b7a0
Update package.json
yukienomiya Aug 7, 2020
72f16b4
Create automated_reference_update.md
yukienomiya Aug 7, 2020
72231e8
Add workflows names to documentation
yukienomiya Aug 8, 2020
f7c616a
Use fs-extra instead of grunt-shell
yukienomiya Aug 18, 2020
dfaf7f5
Use simple-git intead of grunt-shell
yukienomiya Aug 19, 2020
6ed05b7
Update commit message
yukienomiya Aug 19, 2020
422c16f
Merge branch 'automated-reference-update' of https://github.com/yukie…
yukienomiya Aug 24, 2020
c71f001
Format i18n YAML files according to YAML 1.2
yukienomiya Aug 24, 2020
9304b2d
Create updatei18nFiles.js
yukienomiya Aug 24, 2020
cd1e001
Update package.json
yukienomiya Aug 24, 2020
0a0d9cc
Update package-lock.json
yukienomiya Aug 24, 2020
74192ae
Create update-json-i18n-files and update-yaml-i18n-files tasks
yukienomiya Aug 24, 2020
a49d84c
Create update-translation-files workflow config file
yukienomiya Aug 24, 2020
249b080
Fix "UNKNOWN-PARAM" keys and delete empty strings
yukienomiya Aug 17, 2020
302df1c
Fix "UNKNOWN-PARAM" keys
yukienomiya Aug 17, 2020
1c651be
Fix "UNKNOWN-PARAM" keys and delete empty strings
yukienomiya Aug 17, 2020
5572042
Fix methods and fields keys
yukienomiya Aug 18, 2020
0147059
Add missing keys to the translation files
yukienomiya Aug 18, 2020
05acb31
Add fixParagraphStructure script
yukienomiya Aug 18, 2020
eb16f13
Delete fixParagraphStructure.js
yukienomiya Aug 18, 2020
5c4f13b
Revert "Delete fixParagraphStructure.js"
yukienomiya Aug 20, 2020
2470a97
Change delimiter in flatten function
yukienomiya Aug 20, 2020
8e92b29
Fix Reference translation files
yukienomiya Aug 20, 2020
5a31bd5
Delete fixParagraphStructure.js
yukienomiya Aug 20, 2020
b0bba86
Add extra translated Classes
yukienomiya Aug 20, 2020
3e48db2
Merge branch 'update-reference-translation-files' of https://github.c…
yukienomiya Aug 24, 2020
d605151
Updated footer to include new project lead
Aug 25, 2020
cac700a
Merge main into branch feature/footerUpdate
Aug 25, 2020
d19a4ef
header problem fixed
chtushar Aug 25, 2020
99d0b7b
language bar now can be seen in mobile devices
chtushar Aug 25, 2020
acad422
vw to %
chtushar Aug 25, 2020
b17c6c7
vw to %
chtushar Aug 25, 2020
2fa2e45
responsivness added
chtushar Aug 25, 2020
b593829
margin on top of description to avoid overlapping
chtushar Aug 25, 2020
3a4eb3f
increased min-height of example_container
chtushar Aug 25, 2020
21886d4
Updated footer to include new project lead
Aug 26, 2020
0971baa
Merge pull request #853 from processing/feature/footerUpdate
mcturner1995 Aug 26, 2020
9b948a0
Merge pull request #857 from chtushar/main
lmccart Aug 26, 2020
e43e758
Update README.md
montoyamoraga Aug 27, 2020
2ee86ef
first featured and css done
chtushar Aug 27, 2020
face233
qianqian-ye page
chtushar Aug 27, 2020
d5b62c9
Phuong Ngo page
chtushar Aug 27, 2020
9b268be
moon xin page
chtushar Aug 27, 2020
145645a
daein chung page
chtushar Aug 27, 2020
498b41c
casey louise page
chtushar Aug 27, 2020
bac23e2
Korean translation of footer and blocked an a tag to /teach on hompage
yinhwa Aug 28, 2020
3b9c814
Merge pull request #854 from yukienomiya/update-reference-translation…
outofambit Aug 29, 2020
369a2e6
Merge pull request #861 from yinhwa/korean
yinhwa Aug 29, 2020
8692a39
Merge remote-tracking branch 'upstream/main' into update-yaml-format
yukienomiya Aug 29, 2020
7a7717f
Revert changes on i18n-tracking.yml
yukienomiya Aug 29, 2020
3d46550
Fix descriptions swap in Class pages
yukienomiya Aug 30, 2020
4279fef
Add italian translation of YAML file
yukienomiya Aug 30, 2020
92c9195
Format it.yml according to YAML 1.2
yukienomiya Aug 30, 2020
d38ae33
Merge pull request #864 from yukienomiya/fix-swap-script
outofambit Aug 30, 2020
ee65f7d
Update .github/workflows/update-documentation.yml
yukienomiya Aug 30, 2020
7ab45d4
Merge pull request #860 from chtushar/main
connieliu0 Aug 31, 2020
eaf3f84
merge main branch and resolve conflicts
yinhwa Aug 31, 2020
0292836
Merge pull request #867 from yinhwa/teach
Qianqianye Aug 31, 2020
8dc60a8
Merge pull request #841 from yukienomiya/automated-reference-update
outofambit Sep 3, 2020
2a10e6c
Merge remote-tracking branch 'origin/main' into update-yaml-format
outofambit Sep 3, 2020
c7a34d7
Merge pull request #855 from yukienomiya/update-yaml-format
outofambit Sep 3, 2020
0c5ad42
Merge pull request #865 from yukienomiya/italian
outofambit Sep 3, 2020
f22925b
Merge branch 'main' into i18n-files-comparator-tool
yukienomiya Sep 3, 2020
8608503
Automatic update of translation files (f22925b32367b3031fe84095b3f56e…
yukienomiya Sep 3, 2020
b13eb6b
Merge pull request #851 from processing/integrating_showcase.p5js.org
connieliu0 Sep 6, 2020
084e33f
adding p5.xr lib and readmes to explain learn and libraries build pro…
lmccart Sep 11, 2020
eb80b54
changed terminologies in Korean translation
yinhwa Sep 13, 2020
5f64501
Merge branch 'main' of https://github.com/processing/p5.js-website in…
limzykenneth Sep 14, 2020
288eaf2
Refactoring website style
limzykenneth Sep 19, 2020
ad701ea
Removed seemingly unused CSS rules
limzykenneth Sep 19, 2020
512f1f4
Fix desktop styling of reference
limzykenneth Sep 19, 2020
ce9ef4b
Refactor reference example CSS
limzykenneth Sep 19, 2020
1e4253d
Use selector specificity to replace important modifier
limzykenneth Sep 19, 2020
0ef84d9
Improve reference item page responsiveness
limzykenneth Sep 19, 2020
d8fe945
Fix reference syntax field responsiveness
limzykenneth Sep 19, 2020
4829c61
Fix i18n buttons partially hidden on mobile
limzykenneth Sep 19, 2020
e6363f2
Fix issue where example code on examples page goes off screen on mobile
limzykenneth Sep 19, 2020
818473b
Reference examples edit field responsiveness
limzykenneth Sep 19, 2020
ed1a5cb
Slight clean up and refactor
limzykenneth Sep 19, 2020
c8a824d
Address some linter errors
limzykenneth Sep 19, 2020
d212720
Cleanup unused files in reference
limzykenneth Sep 19, 2020
f667a5e
adding korean translation on missing referneces
yinhwa Sep 21, 2020
4200d74
Merge pull request #874 from limzykenneth/css-fix
limzykenneth Sep 21, 2020
f12cbac
Fix alpha scale in background() and color()
bboure Sep 22, 2020
ff7fd73
Merge pull request #876 from bboure/fix-es-doc
montoyamoraga Sep 22, 2020
ee25845
Merge pull request #873 from yinhwa/korean
yinhwa Sep 24, 2020
8357f05
Merge branch 'main' into main
lmccart Sep 28, 2020
745f9e6
Merge pull request #872 from lmccart/main
lmccart Sep 28, 2020
679521f
Merge pull request #856 from yukienomiya/i18n-files-comparator-tool
outofambit Sep 29, 2020
c64f5a1
Update 18_Map.js
berkeozgen08 Oct 4, 2020
846f837
Update 18_Map.js
berkeozgen08 Oct 4, 2020
96044ee
Update 18_Map.js
berkeozgen08 Oct 4, 2020
df3bc0c
Update 18_Map.js
berkeozgen08 Oct 4, 2020
a67483e
Merge pull request #881 from berkeozgen08/main
limzykenneth Oct 6, 2020
eeaf276
updating donation page with donorbox
lmccart Oct 12, 2020
a4ec095
Merge branch 'main' of github.com:processing/p5.js-website into main
lmccart Oct 12, 2020
e0e3530
Merge pull request #882 from lmccart/main
lmccart Oct 12, 2020
01e50d8
Automatic update of translation files (e0e3530708202483b30761f92ea7ec…
lmccart Oct 12, 2020
0b745f9
tweak text on donate page
lmccart Oct 12, 2020
c588f38
tweak text on donate page
lmccart Oct 12, 2020
be9d76c
Automatic update of translation files (0b745f9c3f5176e31aad00b2dc98a7…
lmccart Oct 12, 2020
cd6a0c1
Merge pull request #883 from lmccart/main
lmccart Oct 12, 2020
ea55c77
fix typo
lmccart Oct 12, 2020
b7f0000
Merge branch 'main' of github.com:processing/p5.js-website into main
lmccart Oct 12, 2020
d547f4a
Fixed the issue of skip-to-content button overlapping the header links
rt1301 Oct 26, 2020
f2150cf
Merge pull request #884 from rt1301/Fix_#879
limzykenneth Oct 27, 2020
2df88df
Add doc for setting up local server
artze Nov 4, 2020
b6d6b3d
Fix:#745- Added Edge Detection Example
rt1301 Nov 8, 2020
0528ccf
Merge pull request #887 from rt1301/Fix_#745_EdgeDetection
montoyamoraga Nov 11, 2020
0ed1261
Added Brightness example, and added all the image processing examples…
rt1301 Nov 13, 2020
94d7ca1
Merge pull request #888 from rt1301/#745-Add_Brightness_Example
montoyamoraga Nov 13, 2020
1688e32
Merge remote-tracking branch 'upstream/main' into update-download-p5j…
artze Nov 17, 2020
9862a53
Add translation entries to es, ko and zh-Hans yml
artze Nov 17, 2020
4d9f034
Merge pull request #886 from artze/update-download-p5js-doc
lmccart Nov 17, 2020
eb71562
Automatic update of translation files (4d9f034e1594623e35ffd842d03503…
lmccart Nov 17, 2020
08e552f
Fix PR link in first line of File Structure
KKVANONYMOUS Nov 17, 2020
d1ab60d
Merge pull request #892 from KKVANONYMOUS/main
montoyamoraga Nov 17, 2020
1b84370
Replaced broken iframe link with corresponding cover image
idontknowjs Nov 21, 2020
dc16b8c
Merge pull request #894 from covalentbond/showcase
lmccart Nov 28, 2020
47b72a4
Differing group names in p5.sound references
idontknowjs Nov 29, 2020
5eb0604
Detecting default language preference of user & translating
idontknowjs Nov 30, 2020
40e60eb
Removing extra variables present
idontknowjs Nov 30, 2020
0d481bb
Merge pull request #896 from covalentbond/p5SoundReference
limzykenneth Nov 30, 2020
283476b
Merge pull request #898 from covalentbond/defaultLanguage
lmccart Nov 30, 2020
8fc1cca
Expected toggling of languages
idontknowjs Dec 2, 2020
4111366
Merge pull request #900 from covalentbond/correctRedirect
limzykenneth Dec 2, 2020
574b755
Minor improvements
idontknowjs Dec 2, 2020
6e1b44e
Updated changes
idontknowjs Dec 2, 2020
9b1c757
Merge pull request #901 from covalentbond/minorBugs
lmccart Dec 6, 2020
0dc200c
adding promo to site
lmccart Dec 6, 2020
2c6613b
adding promo to site
lmccart Dec 6, 2020
12e911c
Merge pull request #902 from lmccart/main
lmccart Dec 7, 2020
a59b603
Fix spacing typo on downloads page
tannerdolby Dec 9, 2020
7677371
Merge pull request #904 from tannerdolby/903-fix-spacing-typo
limzykenneth Dec 10, 2020
bab70f5
Corrected overlapping of buttons with code :zap:
idontknowjs Dec 13, 2020
e5a77c6
Changed for responsive examples
idontknowjs Dec 13, 2020
ad303d4
Merge pull request #908 from covalentbond/overlappingIssue
limzykenneth Dec 14, 2020
7cffaa2
Merge pull request #1 from processing/main
rt1301 Dec 16, 2020
fc44fb5
Page returns to correct scroll Position
idontknowjs Dec 16, 2020
8b4cc78
Removed broken script file
idontknowjs Dec 16, 2020
e2bd899
Merge pull request #910 from covalentbond/brokenScript
lmccart Dec 16, 2020
f56a2a4
Merge pull request #909 from covalentbond/hashError
lmccart Dec 16, 2020
e7dc2c7
Added a copy button in get-started webpage to copy the example texts …
rt1301 Dec 19, 2020
5a02240
Update automated_reference_update.md
lmccart Dec 20, 2020
f3e44c2
fix community email
drendog Dec 20, 2020
a6b4f66
Changed the alignment of copy button in get-started and added the ent…
rt1301 Dec 21, 2020
2bb4188
Merge pull request #913 from drendog/main
lmccart Dec 24, 2020
917703a
Updated the HSB color values in the color page of learn section
rt1301 Dec 25, 2020
d3ff0fb
added circle collision example
Dec 26, 2020
abf9277
Added aria-hidden attribute to temporary textarea input
rt1301 Dec 28, 2020
1c67bbb
Merge pull request #911 from rt1301/#906-copy-button
lmccart Dec 28, 2020
0869e62
Automatic update of translation files (1c67bbb369d51ba19129b4c78aabd4…
lmccart Dec 28, 2020
797e603
Remove ignored index.hbs file in learn page templates
limzykenneth Dec 31, 2020
8f5cb4d
Merge pull request #919 from limzykenneth/git-cleanup
lmccart Jan 4, 2021
c684235
Merge pull request #915 from highonweb/Circle-collision
lmccart Jan 4, 2021
1287afb
Merge pull request #917 from rt1301/#4949-ColorPageInfo
limzykenneth Jan 4, 2021
81dba56
remove fundraiser link
lmccart Jan 8, 2021
3252087
Merge branch 'main' of github.com:processing/p5.js-website into main
lmccart Jan 8, 2021
0d1a8dd
Update header.hbs
lmccart Jan 14, 2021
96a08fe
Added space between text and link
ShenpaiSharma Jan 20, 2021
e7d7c86
Added space in English translation and removed space from template
ShenpaiSharma Jan 21, 2021
a983e76
Added space at text part and removed space from link part
ShenpaiSharma Jan 21, 2021
47b9012
fixed imagemin
Rahulm2310 Jan 23, 2021
27e7945
Create test.yml
outofambit Jan 23, 2021
a25b455
Update Gruntfile.js
Rahulm2310 Jan 24, 2021
2f65964
Adding space in the text part using html entity code
ShenpaiSharma Jan 25, 2021
5c30484
Merge pull request #928 from ShenpaiSharma/Issue_#926
limzykenneth Jan 25, 2021
1689fce
Corrected code for Inheritance which was not implementing inheritance…
ShenpaiSharma Jan 27, 2021
3c7f48c
Merge pull request #930 from Rahulm2310/imagemin-fix
limzykenneth Jan 30, 2021
8722093
Merge branch 'main' of https://github.com/processing/p5.js-website in…
ShenpaiSharma Jan 30, 2021
0288a73
Added space and removed extra whitespace at the end
ShenpaiSharma Jan 30, 2021
8e72ffe
Merge pull request #931 from processing/gh-actions
outofambit Jan 30, 2021
52c6cf2
Removed white extra white spaces
ShenpaiSharma Jan 31, 2021
ecd9872
Menu and donation page translated into Chinese
hdcola Jan 26, 2021
8d500d6
Edits on Chinese translation
limzykenneth Feb 3, 2021
e54ff82
Automatic update of translation files (8d500d6ea5029da0fb7cbd476078ff…
limzykenneth Feb 3, 2021
f0b56e6
Merge pull request #934 from ShenpaiSharma/Fixes-Issue_#921
limzykenneth Feb 3, 2021
34c2053
adds Asthetic programming to books without translations
satyasaibhushan Feb 24, 2021
87a5864
Merge pull request #940 from satyasaibhushan/add_Asthetic_programming…
montoyamoraga Feb 24, 2021
4278448
Automatic update of translation files (87a5864ca071389f4adb968123fe48…
montoyamoraga Feb 24, 2021
3f965d6
add Spanish translation of book
montoyamoraga Feb 24, 2021
545fce7
Automatic update of translation files (3f965d67e7a24315c0de481ef72739…
montoyamoraga Feb 24, 2021
6c7e1d8
removed the broken link
ShenpaiSharma Feb 25, 2021
813104a
Merge pull request #942 from ShenpaiSharma/Fix-#939
montoyamoraga Feb 25, 2021
91662c7
fix korean translation of bezier method reference
sosunnyproject Feb 26, 2021
06a9fe0
Merge pull request #944 from sosunnyproject/fix-bezier-korean-transla…
montoyamoraga Feb 26, 2021
8b55a32
additional Korean translation 210208
yinhwa Feb 28, 2021
899b132
updates on Teach page 210302
yinhwa Mar 2, 2021
eaad415
Automatic update of translation files (899b132100194ebbc255a54d668188…
yinhwa Mar 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
37 changes: 37 additions & 0 deletions .github/workflows/update-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update p5.js documentation

on:
# This workflow is triggered by the p5.js repo on every new release.
repository_dispatch
env:
# These are the tag name and the commit sha of the p5.js release.
P5JS_REF: ${{github.event.client_payload.ref}}
P5JS_SHA: ${{github.event.client_payload.sha}}

jobs:
build:
name: Update p5.js documentation
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Install Node.JS 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Extract documentation from the p5.js repo
run: |
npm install
npm run grunt update-enJSON
- name: Get p5.js release info
id: p5js
run: |
echo ::set-output name=VERSION::${P5JS_REF/refs\/tags\//}
echo ::set-output name=SHA::${P5JS_SHA}
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
message: 'Update Reference files for p5.js ${{ steps.p5js.outputs.VERSION }} release (${{ steps.p5js.outputs.SHA }})'
env:
GITHUB_TOKEN: ${{ secrets.DOCS_COMMIT_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/update-translation-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update i18n files

on:
push:
paths:
- 'src/data/reference/*.json'
- 'src/data/*.yml'

jobs:
build:
name: Update i18n files
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Install Node.JS 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm install
- name: Update json files
run: |
npm run grunt update-json-i18n-files
- name: Update yaml files
run: |
npm run grunt update-yaml-i18n-files
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
message: 'Automatic update of translation files (${{ github.sha }})'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94 changes: 89 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

const yaml = require('js-yaml');
const fs = require('fs').promises;
const fse = require('fs-extra');
const git = require('simple-git');
const pkg = require('./package.json');
const update_i18n = require('./updatei18nFiles.js');
const mozjpeg = require('imagemin-mozjpeg');
const pngquant = require('imagemin-pngquant');

module.exports = function(grunt) {
require('time-grunt')(grunt);
Expand Down Expand Up @@ -148,7 +153,8 @@ module.exports = function(grunt) {
imagemin: {
images: {
options: {
optimizationLevel: 2
optimizationLevel: 2,
use: [mozjpeg({quality: 70}), pngquant()] //plugins for jpeg & png image compression
},
files: [{
expand: true,
Expand All @@ -167,8 +173,8 @@ module.exports = function(grunt) {
dist: {
src: [
'<%= config.src %>/assets/css/normalize.css',
'<%= config.src %>/assets/css/main.css',
'<%= config.src %>/assets/css/prism.css'
'<%= config.src %>/assets/css/prism.css',
'<%= config.src %>/assets/css/main.css'
],
dest: '<%= config.dist %>/assets/css/all.css'
}
Expand Down Expand Up @@ -347,10 +353,21 @@ module.exports = function(grunt) {
ignore: [
/^This document appears to be written in English/,
/^Bad value “https:/,
/^Consider adding a “lang” attribute to the “html”/
/^Consider adding a “lang” attribute to the “html”/,
/^Attribute “paypalexpress” not allowed on element “script” at this point./
]
}
}
},
shell: {
generate_dataJSON: {
command: 'npm ci && npm run grunt yui',
options: {
execOptions: {
cwd: 'tmp/p5.js'
}
}
}
}
});

Expand All @@ -371,13 +388,80 @@ module.exports = function(grunt) {
});
});

// runs the updateJSON() function from update18nFiles.js
// is run by the update-translation-files workflow every time one of them is modified
grunt.registerTask('update-json-i18n-files', function() {
const JSONfiles_URL = 'src/data/reference/';
const lang = pkg.languages.filter(v => v !== 'en');
lang.forEach(langCode => {
update_i18n.updateJSON(
JSONfiles_URL + 'en.json',
JSONfiles_URL + langCode + '.json'
);
});
});

// runs the updateYAML() function from update18nFiles.js
// is run by the update-translation-files workflow every time one of them is modified
grunt.registerTask('update-yaml-i18n-files', function() {
const YAMLfiles_URL = 'src/data/';
const lang = pkg.languages.filter(v => v !== 'en');
lang.forEach(langCode => {
update_i18n.updateYAML(
YAMLfiles_URL + 'en.yml',
YAMLfiles_URL + langCode + '.yml'
);
});
});

grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-assemble');
grunt.loadNpmTasks('grunt-file-append');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-html');

grunt.registerTask('make_tmp_dir', function() {
const tmp_path = 'tmp/p5.js';
fse.mkdirpSync(tmp_path);
});

grunt.registerTask('clone_p5js_repo', async function() {
const done = this.async();
try {
await git().clone('https://github.com/processing/p5.js', 'tmp/p5.js');
done();
} catch (err) {
console.log('Failed to clone p5.js repository.');
throw new Error(err);
}
});

grunt.registerTask('generate_dataJSON', ['shell:generate_dataJSON']);

grunt.registerTask('move_dataJSON', function() {
const dataJSON_p5js = 'tmp/p5.js/docs/reference/data.json';
const dataJSON_p5jswebsite = 'src/templates/pages/reference/data.json';
// move the data.json from the cloned p5.js repository to the p5.js-website repository
fse.moveSync(dataJSON_p5js, dataJSON_p5jswebsite, { overwrite: true });
// delete the tmp folder that contained the p5.js repository
fse.removeSync('tmp/');
});

grunt.registerTask('generate_enJSON', function() {
const getenJSON = require('./getenJSON.js');
// generate and save the en.json
getenJSON();
});

grunt.registerTask('update-enJSON', [
'make_tmp_dir',
'clone_p5js_repo',
'generate_dataJSON',
'move_dataJSON',
'generate_enJSON'
]);

// multi-tasks: collections of other tasks
grunt.registerTask('server', [
'build',
Expand Down Expand Up @@ -421,4 +505,4 @@ module.exports = function(grunt) {

// runs with just grunt command
grunt.registerTask('default', ['build']);
};
};
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## How To Contribute

Known bugs and intended new features are tracked using [GitHub issues](https://github.com/processing/p5.js-website/issues). If you'd like to start working on an existing issue, comment on the issue that you plan to work on it so other contributors know it's being handled and can offer help. Once you have completed your work on this issue, [submit a pull request (PR)](https://github.com/processing/p5.js/blob/main/contributor_docs/preparing_a_pull_request.md) against the p5.js master branch. In the description field of the PR, include "resolves #XXXX" tagging the issue you are fixing. If the PR addresses the issue but doesn't completely resolve it (ie the issue should remain open after your PR is merged), write "addresses #XXXX".
Known bugs and intended new features are tracked using [GitHub issues](https://github.com/processing/p5.js-website/issues). If you'd like to start working on an existing issue, comment on the issue that you plan to work on it so other contributors know it's being handled and can offer help. Once you have completed your work on this issue, [submit a pull request (PR)](https://github.com/processing/p5.js/blob/main/contributor_docs/preparing_a_pull_request.md) against the p5.js main branch. In the description field of the PR, include "resolves #XXXX" tagging the issue you are fixing. If the PR addresses the issue but doesn't completely resolve it (ie the issue should remain open after your PR is merged), write "addresses #XXXX".

If you discover a bug or have an idea for a new feature you'd like to add, begin by submitting an issue. Please do not simply submit a pull request containing the fix or new feature without making an issue first, we will probably not be able to accept it. Once you have gotten some feedback on the issue and a go ahead to address it, you can follow the process above to add the fix or feature.

Expand All @@ -24,14 +24,14 @@ Once you've setup the site, type `npm run watch` to run the website. This should

## File structure

* __See note about what to include in pull requests [here](https://github.com/processing/p5.js-website/wiki/Pull-requests).__
* __See note about what to include in pull requests [here](https://github.com/processing/p5.js/blob/main/contributor_docs/preparing_a_pull_request.md).__
* `src/` – All the pieces for generating the built site. __Edits should be made here.__
* `assets/` – All static files (imgs, css, fonts, js, p5_featured homepage sketches)
* Note: if you make edits here you must restart the server to see your changes. To see changes immediately, you can edit the assets files in the dist directory, but need to copy and paste your updated work here for it to be saved.
* `data/` – translation files
* `templates/`
* `layouts/` – default.hbs is main page template
* `pages/` – Contains each of the pages of the p5 site, these get inserted in `{{> body }}` tag of default layout.
* `pages/` – Contains each of the pages of the p5 site, these get inserted in `{{> body }}` tag of default layout. Note that for some pages (ex: learn, teach, and libraries) the hbs files are built from ejs files in the `data/` folder. When this is the case, you will find a README file inside that page's folder with notes about how this works.
* `partials/` – These are reusable pieces that can get added to any page or layout, they correspond to other `{{> filename }}` tags in the pages or default layout.
* `dist/` – Where the rendered files are stored, this gets generated via `grunt server` but does not get added to pull requests as it is auto-built online.
* `Gruntfile.js` – This file contains all the tasks for using assemble and YAML to generate the final, static site. It uses the taskrunner [grunt](http://gruntjs.com/).
Expand Down
21 changes: 21 additions & 0 deletions contributor_docs/automated_reference_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Automated Reference update

The p5.js documentation needs to be updated every time a new p5.js release gets published.
This process is done by the `update-enJSON` [grunt task](https://github.com/processing/p5.js-website/blob/main/Gruntfile.js).
The task:
- clones the p5.js repository in a tmp folder
- generates the updated data.json file with the command `npm run grunt yui`
- commits the data.json in the p5.js-website repository
- generates the updated en.json with the getenJSON() function
- commits the en.json in the p5.js-website repository
- deletes the tmp folder

This task is run by a GitHub workflow in the p5.js-website repository that [gets triggered by another workflow](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch) in the p5.js repository.

Every time a new p5.js release gets published, the update-p5jswebsite workflow (in the p5.js repository) gets triggered and in turn triggers the update-documentation workflow (in the p5.js-website repository) that runs the `update-enJSON` task.

When the update-documentation workflow commits the updated Reference files, the commit message will show both the p5.js release tag and the commit's sha.

### Notes:
- For the repository_dispatch event of the update-p5jswebsite workflow, [this GitHub action](https://github.com/peter-evans/repository-dispatch) was used.
- In order for the update-p5jswebsite workflow to trigger the update-documentation workflow, **it requires a repo scoped Personal Access Token created on a user with write access to the p5.js-website repository**. The Personal Access Token needs to be stored as secret in the p5.js repository.
Loading