From da67d0713acb8de762fcfe0fe3171ee7d7a1d82b Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Fri, 24 Mar 2017 20:11:59 +0800 Subject: [PATCH] fix(template): update template --- .gitignore | 1 + docs/.nojekyll | 0 docs/README.md | 56 +++++++++++++++++++++++++++++++++++ docs/index.html | 20 +++++++------ lib/commands/init.js | 4 +-- lib/template/index.html | 2 +- lib/template/index.local.html | 2 +- tools/locales/zh.json | 9 ++++++ 8 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 docs/.nojekyll create mode 100644 docs/README.md diff --git a/.gitignore b/.gitignore index cd25ce0..1beae6f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .DS_Store .vscode/ node_modules/ +yarn.lock \ No newline at end of file diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..627723c --- /dev/null +++ b/docs/README.md @@ -0,0 +1,56 @@ +# docsify-cli + +[![Build Status master branch](https://img.shields.io/travis/QingWei-Li/docsify-cli/master.svg?style=flat-square)](https://travis-ci.org/QingWei-Li/docsify-cli) +[![License](https://img.shields.io/github/license/QingWei-Li/docsify-cli.svg?style=flat-square)](https://github.com/QingWei-Li/docsify-cli/blob/master/LICENSE) +[![Github tag](https://img.shields.io/github/tag/QingWei-Li/docsify-cli.svg?style=flat-square)](https://github.com/QingWei-Li/docsify-cli/tags) +[![npm version](https://img.shields.io/npm/v/docsify-cli.svg?style=flat-square)](https://www.npmjs.com/package/docsify-cli) +[![npm total downloads](https://img.shields.io/npm/dt/docsify-cli.svg?style=flat-square)](https://www.npmjs.com/package/docsify-cli) +[![npm total monthly](https://img.shields.io/npm/dm/docsify-cli.svg?style=flat-square)](https://www.npmjs.com/package/docsify-cli) + +> 🖌 docsify cli - A magical documentation generator. + +## Links + +* [docsify](https://github.com/QingWei-Li/docsify) + +## Screenshots + +![](https://cloud.githubusercontent.com/assets/7565692/20603335/10bf80a0-b29c-11e6-93bb-5c3187f76edd.gif) + +## Installation + +```shell +npm i docsify-cli -g +# yarn global add docsify-cli +``` + +## Usage + +### init + +Creates the docs, by default in the current directory. + +```shell +docsify init [path] +``` + +#### options + +| Short | Long | Description | +|---|---|---| +| `-l` | `--local` | Copy `docsify` to docs path, default use `unpkg.com` cdn | +| `-t` | `--theme` | Choose theme, default `vue.css` | + +### serve - run serve to preview + +```shell +docsify serve [path] +``` + +| Short | Long | Description | +|---|---|---| +| `-p` | `--port` | Listen port, defaults to 3000. | + +## License + +MIT diff --git a/docs/index.html b/docs/index.html index 7d5d58a..23ed954 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,17 +2,19 @@ - docsify cli - A magical documentation generator. - + docsify-cli - A magical documentation generator. + - +
- - \ No newline at end of file + + + diff --git a/lib/commands/init.js b/lib/commands/init.js index f3598e5..820727b 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -46,14 +46,14 @@ module.exports = function (path, local, theme) { if (PKG.name) { replace(target(filename), 'Document', PKG.name + (PKG.description ? (' - ' + PKG.description) : '')) - replace(target(filename), 'data-name=""', `data-name="${PKG.name}"`) + replace(target(filename), 'name: \'\',', `name: '${PKG.name}',`) } if (PKG.description) { replace(target(filename), 'Description', PKG.description) } if (PKG.repository) { const repo = (PKG.repository.url || PKG.repository).replace(/\.git$/g, '').replace(/^git\+/g, '') - replace(target(filename), 'data-repo=""', `data-repo="${repo}"`) + replace(target(filename), 'repo: \'\'', `repo: '${repo}'`) } console.log(msg) } diff --git a/lib/template/index.html b/lib/template/index.html index ee65318..17e76a6 100644 --- a/lib/template/index.html +++ b/lib/template/index.html @@ -12,8 +12,8 @@ diff --git a/lib/template/index.local.html b/lib/template/index.local.html index 1bb5225..ed993e4 100644 --- a/lib/template/index.local.html +++ b/lib/template/index.local.html @@ -12,8 +12,8 @@ diff --git a/tools/locales/zh.json b/tools/locales/zh.json index 1a0c254..e754d6a 100644 --- a/tools/locales/zh.json +++ b/tools/locales/zh.json @@ -1,5 +1,14 @@ { + "epilog": "文档地址\n\thttps://QingWei-Li.github.io/docsify\n\thttps://QingWei-Li.github.io/docsify-cli\n\nDevelopment:\n\t\"npm install\"\n\t\"gulp\" (for a list of available gulp tasks)\n", "group.globaloptions": "全局选项", + "gulp.bump": "Bumps the package's SemVer patch.", + "gulp.bump.major": "Bumps the package's SemVer major.", + "gulp.bump.minor": "Bumps the package's SemVer minor.", + "gulp.bump.patch": "Bumps the package's SemVer patch.", + "gulp.bump.prerelease": "Bumps the package's SemVer prerelease.", + "gulp.changelog": "Generates the CHANGELOG.", + "gulp.lint": "Runs eslint.", + "gulp.release": "Releases on Github.", "help": "帮助", "init": "创建 docs", "init.local": "拷贝 docsify 到本地",