diff --git a/meta.js b/meta.js index 41308a0..e55d182 100644 --- a/meta.js +++ b/meta.js @@ -89,6 +89,7 @@ module.exports = { "config/karma.coveralls.conf.js": 'coveralls', ".flowconfig": 'flow', "decls/*": 'flow', + "gitbook/**/**": 'gitbook', "docs/**/**": 'gitbook', ".github/ISSUE_TEMPLATE.md": 'issue', "CONTRIBUTING.md": "contribution" diff --git a/template/docs/.gitkeep b/template/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/template/docs/LANGS.md b/template/gitbook/LANGS.md similarity index 100% rename from template/docs/LANGS.md rename to template/gitbook/LANGS.md diff --git a/template/docs/book.json b/template/gitbook/book.json similarity index 74% rename from template/docs/book.json rename to template/gitbook/book.json index 6786a0a..8dc9a96 100644 --- a/template/docs/book.json +++ b/template/gitbook/book.json @@ -1,10 +1,11 @@ { - "gitbook": "2.x.x", - "plugins": ["edit-link", "github", "advanced-emoji"], + "gitbook": "3.x.x", + "root": "./", + "plugins": ["edit-link", "github", "advanced-emoji@0.2.1"], "pluginsConfig": { {{#unless_eq githubAccount ""}} "edit-link": { - "base": "https://github.com/{{ githubAccount }}/{{ name }}/tree/{{ branch }}/docs", + "base": "https://github.com/{{ githubAccount }}/{{ name }}/tree/{{ branch }}/gitbook", "label": "Edit This Page" }, "github": { diff --git a/template/docs/en/README.md b/template/gitbook/en/README.md similarity index 100% rename from template/docs/en/README.md rename to template/gitbook/en/README.md diff --git a/template/docs/en/SUMMARY.md b/template/gitbook/en/SUMMARY.md similarity index 100% rename from template/docs/en/SUMMARY.md rename to template/gitbook/en/SUMMARY.md diff --git a/template/docs/en/installation.md b/template/gitbook/en/installation.md similarity index 100% rename from template/docs/en/installation.md rename to template/gitbook/en/installation.md diff --git a/template/package.json b/template/package.json index 4dfcce6..27ae7aa 100644 --- a/template/package.json +++ b/template/package.json @@ -33,7 +33,7 @@ "eslint-config-vue": "^1.0.0", "eslint-loader": "^1.3.0", {{#gitbook}} - "gitbook-cli": "^2.2.0", + "gitbook-cli": "^2.3.0", {{/gitbook}} "html-webpack-plugin": "^2.19.0", "jasmine": "^2.4.1", @@ -100,7 +100,7 @@ }, {{/unless_eq}} "scripts": { - "build": "NODE_ENV=production node config/build.js", + "build": "NODE_ENV=production node config/build.js{{#gitbook}} && npm run docs:build{{/gitbook}}", {{#conventional}} "changelog": "conventional-changelog -i CHANGELOG.md -s {{#unless_eq conventionalConfig "none"}}-p {{ conventionalConfig }}{{/unless_eq}}{{#if_eq conventionalConfig "none"}}-n ./config/convention.js{{/if_eq}}", "release": "conventional-github-releaser {{#unless_eq conventionalConfig "none"}}-p {{ conventionalConfig }}{{/unless_eq}}{{#if_eq conventionalConfig "none"}}-n ./config/convention.js{{/if_eq}}", @@ -108,18 +108,14 @@ "clean": "rm -rf coverage && rm -rf dist/*.js* && rm ./*.log", "dev": "webpack-dev-server --quiet --config config/webpack.dev.conf.js --host 0.0.0.0", {{#gitbook}} - "docs": "cd docs && gitbook serve", - {{#unless_eq githubAccount ""}} - "docs:deploy": "cd docs && rm -rf _book && gitbook build && cd _book && git init && git add -A && git commit -m 'update book' && git push -f git@github.com:{{ githubAccount }}/{{ name }}.git master:gh-pages && cd .. && cd ..", - {{/unless_eq}} + "docs": "gitbook serve ./gitbook ./docs", + "docs:build": "gitbook build ./gitbook ./docs", + "docs:install": "gitbook install ./gitbook", {{/gitbook}} {{#flow}} "flow": "flow check", {{/flow}} "lint": "eslint src test config", - {{#gitbook}} - "postinstall": "cd docs && gitbook install && cd ..", - {{/gitbook}} {{#sauce}} "sauce": "npm run sauce:coolkids && npm run sauce:ie && npm run sauce:mobile", "sauce:coolkids": "NODE_ENV=development karma start config/karma.sauce.conf.js -- 0",