Skip to content

Commit

Permalink
fix(template): update template
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Mar 24, 2017
1 parent 8eea106 commit da67d07
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
.vscode/
node_modules/
yarn.lock
Empty file added docs/.nojekyll
Empty file.
56 changes: 56 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -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
20 changes: 11 additions & 9 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>docsify cli - A magical documentation generator.</title>
<meta name="description" content="docsify cli - A magical documentation generator.">
<title>docsify-cli - A magical documentation generator.</title>
<meta name="description" content="A magical documentation generator.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/docsify/latest/lib/themes/buble.css">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
</body>
<script
data-router
src="//cdn.jsdelivr.net/docsify/latest/lib/docsify.min.js"
data-homepage="//raw.githubusercontent.com/QingWei-Li/docsify-cli/master/README.md"
data-repo="QingWei-Li/docsify-cli"></script>
</html>
<script>
window.$docsify = {
name: 'docsify-cli',
repo: 'https://github.com/QingWei-Li/docsify-cli'
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
</html>
4 changes: 2 additions & 2 deletions lib/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion lib/template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</body>
<script>
window.$docsify = {
repo: '',
name: '',
repo: ''
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion lib/template/index.local.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</body>
<script>
window.$docsify = {
repo: '',
name: '',
repo: ''
}
</script>
<script src="vendor/docsify.js"></script>
Expand Down
9 changes: 9 additions & 0 deletions tools/locales/zh.json
Original file line number Diff line number Diff line change
@@ -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 到本地",
Expand Down

0 comments on commit da67d07

Please sign in to comment.