From 34a8b17cf7fe4e5b1d7bf50678953ad14e038f00 Mon Sep 17 00:00:00 2001 From: azu Date: Mon, 4 Jul 2016 20:22:42 +0900 Subject: [PATCH 1/3] =?UTF-8?q?refactor(gitbook):=20GitBook=E3=81=AEsource?= =?UTF-8?q?=E4=B8=8B=E3=82=92root=E3=81=A8=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit URLにsourceという文字列を出さないようにするため close #57 --- book.json | 6 ++++-- package.json | 4 ++-- SUMMARY.md => source/README.md | 18 ++++++++++-------- .../_layouts}/website/page.html | 0 .../_layouts}/website/style.css | 0 source/basic/README.md | 3 +++ source/{ch1 => basic}/comments/README.md | 0 .../comments/src/html-like-comments-example.js | 0 source/{ch1 => basic}/condition/README.md | 0 .../condition/src/if/else-example.js | 0 .../condition/src/if/else-if-example.js | 0 .../condition/src/if/if-example.js | 0 .../condition/src/if/leap-year-flat-example.js | 0 .../condition/src/if/leap-year-nest-example.js | 0 .../condition/src/switch/miss-case-example.js | 0 .../condition/src/switch/switch-example.js | 0 .../src/switch/switch-return-example.js | 0 .../test/if/leap-year-flat-example-test.js | 0 .../test/if/leap-year-nest-example-test.js | 0 .../test/swtich/miss-case-example-test.js | 0 .../test/swtich/switch-example-test.js | 0 source/{ch1 => basic}/data-type/README.md | 0 .../data-type/src/binary-example.js | 0 .../data-type/src/hex-example.js | 0 .../data-type/src/octal-example.js | 0 .../data-type/src/typeof-example.js | 0 .../data-type/src/var-null-invalid.js | 0 source/{ch1 => basic}/hello/README.md | 0 source/{ch1 => basic}/hello/src/hello-world.js | 0 .../hello/test/hello-world-test.js | 0 .../basic => basic/introduction}/README.md | 0 .../{ch1 => basic}/read-eval-print/README.md | 0 .../read-eval-print/src/console-example.js | 0 .../src/console-expression-example.js | 0 .../src/console-variable-example.js | 0 source/{ch1 => basic}/variables/README.md | 0 .../src/const-without-assign-invalid.js | 0 source/ch1/README.md | 2 -- source/index.html.md | 3 +++ README.html.md => source/landing/index.html | 4 ++-- 40 files changed, 24 insertions(+), 16 deletions(-) rename SUMMARY.md => source/README.md (58%) rename {_layouts => source/_layouts}/website/page.html (100%) rename {_layouts => source/_layouts}/website/style.css (100%) create mode 100644 source/basic/README.md rename source/{ch1 => basic}/comments/README.md (100%) rename source/{ch1 => basic}/comments/src/html-like-comments-example.js (100%) rename source/{ch1 => basic}/condition/README.md (100%) rename source/{ch1 => basic}/condition/src/if/else-example.js (100%) rename source/{ch1 => basic}/condition/src/if/else-if-example.js (100%) rename source/{ch1 => basic}/condition/src/if/if-example.js (100%) rename source/{ch1 => basic}/condition/src/if/leap-year-flat-example.js (100%) rename source/{ch1 => basic}/condition/src/if/leap-year-nest-example.js (100%) rename source/{ch1 => basic}/condition/src/switch/miss-case-example.js (100%) rename source/{ch1 => basic}/condition/src/switch/switch-example.js (100%) rename source/{ch1 => basic}/condition/src/switch/switch-return-example.js (100%) rename source/{ch1 => basic}/condition/test/if/leap-year-flat-example-test.js (100%) rename source/{ch1 => basic}/condition/test/if/leap-year-nest-example-test.js (100%) rename source/{ch1 => basic}/condition/test/swtich/miss-case-example-test.js (100%) rename source/{ch1 => basic}/condition/test/swtich/switch-example-test.js (100%) rename source/{ch1 => basic}/data-type/README.md (100%) rename source/{ch1 => basic}/data-type/src/binary-example.js (100%) rename source/{ch1 => basic}/data-type/src/hex-example.js (100%) rename source/{ch1 => basic}/data-type/src/octal-example.js (100%) rename source/{ch1 => basic}/data-type/src/typeof-example.js (100%) rename source/{ch1 => basic}/data-type/src/var-null-invalid.js (100%) rename source/{ch1 => basic}/hello/README.md (100%) rename source/{ch1 => basic}/hello/src/hello-world.js (100%) rename source/{ch1 => basic}/hello/test/hello-world-test.js (100%) rename source/{ch1/basic => basic/introduction}/README.md (100%) rename source/{ch1 => basic}/read-eval-print/README.md (100%) rename source/{ch1 => basic}/read-eval-print/src/console-example.js (100%) rename source/{ch1 => basic}/read-eval-print/src/console-expression-example.js (100%) rename source/{ch1 => basic}/read-eval-print/src/console-variable-example.js (100%) rename source/{ch1 => basic}/variables/README.md (100%) rename source/{ch1 => basic}/variables/src/const-without-assign-invalid.js (100%) delete mode 100644 source/ch1/README.md create mode 100644 source/index.html.md rename README.html.md => source/landing/index.html (95%) diff --git a/book.json b/book.json index 40cb866bc9..a4d8e7322a 100644 --- a/book.json +++ b/book.json @@ -2,11 +2,13 @@ "gitbook": ">=2.5.2", "title": "JavaScriptの入門書", "description": "この書籍はES2015以降をベースとしたJavaScript入門書となる予定", + "root": "./source/", "structure":{ - "readme": "README.html.md" + "readme": "index.html.md", + "summary": "README.md" }, "plugins": [ "include-codeblock", "japanese-support" ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index 16ee5d093e..e74b77d4e0 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "eslint:js": "eslint source/", "eslint:fix": "eslint --fix source/", "textlint": "gulp textlint", - "textlint:fix": "summary-to-path | xargs textlint --fix", + "textlint:fix": "summary-to-path ./source/README.md | xargs textlint --fix", "test:example": "gulp test:example test:doc-code", - "test:ch1": "mocha './source/ch1/**/*-test.js'", + "test:basic": "mocha './source/basic/**/*-test.js'", "test": "npm-run-all -l --parallel test:* textlint eslint:* build" }, "keywords": [ diff --git a/SUMMARY.md b/source/README.md similarity index 58% rename from SUMMARY.md rename to source/README.md index 2014464c07..401f581202 100644 --- a/SUMMARY.md +++ b/source/README.md @@ -1,13 +1,15 @@ +# 目次 + - 書籍の読み方 -- [基礎文法](source/ch1/README.md) - - [JavaScriptとは](source/ch1/basic/README.md) - - [コメント](source/ch1/comments/README.md) +- [基礎文法](basic/README.md) + - [JavaScriptとは](basic/introduction/README.md) + - [コメント](basic/comments/README.md) - 字句構造 - Strict mode - - [変数と宣言](source/ch1/variables/README.md) - - [値の評価と表示](source/ch1/read-eval-print/README.md) - - [データ型とリテラル](source/ch1/data-type/README.md) - - [条件分岐](source/ch1/condition/README.md) + - [変数と宣言](basic/variables/README.md) + - [値の評価と表示](basic/read-eval-print/README.md) + - [データ型とリテラル](basic/data-type/README.md) + - [条件分岐](basic/condition/README.md) - 式と演算子 - 文 - String @@ -34,7 +36,7 @@ - Proxy - Unicode - Intl -- 応用編(ユースケース) +- 応用編(ユースケース) - Ajaxで通信 - Node.jsでCLIアプリ - TODOアプリ diff --git a/_layouts/website/page.html b/source/_layouts/website/page.html similarity index 100% rename from _layouts/website/page.html rename to source/_layouts/website/page.html diff --git a/_layouts/website/style.css b/source/_layouts/website/style.css similarity index 100% rename from _layouts/website/style.css rename to source/_layouts/website/style.css diff --git a/source/basic/README.md b/source/basic/README.md new file mode 100644 index 0000000000..7b1a07b894 --- /dev/null +++ b/source/basic/README.md @@ -0,0 +1,3 @@ +# 第1章 基本文法 + +JavaScriptの基本文法について解説します。 diff --git a/source/ch1/comments/README.md b/source/basic/comments/README.md similarity index 100% rename from source/ch1/comments/README.md rename to source/basic/comments/README.md diff --git a/source/ch1/comments/src/html-like-comments-example.js b/source/basic/comments/src/html-like-comments-example.js similarity index 100% rename from source/ch1/comments/src/html-like-comments-example.js rename to source/basic/comments/src/html-like-comments-example.js diff --git a/source/ch1/condition/README.md b/source/basic/condition/README.md similarity index 100% rename from source/ch1/condition/README.md rename to source/basic/condition/README.md diff --git a/source/ch1/condition/src/if/else-example.js b/source/basic/condition/src/if/else-example.js similarity index 100% rename from source/ch1/condition/src/if/else-example.js rename to source/basic/condition/src/if/else-example.js diff --git a/source/ch1/condition/src/if/else-if-example.js b/source/basic/condition/src/if/else-if-example.js similarity index 100% rename from source/ch1/condition/src/if/else-if-example.js rename to source/basic/condition/src/if/else-if-example.js diff --git a/source/ch1/condition/src/if/if-example.js b/source/basic/condition/src/if/if-example.js similarity index 100% rename from source/ch1/condition/src/if/if-example.js rename to source/basic/condition/src/if/if-example.js diff --git a/source/ch1/condition/src/if/leap-year-flat-example.js b/source/basic/condition/src/if/leap-year-flat-example.js similarity index 100% rename from source/ch1/condition/src/if/leap-year-flat-example.js rename to source/basic/condition/src/if/leap-year-flat-example.js diff --git a/source/ch1/condition/src/if/leap-year-nest-example.js b/source/basic/condition/src/if/leap-year-nest-example.js similarity index 100% rename from source/ch1/condition/src/if/leap-year-nest-example.js rename to source/basic/condition/src/if/leap-year-nest-example.js diff --git a/source/ch1/condition/src/switch/miss-case-example.js b/source/basic/condition/src/switch/miss-case-example.js similarity index 100% rename from source/ch1/condition/src/switch/miss-case-example.js rename to source/basic/condition/src/switch/miss-case-example.js diff --git a/source/ch1/condition/src/switch/switch-example.js b/source/basic/condition/src/switch/switch-example.js similarity index 100% rename from source/ch1/condition/src/switch/switch-example.js rename to source/basic/condition/src/switch/switch-example.js diff --git a/source/ch1/condition/src/switch/switch-return-example.js b/source/basic/condition/src/switch/switch-return-example.js similarity index 100% rename from source/ch1/condition/src/switch/switch-return-example.js rename to source/basic/condition/src/switch/switch-return-example.js diff --git a/source/ch1/condition/test/if/leap-year-flat-example-test.js b/source/basic/condition/test/if/leap-year-flat-example-test.js similarity index 100% rename from source/ch1/condition/test/if/leap-year-flat-example-test.js rename to source/basic/condition/test/if/leap-year-flat-example-test.js diff --git a/source/ch1/condition/test/if/leap-year-nest-example-test.js b/source/basic/condition/test/if/leap-year-nest-example-test.js similarity index 100% rename from source/ch1/condition/test/if/leap-year-nest-example-test.js rename to source/basic/condition/test/if/leap-year-nest-example-test.js diff --git a/source/ch1/condition/test/swtich/miss-case-example-test.js b/source/basic/condition/test/swtich/miss-case-example-test.js similarity index 100% rename from source/ch1/condition/test/swtich/miss-case-example-test.js rename to source/basic/condition/test/swtich/miss-case-example-test.js diff --git a/source/ch1/condition/test/swtich/switch-example-test.js b/source/basic/condition/test/swtich/switch-example-test.js similarity index 100% rename from source/ch1/condition/test/swtich/switch-example-test.js rename to source/basic/condition/test/swtich/switch-example-test.js diff --git a/source/ch1/data-type/README.md b/source/basic/data-type/README.md similarity index 100% rename from source/ch1/data-type/README.md rename to source/basic/data-type/README.md diff --git a/source/ch1/data-type/src/binary-example.js b/source/basic/data-type/src/binary-example.js similarity index 100% rename from source/ch1/data-type/src/binary-example.js rename to source/basic/data-type/src/binary-example.js diff --git a/source/ch1/data-type/src/hex-example.js b/source/basic/data-type/src/hex-example.js similarity index 100% rename from source/ch1/data-type/src/hex-example.js rename to source/basic/data-type/src/hex-example.js diff --git a/source/ch1/data-type/src/octal-example.js b/source/basic/data-type/src/octal-example.js similarity index 100% rename from source/ch1/data-type/src/octal-example.js rename to source/basic/data-type/src/octal-example.js diff --git a/source/ch1/data-type/src/typeof-example.js b/source/basic/data-type/src/typeof-example.js similarity index 100% rename from source/ch1/data-type/src/typeof-example.js rename to source/basic/data-type/src/typeof-example.js diff --git a/source/ch1/data-type/src/var-null-invalid.js b/source/basic/data-type/src/var-null-invalid.js similarity index 100% rename from source/ch1/data-type/src/var-null-invalid.js rename to source/basic/data-type/src/var-null-invalid.js diff --git a/source/ch1/hello/README.md b/source/basic/hello/README.md similarity index 100% rename from source/ch1/hello/README.md rename to source/basic/hello/README.md diff --git a/source/ch1/hello/src/hello-world.js b/source/basic/hello/src/hello-world.js similarity index 100% rename from source/ch1/hello/src/hello-world.js rename to source/basic/hello/src/hello-world.js diff --git a/source/ch1/hello/test/hello-world-test.js b/source/basic/hello/test/hello-world-test.js similarity index 100% rename from source/ch1/hello/test/hello-world-test.js rename to source/basic/hello/test/hello-world-test.js diff --git a/source/ch1/basic/README.md b/source/basic/introduction/README.md similarity index 100% rename from source/ch1/basic/README.md rename to source/basic/introduction/README.md diff --git a/source/ch1/read-eval-print/README.md b/source/basic/read-eval-print/README.md similarity index 100% rename from source/ch1/read-eval-print/README.md rename to source/basic/read-eval-print/README.md diff --git a/source/ch1/read-eval-print/src/console-example.js b/source/basic/read-eval-print/src/console-example.js similarity index 100% rename from source/ch1/read-eval-print/src/console-example.js rename to source/basic/read-eval-print/src/console-example.js diff --git a/source/ch1/read-eval-print/src/console-expression-example.js b/source/basic/read-eval-print/src/console-expression-example.js similarity index 100% rename from source/ch1/read-eval-print/src/console-expression-example.js rename to source/basic/read-eval-print/src/console-expression-example.js diff --git a/source/ch1/read-eval-print/src/console-variable-example.js b/source/basic/read-eval-print/src/console-variable-example.js similarity index 100% rename from source/ch1/read-eval-print/src/console-variable-example.js rename to source/basic/read-eval-print/src/console-variable-example.js diff --git a/source/ch1/variables/README.md b/source/basic/variables/README.md similarity index 100% rename from source/ch1/variables/README.md rename to source/basic/variables/README.md diff --git a/source/ch1/variables/src/const-without-assign-invalid.js b/source/basic/variables/src/const-without-assign-invalid.js similarity index 100% rename from source/ch1/variables/src/const-without-assign-invalid.js rename to source/basic/variables/src/const-without-assign-invalid.js diff --git a/source/ch1/README.md b/source/ch1/README.md deleted file mode 100644 index 08ebb21f57..0000000000 --- a/source/ch1/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# 第1章 基本文法 - diff --git a/source/index.html.md b/source/index.html.md new file mode 100644 index 0000000000..1561462e90 --- /dev/null +++ b/source/index.html.md @@ -0,0 +1,3 @@ +{% include "./landing/index.html" %} + + diff --git a/README.html.md b/source/landing/index.html similarity index 95% rename from README.html.md rename to source/landing/index.html index 2fc129c20c..6ff358df0b 100644 --- a/README.html.md +++ b/source/landing/index.html @@ -1,5 +1,5 @@ - +
@@ -51,7 +51,7 @@

- +
From 32b23a7ef5ee430c84dd8becb20fac3de48ca378 Mon Sep 17 00:00:00 2001 From: azu Date: Mon, 4 Jul 2016 20:25:24 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix(test):=20test:invalid=E3=81=8C=E5=8B=95?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1617c03f23..815b3557b0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -99,7 +99,7 @@ gulp.task('test:example', function () { /** * *-invalid.js が実行 または パースエラーとなることをテストする **/ -gulp.task('test:example', function () { +gulp.task('test:invalid', function () { return gulp.src(['./source/**/*-invalid.js', '!source/**/node_modules{,/**}']) .on('error', function (error) { console.error(error); diff --git a/package.json b/package.json index e74b77d4e0..a4527ea1ed 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "eslint:fix": "eslint --fix source/", "textlint": "gulp textlint", "textlint:fix": "summary-to-path ./source/README.md | xargs textlint --fix", - "test:example": "gulp test:example test:doc-code", + "test:example": "gulp test:example test:invalid test:doc-code", "test:basic": "mocha './source/basic/**/*-test.js'", "test": "npm-run-all -l --parallel test:* textlint eslint:* build" }, From 45490e5d256bce1c81531a8ee1965b83cc12c54b Mon Sep 17 00:00:00 2001 From: azu Date: Mon, 4 Jul 2016 20:28:39 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat(gitbook):=20=E7=B7=A8=E9=9B=86?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #67 --- book.json | 13 ++++++++++--- package.json | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/book.json b/book.json index a4d8e7322a..c9f6515979 100644 --- a/book.json +++ b/book.json @@ -3,12 +3,19 @@ "title": "JavaScriptの入門書", "description": "この書籍はES2015以降をベースとしたJavaScript入門書となる予定", "root": "./source/", - "structure":{ + "structure": { "readme": "index.html.md", "summary": "README.md" }, "plugins": [ "include-codeblock", - "japanese-support" - ] + "japanese-support", + "edit-link" + ], + "pluginsConfig": { + "edit-link": { + "base": "https://github.com/asciidwango/js-primer/edit/master/source/", + "label": "このページを編集" + } + } } diff --git a/package.json b/package.json index a4527ea1ed..449e7b5615 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "eslint": "^3.0.0", "eslint-plugin-markdown": "^1.0.0-beta.2", "gitbook-cli": "^2.1.2", + "gitbook-plugin-edit-link": "^2.0.2", "gitbook-plugin-include-codeblock": "^1.4.0", "gitbook-plugin-japanese-support": "0.0.1", "gitbook-summary-to-path": "^1.0.1",