Skip to content

Commit

Permalink
Merge branch 'main' of github.com:processing/p5.js into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lmccart committed Mar 10, 2021
2 parents e133685 + 8fb8c93 commit f8cd935
Show file tree
Hide file tree
Showing 27 changed files with 1,287 additions and 552 deletions.
104 changes: 104 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2328,6 +2328,110 @@
"code",
"review"
]
},
{
"login": "siv2r",
"name": "Sivaram D",
"avatar_url": "https://avatars3.githubusercontent.com/u/56887198?v=4",
"profile": "https://github.com/siv2r",
"contributions": [
"doc",
"code"
]
},
{
"login": "frappelatte28",
"name": "Pragya",
"avatar_url": "https://avatars0.githubusercontent.com/u/64382399?v=4",
"profile": "https://github.com/frappelatte28",
"contributions": [
"code"
]
},
{
"login": "myselfhimself",
"name": "Jonathan-David Schröder",
"avatar_url": "https://avatars.githubusercontent.com/u/1265346?v=4",
"profile": "https://github.com/myselfhimself",
"contributions": [
"ideas",
"code"
]
},
{
"login": "ShenpaiSharma",
"name": "Shubham Kumar",
"avatar_url": "https://avatars.githubusercontent.com/u/47415702?v=4",
"profile": "https://github.com/ShenpaiSharma",
"contributions": [
"code"
]
},
{
"login": "nakednous",
"name": "Jean Pierre Charalambos",
"avatar_url": "https://avatars.githubusercontent.com/u/645599?&v=4",
"profile": "https://github.com/nakednous",
"contributions": [
"code",
"tool"
]
},
{
"login": "satyasaibhushan",
"name": "Sai Bhushan",
"avatar_url": "https://avatars.githubusercontent.com/u/40578313?v=4",
"profile": "https://github.com/satyasaibhushan",
"contributions": [
"code",
"doc"
]
},
{
"login": "vulongphan",
"name": "Long Phan",
"avatar_url": "https://avatars.githubusercontent.com/u/46087559?v=4",
"profile": "https://github.com/vulongphan",
"contributions": [
"code"
]
},
{
"login": "jcelerier",
"name": "Jean-Michaël Celerier",
"avatar_url": "https://avatars.githubusercontent.com/u/2772730?v=4",
"profile": "https://jcelerier.name",
"contributions": [
"bug"
]
},
{
"login": "sosunnyproject",
"name": "So Sun Park",
"avatar_url": "https://avatars.githubusercontent.com/u/17012862?v=4",
"profile": "https://sosunnyproject.github.io",
"contributions": [
"doc"
]
},
{
"login": "msub2",
"name": "Daniel Adams",
"avatar_url": "https://avatars.githubusercontent.com/u/70986246?v=4",
"profile": "http://msub2.com",
"contributions": [
"code",
"doc"
]
},
{
"login": "Aloneduckling",
"name": "Aloneduckling",
"avatar_url": "https://avatars.githubusercontent.com/u/54030684?v=4",
"profile": "https://shantanu-kaushik.herokuapp.com/",
"contributions": [
"doc"
]
}
],
"repoType": "github",
Expand Down
764 changes: 390 additions & 374 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contributor_docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Here is a quick summary of code style rules. Please note that this list may be i

* Comment your code whenever there is ambiguity or complexity in the function you are writing

* See the [Mozilla JS practices](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#JavaScript_practices) as a useful guide for more styling tips
* See the [Mozilla JS practices](https://firefox-source-docs.mozilla.org/code-quality/coding-style/index.html) as a useful guide for more styling tips



Expand Down
11 changes: 6 additions & 5 deletions contributor_docs/inline_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ If a method has multiple possible parameter options, you can specify each indivi
```

Notes:
* If a parameter has been defined previously, like `a` in this case, you do not need to fill in the definition again.
* If a parameter was given description previously, like `a` in this case, you do not need to rewrite its description again.
* It is not necessary to create a separate signature if the only difference between two signatures is the addition of an optional parameter.
* You can see two examples of this inline in the source code for [background](https://github.com/processing/p5.js/blob/f38f91308fdacc2f1982e0430b620778fff30a5a/src/color/setting.js#L106) and [color](https://github.com/processing/p5.js/blob/f38f91308fdacc2f1982e0430b620778fff30a5a/src/color/creating_reading.js#L241).

Expand Down Expand Up @@ -147,7 +147,7 @@ Use `@private` if a property or variable is a private variable (default is `@pub

## Specify module for files

The top of each *file* should contain a `@module` tag. Modules should correspond to JavaScript files (or require.js modules). They can work as groups in the lists of items. See http://p5js.org/api/#methods (the modules are COLOR, IMAGE, PVECTOR, etc.).
The top of each *file* should contain a `@module` tag. Modules should correspond to JavaScript files (or require.js modules). They can work as groups in the lists of items. See [here](https://p5js.org/reference/#collection-list-nav) (the modules are COLOR, IMAGE, IO, PVECTOR, etc.).

```
/**
Expand Down Expand Up @@ -267,16 +267,17 @@ horizontal wave pattern effected by mouse x-position & updating noise values.

## Template for methods
Here is an example for a well-documented method. To create a new method, you can use [this template](https://github.com/processing/p5.js/tree/main/contributor_docs/method.example.js). Replace the text with your method's variables and remove the remaining ones.

![Image showing inline documentation example for methods](https://raw.githubusercontent.com/processing/p5.js/main/contributor_docs/images/method-template-example.png)


## Generating documentation

* Run `grunt yui:build` once first to generate all local files needed, as well as a copy of the reference from the source code. Run it again anytime you make changes to the core JS files behind the yuidoc reference page. These are changes in files located in the yuidoc-p5-theme-src folder, NOT inline documentation changes to src.
* If you only made changes to the source code, you can just run `grunt yui`, though `grunt yui:build` will also do the trick.
* Run `npm run grunt yui:build` once first to generate all local files needed, as well as a copy of the reference from the source code. Run it again anytime you make changes to the core JS files behind the yuidoc reference page. These are changes in files located in the yuidoc-p5-theme folder, NOT inline documentation changes to src.
* If you only made changes to the source code, you can just run `npm run grunt yui`, though `npm run grunt yui:build` will also do the trick.
* You can run `npm run docs:dev` to launch a live preview of the site that will update each time you make changes. (You will need to refresh the page after making changes to see them appear.)

The build reference can be found in docs/reference. To preview it locally, run `grunt yui:dev` and view it as http://localhost:9001/docs/reference/.
The build reference can be found in docs/reference. To preview it locally, run `npm run grunt yui:dev` and view it as http://localhost:9001/docs/reference/.


## Spanish language version
Expand Down
6 changes: 3 additions & 3 deletions contributor_docs/ko/inline_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ horizontal wave pattern effected by mouse x-position & updating noise values.

## 문서 생성

* 먼저 `grunt yui:build`를 한 번 실행하여 필요한 모든 로컬 파일과 소스 코드의 참조 사본을 생성합니다. yuidoc 레퍼런스 페이지 뒤에서 코어 JS 파일을 변경할 때마다 다시 실행해주세요. 이는 src의 인라인 문서 변경이 아니라 yuidoc-p5-theme-src 폴더에있는 파일에 대한 변경 사항입니다.
* 소스 코드만 변경했다면 `grunt yui`만 실행할 수 있지만 `grunt yui:build`도 사용할 수 있습니다.
* 먼저 `npm run grunt yui:build`를 한 번 실행하여 필요한 모든 로컬 파일과 소스 코드의 참조 사본을 생성합니다. yuidoc 레퍼런스 페이지 뒤에서 코어 JS 파일을 변경할 때마다 다시 실행해주세요. 이는 src의 인라인 문서 변경이 아니라 yuidoc-p5-theme-src 폴더에있는 파일에 대한 변경 사항입니다.
* 소스 코드만 변경했다면 `npm run grunt yui`만 실행할 수 있지만 `npm run grunt yui:build`도 사용할 수 있습니다.
* `npm run docs:dev`를 실행하여 변경할 때마다 업데이트되는 사이트의 실시간 미리보기를 할 수 있습니다.(변경 한 후 페이지를 새로고침해야 표시됩니다.)

빌드 레퍼런스는 docs/reference에서 찾을 수 있으며. 로컬에서 미리 보려면 `grunt yui:dev`를 실행해 http://localhost:9001/docs/reference/ 에서 살펴보세요.
빌드 레퍼런스는 docs/reference에서 찾을 수 있으며. 로컬에서 미리 보려면 `npm run grunt yui:dev`를 실행해 http://localhost:9001/docs/reference/ 에서 살펴보세요.


## 스페인어 버전
Expand Down
4 changes: 2 additions & 2 deletions contributor_docs/unit_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ If you have to add a test file for a module to `test/unit`, then you'll also nee

### Writing Unit Tests

Pick a unit, it can be a method or a variable to test. Lets use `p5.prototype.isKeyPressed` as an example. Before beginning to write tests, we need to understand the expected behaviour of this method.
Pick a unit, it can be a method or a variable to test. Lets use `p5.prototype.keyIsPressed` as an example. Before beginning to write tests, we need to understand the expected behaviour of this method.
**Expected behaviour:** The boolean system variable should be true if any key is pressed and false if no keys are pressed.
Now you can think of various tests against this expected behaviour. Possible test cases could be:

Expand All @@ -89,7 +89,7 @@ Now you can think of various tests against this expected behaviour. Possible tes
- it should be false if no keys are pressed
- if you can think of more, go ahead and add tests for them!

We can create a test suite for `p5.prototype.isKeyPressed` and start creating tests for it. We will use mocha for structuring our unit tests.
We can create a test suite for `p5.prototype.keyIsPressed` and start creating tests for it. We will use mocha for structuring our unit tests.

```
suite('p5.prototype.keyIsPressed', function() {
Expand Down
36 changes: 36 additions & 0 deletions contributor_docs/zh/contributing_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
文档对于新的学习者和有经验的程序员来说都是必不可少的。它通过向那些不太熟悉p5.js的人伸出友好之手,帮助我们的社区变得更包容。它还能帮助我们找到代码本身的bug和问题,因为我们在文档中测试和尝试一些东西。

有几种方法可以为文档做出贡献:

## ☝️ Open issues
如果你刚刚开始,一个非常有帮助的方式是通过打开文档需求的问题。如果你注意到一个错别字、一个缺失或损坏的例子、或者一个令人困惑的函数描述,[为它打开一个 issue](https://github.com/processing/p5.js/issues)!请附上需要修复的页面的链接,以便我们可以很容易地找到。

## 🗯 为参考资料作出贡献
仔细阅读[参考文献](http://p5js.org/reference/),看看是否有错别字、损坏的例子或混乱的文档。如果是简单的修复,您可以直接修改。如果是需要讨论的问题,请创建一个 [issue](https://github.com/processing/p5.js/issues/new)
* 这里是[为初次使用p5.js代码库进行设置](./README.md)的说明。
* 参考文献是根据源代码中的内联文档(在`src/`文件夹中找到)建立的。
* 这里是关于[如何更新或添加内联文档和例子](./inline_documentation.md)的信息。
* 如果你发现[西班牙语文档](http://p5js.org/es)有错误,在[这里](https://github.com/processing/p5.js-website#internationalization-i18n-and-structure)能找到更新指示。
* 社区维护的Typescript定义在[此处](https://github.com/p5-types/p5.ts)

## ✨ 制作示例
虽然参考文的例子通常是非常简单的代码片段,但更长、更复杂的示例也是有用的。
* 目前我们正在努力将[processing示例页](https://processing.org/examples/)中的示例移植到[p5.js示例页](http://p5js.org/examples)。如果你愿意帮忙,请看说明[这里](https://github.com/processing/p5.js-website/blob/main/contributor_docs/Adding_examples.md)
* 或者,你可以创建你自己的示例,并在你喜欢的地方独立发布。如果你在网上分享它们,请标记[@p5xjs](https://twitter.com/p5xjs)或发送电子邮件到[[email protected]](mailto:[email protected])让我们知道,我们将广泛分享! 这个[嵌入p5.js指南](https://github.com/processing/p5.js/wiki/Embedding-p5.js)可能对你在网上发布你的示例很有用。
* 如果你发现p5.js中的bug,请在[issues](https://github.com/processing/p5.js/issues)中记录下来。

## 👯 制作教程
* 如果你是p5.js的新手,这是一个很好开始的地方。试着自己做一些东西,然后做一个教程来教别人做。
* 目前,我们正在努力将教程从[processing教程页](https://processing.org/tutorials)移植到[p5.js学习页](http://p5js.org/learn)。如果你愿意帮忙,请看[这个](https://p5js.org/learn/tutorial-guide.html)教程制作教程。
* 我们也欢迎不同主题的教程。你可以在任何地方,以任何格式发布这些教程。如果您在网上分享这些教程,请给[@p5xjs](https://twitter.com/p5xjs)打上标签,或者给[[email protected]](mailto:[email protected])发邮件,让我们知道,我们会广泛地分享这些教程。我们特别鼓励针对特定受众或使用案例创建的教程(例如:记者、维权人士、诗人、孩子、老人、梦想家、不同语言的p5等等)。我们喜欢考虑,谁还没有感觉到自己在p5社区中受到欢迎或融入,我们能否把学习作为一种邀请?你用什么语言和你的听众沟通,让他们感到被了解?请自由尝试你的形式。可以参考[Sharon De La Cruz关于代码俚语的演讲](https://www.youtube.com/watch?v=CFT6w9NKfCs)获得灵感。
* 如果你发现p5.js中的bug,请在[issues](https://github.com/processing/p5.js/issues)中记录下来。

## 👉 开始
* 阅读[p5.js社区声明](http://p5js.org/community/)
* 可选:查看[贡献者文档](./README.md)以了解版本库的概况,并学习如何构建代码(如果与你相关的话)。
* 所有的讨论都发生在github issue上,所以你不需要加入slack/gitter/等等频道。
* 在readme.md文件中把你的名字加入[贡献者名单](https://github.com/processing/p5.js#contributors)! 说明[在此](https://github.com/processing/p5.js/issues/2309)
* 当然,如果你更喜欢修复bug,可以随时跳进任何一个[issue](https://github.com/processing/p5.js/issues)!

欢迎!我们很高兴你在这里!
❤️ p5.js社区
2 changes: 1 addition & 1 deletion lib/empty-example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
</style>
<script src="../p5.js"></script>
<script src="../addons/p5.sound.min.js"></script>
<script src="../addons/p5.sound.js"></script>
<script src="sketch.js"></script>
</head>

Expand Down
Loading

0 comments on commit f8cd935

Please sign in to comment.