UNPKG

4.45 kBMarkdownView Raw
1apeman-ui
2==========
3
4<!---
5This file is generated by ape-tmpl. Do not update manually.
6--->
7
8<!-- Badge Start -->
9<a name="badges"></a>
10
11[![Build Status][bd_travis_shield_url]][bd_travis_url]
12[![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
13[![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
14[![npm Version][bd_npm_shield_url]][bd_npm_url]
15[![JS Standard][bd_standard_shield_url]][bd_standard_url]
16
17[bd_repo_url]: https://github.com/apeman-cmd-labo/apeman-ui
18[bd_travis_url]: http://travis-ci.org/apeman-cmd-labo/apeman-ui
19[bd_travis_shield_url]: http://img.shields.io/travis/apeman-cmd-labo/apeman-ui.svg?style=flat
20[bd_travis_com_url]: http://travis-ci.com/apeman-cmd-labo/apeman-ui
21[bd_travis_com_shield_url]: https://api.travis-ci.com/apeman-cmd-labo/apeman-ui.svg?token=
22[bd_license_url]: https://github.com/apeman-cmd-labo/apeman-ui/blob/master/LICENSE
23[bd_codeclimate_url]: http://codeclimate.com/github/apeman-cmd-labo/apeman-ui
24[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-cmd-labo/apeman-ui.svg?style=flat
25[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-cmd-labo/apeman-ui.svg?style=flat
26[bd_gemnasium_url]: https://gemnasium.com/apeman-cmd-labo/apeman-ui
27[bd_gemnasium_shield_url]: https://gemnasium.com/apeman-cmd-labo/apeman-ui.svg
28[bd_npm_url]: http://www.npmjs.org/package/apeman-ui
29[bd_npm_shield_url]: http://img.shields.io/npm/v/apeman-ui.svg?style=flat
30[bd_standard_url]: http://standardjs.com/
31[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
32
33<!-- Badge End -->
34
35
36<!-- Description Start -->
37<a name="description"></a>
38
39UI server for apeman
40
41<!-- Description End -->
42
43
44<!-- Overview Start -->
45<a name="overview"></a>
46
47
48
49<!-- Overview End -->
50
51
52<!-- Sections Start -->
53<a name="sections"></a>
54
55<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->
56
57<a name="section-doc-guides-01-installation-md"></a>
58
59Installation
60-----
61
62Install apeman-ui module via [npm][npm_url].
63```bash
64$ npm install apeman-ui -g
65```
66
67
68[npm_url]: https://www.npmjs.com/
69
70
71<!-- Section from "doc/guides/01.Installation.md.hbs" End -->
72
73<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->
74
75<a name="section-doc-guides-02-usage-md"></a>
76
77Usage
78---------
79
801. Prepare an Apemanfile.js at your project root.
812. Run the command via CLI.
82
83***Apemanfile.js***
84```javascript
85/** Example of Apemanfile.js */
86
87'use strict'
88
89module.exports = {
90 $cwd: __dirname,
91 $pkg: { /* ... */ },
92 $proto: [ /* ... */ ],
93 $ui: {
94 'user': {
95 profile () {
96 return Promise.resolve(`
97<html><!-- ... ---></html>
98`)
99 }
100 }
101 }
102}
103
104```
105
106Then,
107
108```bash
109$ apeman-ui
110```
111
112
113##### CLI Options
114
115```bash
116$ apeman-ui -h
117
118 Usage: apeman-ui [options]
119
120 UI server for apeman
121
122 Options:
123
124 -h, --help output usage information
125 -V, --version output the version number
126 -v, --verbose Show verbose logs
127 -c, --configuration <configuration> Pathname of Apemanfile
128
129 Examples:
130
131 $ apeman-ui # __description_of_command_usage__
132
133
134```
135
136
137<!-- Section from "doc/guides/02.Usage.md.hbs" End -->
138
139<!-- Section from "doc/guides/03.Programmatic API.md.hbs" Start -->
140
141<a name="section-doc-guides-03-programmatic-a-p-i-md"></a>
142
143Programmatic API
144---
145
146apeman-ui also provide programmatic API.
147
148Firstly, install the module locally.
149
150```bash
151$ npm install apeman-ui --save-dev
152```
153
154Then,
155
156```javascript
157#!/usr/bin/env
158
159'use strict'
160
161const apemanUi = require('apeman-ui')
162const co = require('co')
163
164co(function * () {
165 yield apemanUi({})
166}).catch((err) => console.error(err))
167
168```
169
170
171##### Programmatic Options
172
173| Key | Description | Default |
174| --- | ----------- | ------- |
175| verbose | Show verbose logs | |
176| configuration | Pathname of Apemanfile | |
177
178
179<!-- Section from "doc/guides/03.Programmatic API.md.hbs" End -->
180
181
182<!-- Sections Start -->
183
184
185<!-- LICENSE Start -->
186<a name="license"></a>
187
188License
189-------
190This software is released under the [MIT License](https://github.com/apeman-cmd-labo/apeman-ui/blob/master/LICENSE).
191
192<!-- LICENSE End -->
193
194
195<!-- Links Start -->
196<a name="links"></a>
197
198Links
199------
200
201+ [apeman][apeman_url]
202+ [apeman-cmd-labo][apeman_cmd_labo_url]
203
204[apeman_url]: http://github.com/apeman-labo/apeman
205[apeman_cmd_labo_url]: http://github.com/apeman-cmd-labo
206
207<!-- Links End -->