Skip to content

Commit a553c21

Browse files
committed
New layout structure, other docs
1 parent c7fdc8b commit a553c21

18 files changed

+80
-84
lines changed

bit-docs.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ var mergeOnto = function(prop, dest, source){
1111
/**
1212
* @parent plugins
1313
* @module {function} bit-docs-generate-html
14-
* @group bit-docs-generate-html/theme theme
1514
* @group bit-docs-generate-html/modules modules
15+
* @group bit-docs-generate-html/static static
16+
* @group bit-docs-generate-html/templates templates
17+
* @group bit-docs-generate-html/types types
1618
*
1719
* @description Generates HTML for a docMap. Supports plugins.
1820
*
1921
* @body
2022
*
2123
* TBD
2224
*/
23-
2425
module.exports = function(bitDocs){
2526
bitDocs.register("generator", generator);
2627

27-
bitDocs.register("tags", tags);
28+
bitDocs.register("tags", tags);
2829

2930
bitDocs.handle("html", function(siteConfig, htmlConfig) {
3031
if(!siteConfig.html) {
@@ -39,5 +40,5 @@ module.exports = function(bitDocs){
3940

4041
mergeOnto("static", html, htmlConfig);
4142
mergeOnto("templates", html, htmlConfig);
42-
});
43+
});
4344
};

build/helpers.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var buildHash = require("./build_hash");
88

99
/**
1010
* @parent bit-docs-generate-html/modules
11-
* @module {Promise} bit-docs-generate-html/build/helpers
11+
* @module {Promise} bit-docs-generate-html/build/helpers helpers
1212
*
1313
* Gets the default helpers, and helpers in the _{buildHash}/site/templates_
1414
* folder, and registers them with Handlebars.
@@ -17,7 +17,6 @@ var buildHash = require("./build_hash");
1717
*
1818
* Registers helpers
1919
*
20-
*
2120
* @param {Promise<Handlebars>} buildTemplatesPromise The result of calling
2221
* [bit-docs-generate-html/build/templates]. Building the helpers must happen
2322
* after the templates have been copied over. Passing this argument enforces

build/renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var buildHash = require("./build_hash");
88

99
/**
1010
* @parent bit-docs-generate-html/modules
11-
* @module {function} bit-docs-generate-html/build/renderer
11+
* @module {function} bit-docs-generate-html/build/renderer renderer
1212
*
1313
* Creates a renderer function used to generate
1414
* the documentation.

build/renderer.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
@typedef {function(documentjs.process.docObject)} documentjs.generators.html.types.renderer(docObject) renderer
2-
@parent documentjs.generators.html.build.types
1+
@parent bit-docs-generate-html/types
2+
@typedef {function(bit-docs/types/docObject)} bit-docs-generate-html/types/renderer(docObject) renderer
33

4-
A renderer built by [documentjs.generators.html.build.renderer] that is used to
5-
render each [documentjs.process.docObject docObject].
4+
A renderer built by [bit-docs-generate-html/build/renderer] that is used to
5+
render each [bit-docs/types/docObject].
66

7-
@param {documentjs.process.docObject} docObject The [documentjs.tags tag] data
8-
of a comment.
7+
@param {bit-docs/types/docObject} docObject The
8+
[bit-docs/types/tagCollection] data of a comment.
99

1010
@return {String} The HTML to be outputted.
1111

1212
@body
1313

1414
## Properties
1515

16-
A renderer function also has a `.layout` property which can be used
17-
to render the layout template and a `.content` property that can be used
18-
to render the `content` template.
19-
20-
21-
16+
A renderer function also has a `.layout` property which can be used to render
17+
the `layout` template and a `.content` property that can be used to render
18+
the `content` template.

build/static_dist.js

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
var fss = require('../fs_extras.js'),
2-
Q = require('q'),
3-
path = require('path'),
4-
md5 = require('md5'),
5-
promiseLock = require("../promise_lock"),
6-
npm = require("enpeem"),
7-
fs = require("fs-extra"),
8-
_ = require("lodash");
9-
10-
var queue = promiseLock(),
11-
buildHash = require("./build_hash"),
12-
remove = Q.denodeify(fs.remove);
1+
var fss = require('../fs_extras.js');
2+
var Q = require('q');
3+
var path = require('path');
4+
var md5 = require('md5');
5+
var promiseLock = require("../promise_lock");
6+
var npm = require("enpeem");
7+
var fs = require("fs-extra");
8+
var _ = require("lodash");
9+
10+
var queue = promiseLock();
11+
var buildHash = require("./build_hash");
12+
var remove = Q.denodeify(fs.remove);
1313

1414
/**
1515
* @parent bit-docs-generate-html/modules
16-
* @module {function} bit-docs-generate-html/build/static_dist
16+
* @module {function} bit-docs-generate-html/build/static_dist staticDist
1717
*
18-
* Builds a static distributable which will eventually be copied
19-
* to the `static` folder of the generated output.
18+
* Builds a static distributable which will eventually be copied to the
19+
* `static` folder of the generated output.
2020
*
2121
* @signature `.build.staticDist(options)`
2222
*
2323
* Builds the static distributable with the following steps:
2424
*
25-
* 1. Copies everything from _documentjs/site/default/static_ to
26-
* _documentjs/site/static/build_.
27-
* 2. Copies the path in `options.dest` to _documentjs/site/static/build_.
28-
* 3. `require`s the module at _documentjs/site/static/build/build.js_.
29-
* 4. Calls that "build" module function with the options and returns the result.
25+
* 1. Copies everything from _site/default/static_ to _site/static/build_.
26+
* 2. Copies the path in `options.dest` to _site/static/build_.
27+
* 3. `require`s the module at _site/static/build/build.js_.
28+
* 4. Calls that "build" module function with the options and returns the
29+
* result.
3030
*
31-
* The "build" module is expected to build a minified distributable
32-
* and copy the necessary contents to _documentjs/site/static/dist_ and
33-
* return a promise that resolves when complete.
31+
* The "build" module is expected to build a minified distributable and copy
32+
* the necessary contents to _site/static/dist_ and return a promise that
33+
* resolves when complete.
3434
*
3535
* @param {{}} options
3636
*
37-
* @option {Boolean} [forceBuild=false] If set to `true`, rebuilds the
38-
* static bundle even if it has already been built.
37+
* @option {Boolean} [forceBuild=false] If set to `true`, rebuilds the static
38+
* bundle even if it has already been built.
39+
*
40+
* @option {String} dest The final destination ouput of the static
41+
* distributable.
3942
*
40-
* @option {String} dest The final destination ouput of the static
41-
* distributable.
42-
*
43-
* @option {String} static The location of static content used to overwrite or
44-
* add to the default static content.
45-
*
46-
* @option {Boolean} [minifyBuild=true] If set to `false` the build will not
47-
* be minified. This behavior should be implemented by the "build" module.
48-
*
49-
* @return {Promise} A promise that resolves if the static dist was successfully created.
43+
* @option {String} static The location of static content used to overwrite or
44+
* add to the default static content.
45+
*
46+
* @option {Boolean} [minifyBuild=true] If set to `false` the build will not be
47+
* minified. This behavior should be implemented by the "build" module.
5048
*
49+
* @return {Promise} A promise that resolves if the static dist was
50+
* successfully created.
5151
*/
5252
module.exports = function(options){
5353
// only run one build at a time.
@@ -56,8 +56,8 @@ module.exports = function(options){
5656

5757
var hash = buildHash(options);
5858

59-
var distFolder = path.join("site","static","dist", hash),
60-
buildFolder = path.join("site","static","build", hash);
59+
var distFolder = path.join("site","static","dist", hash);
60+
var buildFolder = path.join("site","static","build", hash);
6161

6262
var mkdirPromise = Q.all([
6363
fss.mkdirs(distFolder),
@@ -103,8 +103,8 @@ module.exports = function(options){
103103

104104
};
105105

106-
var readFile = Q.denodeify(fs.readFile),
107-
writeFile = Q.denodeify(fs.writeFile);
106+
var readFile = Q.denodeify(fs.readFile);
107+
var writeFile = Q.denodeify(fs.writeFile);
108108

109109
function addPackages(siteConfig, buildFolder) {
110110
if(siteConfig.html && siteConfig.html.dependencies) {
@@ -167,7 +167,6 @@ function installPackages(options, buildFolder, distFolder, hash){
167167
});
168168
}
169169

170-
171170
function callIfFunction(value){
172171
if(typeof value === "function") {
173172
value();

site/default/default.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@parent bit-docs-generate-html/theme
2-
@page bit-docs-generate-html/theme/about About the Default Theme
1+
@parent bit-docs-generate-html
2+
@page bit-docs-generate-html/about About
33

44
@description Templates and styles come with the default theme.
55

@@ -29,7 +29,7 @@ structure purposes, in tandem with [bit-docs-generate-html/theme/styles].
2929

3030
For any template files not copied over, the default template will be used.
3131

32-
### Styles
32+
### Static
3333

3434
Styles are used to modify the visual representation of a generated website.
3535

site/default/static/styles/mixins.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @parent bit-docs-generate-html/theme
3-
* @module bit-docs-generate-html/site/default/static/styles/mixins.less mixins.less
2+
* @parent bit-docs-generate-html/static
3+
* @module bit-docs-generate-html/site/default/styles/mixins.less mixins.less
44
*
55
* @description Mixins for site-wide visual layout.
66
*

site/default/static/styles/styles.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @parent bit-docs-generate-html/theme
2+
* @parent bit-docs-generate-html/static
33
* @module bit-docs-generate-html/site/default/static/styles/styles.less styles.less
44
*
55
* @description The primary styles for the default theme.

site/default/static/styles/variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @parent bit-docs-generate-html/theme
2+
* @parent bit-docs-generate-html/static
33
* @module bit-docs-generate-html/site/default/static/styles/variables.less variables.less
44
*
55
* @description Variables to hold site-wide visual configurations.

site/default/templates/body.mustache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@parent bit-docs-generate-html/theme
2-
@module bit-docs-generate-html/site/default/templates/body.mustache body.mustache
1+
@parent bit-docs-generate-html/templates
2+
@page bit-docs-generate-html/site/default/templates/body.mustache body.mustache
33

44
@description The default body template.
55

0 commit comments

Comments
 (0)