From c2563ff8f316cfca1c54c6394425debcd3c5176e Mon Sep 17 00:00:00 2001 From: Peng-Jie Date: Wed, 2 Mar 2016 15:16:39 +0800 Subject: [PATCH] update CONTRIBUTING_zh_TW and fix tip title --- CONTRIBUTING_zh_TW.md | 13 ++++++++++--- .../zh_TW/2016-01-01-angularjs-digest-vs-apply.md | 2 +- ...single-method-for-arrays-and-a-single-element.md | 4 ++-- ...ler-way-of-using-indexof-as-a-contains-clause.md | 2 +- ...-17-nodejs-run-a-module-if-it-is-not-required.md | 2 +- ...r-functions\342\200\224it-kills-optimization.md" | 2 +- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING_zh_TW.md b/CONTRIBUTING_zh_TW.md index 55a3fd5c..db191737 100644 --- a/CONTRIBUTING_zh_TW.md +++ b/CONTRIBUTING_zh_TW.md @@ -2,17 +2,24 @@ 如果要提交 tip 到目錄,fork 這個儲存庫(repository)並加入你的 tip 到檔案內,放入到正確的資料夾(根據語系)。檔案名稱應該為 `2016-xx-xx-name-of-your-tip`。 -當你撰寫你的 tip 時,請使用[這個格式](https://github.com/loverajoel/jstips/blob/gh-pages/POST_TEMPLATE.md)。你的 tip 應該要可以在兩分鐘內讀懂。你可以連結到其他的網站或者是影片讓我們了解更多。 +當你撰寫你的 tip 時,請使用[這個格式](https://github.com/loverajoel/jstips/blob/gh-pages/POST_TEMPLATE.md)。 + +### 要求 +- tip 應該至少可以在兩分鐘內讀懂。 +- 你可以連結到其他的網站或者是影片讓我們了解更多。 +- 程式碼區塊使用 ```js。 +- 避免在 title 提到「JavaScript」(因為我們的 tips 都是與 JavaScript 相關的)。 +- _警告_:tip 標題不要使用反引號(`)來標記程式碼。 當你的 tip 準備好了,依據這個 [PR 樣板](https://github.com/loverajoel/jstips/blob/gh-pages/PULL_REQUEST_TEMPLATE.md),[發送一個 PR](https://help.github.com/articles/using-pull-requests/) 你的 tip 將會被校閱。每天都會有 tip 從可用的 PR 中被合併(merged)。 # 注意 -使用 **xx** 為日期和 tip 的編號。當我們決定合併你的 PR 你可以把它們增加並 squash 到你的 commits。 +使用 **xx** 為日期和 tip 的編號。當我們決定合併你的 PR 你可以把它們增加並 [squash](https://davidwalsh.name/squash-commits-git) 到你的 commits。 # Tip 工作流程 -**Tip 發送** -> **Tip 審查** -> **Tip 接受並發布** +**Tip 發送** ⇒ **Tip 審查** ⇒ **Tip 接受並發布** - 當你提交 tip 時,如果 tip 正在校閱流程,則 tip 狀態為 `under-review`。 - 如果 tip 經過 5 位專業的人士校閱,而且他們都給了 :shipit:,tip 將會被合併(`merge`)到 tip 清單。 diff --git a/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md b/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md index 06d01b98..c5188182 100644 --- a/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md +++ b/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md @@ -1,7 +1,7 @@ --- layout: post -title: AngularJs - `$digest` vs `$apply` +title: AngularJs - $digest vs $apply tip-number: 01 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel diff --git a/_posts/zh_TW/2016-01-06-writing-a-single-method-for-arrays-and-a-single-element.md b/_posts/zh_TW/2016-01-06-writing-a-single-method-for-arrays-and-a-single-element.md index 43f32664..a69e1e32 100644 --- a/_posts/zh_TW/2016-01-06-writing-a-single-method-for-arrays-and-a-single-element.md +++ b/_posts/zh_TW/2016-01-06-writing-a-single-method-for-arrays-and-a-single-element.md @@ -17,14 +17,14 @@ categories: ```javascript function printUpperCase(words) { - var elements = [].concat(words); + var elements = [].concat(words || []); for (var i = 0; i < elements.length; i++) { console.log(elements[i].toUpperCase()); } } ``` -`printUpperCase` 現在已經可以接收單一的 node 或是一個陣列 nodes 當作它的參數了。 +`printUpperCase` 現在已經可以接收單一的 node 或是一個陣列 nodes 當作它的參數了。如果沒有傳送參數,它可以避免拋出潛在的 `TypeError`。 ```javascript printUpperCase("cactus"); diff --git a/_posts/zh_TW/2016-01-15-even-simpler-way-of-using-indexof-as-a-contains-clause.md b/_posts/zh_TW/2016-01-15-even-simpler-way-of-using-indexof-as-a-contains-clause.md index cec6c57f..f5fd6fdf 100644 --- a/_posts/zh_TW/2016-01-15-even-simpler-way-of-using-indexof-as-a-contains-clause.md +++ b/_posts/zh_TW/2016-01-15-even-simpler-way-of-using-indexof-as-a-contains-clause.md @@ -1,7 +1,7 @@ --- layout: post -title: 更簡單的方式將 `indexOf` 當作 contains 使用 +title: 更簡單的方式將 indexOf 當作 contains 使用 tip-number: 15 tip-username: jhogoforbroke tip-username-profile: https://twitter.com/jhogoforbroke diff --git a/_posts/zh_TW/2016-01-17-nodejs-run-a-module-if-it-is-not-required.md b/_posts/zh_TW/2016-01-17-nodejs-run-a-module-if-it-is-not-required.md index 2d77493a..0cc65cb5 100644 --- a/_posts/zh_TW/2016-01-17-nodejs-run-a-module-if-it-is-not-required.md +++ b/_posts/zh_TW/2016-01-17-nodejs-run-a-module-if-it-is-not-required.md @@ -1,7 +1,7 @@ --- layout: post -title: Node.js - 執行尚未被 `required` 的模組 +title: Node.js - 執行尚未被 required 的模組 tip-number: 17 tip-username: odsdq tip-username-profile: https://twitter.com/odsdq diff --git "a/_posts/zh_TW/2016-01-31-avoid-modifying-or-passing-arguments-into-other-functions\342\200\224it-kills-optimization.md" "b/_posts/zh_TW/2016-01-31-avoid-modifying-or-passing-arguments-into-other-functions\342\200\224it-kills-optimization.md" index eb8a9344..c642e707 100644 --- "a/_posts/zh_TW/2016-01-31-avoid-modifying-or-passing-arguments-into-other-functions\342\200\224it-kills-optimization.md" +++ "b/_posts/zh_TW/2016-01-31-avoid-modifying-or-passing-arguments-into-other-functions\342\200\224it-kills-optimization.md" @@ -1,7 +1,7 @@ --- layout: post -title: 避免修改或傳送 `arguments` 到其他函式 - 它會影響優化 +title: 避免修改或傳送 arguments 到其他函式 - 它會影響優化 tip-number: 31 tip-username: berkana tip-username-profile: https://github.com/berkana