Skip to content

Commit c7fdc8b

Browse files
committed
Layout example theme-path-literal
1 parent ae27240 commit c7fdc8b

18 files changed

+167
-80
lines changed

build/helpers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ var buildHash = require("./build_hash");
1919
*
2020
*
2121
* @param {Promise<Handlebars>} buildTemplatesPromise The result of calling
22-
* [documentjs.generators.html.build.templates]. Building the helpers
23-
* must happen after the templates have been copied over. Passing this
24-
* argument enforces that.
22+
* [bit-docs-generate-html/build/templates]. Building the helpers must happen
23+
* after the templates have been copied over. Passing this argument enforces
24+
* that.
2525
*
2626
* @param {documentjs.process.docMap} docMap The docMap which contains all
2727
* docObjects that will be documented.

build/renderer.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
var buildTemplates = require("./templates"),
2-
getRenderer = require("./get_renderer"),
3-
getPartials = require("./get_partials"),
4-
path = require("path"),
5-
md5 = require("md5"),
6-
Q = require("q"),
7-
buildHash = require("./build_hash");
8-
9-
1+
var buildTemplates = require("./templates");
2+
var getRenderer = require("./get_renderer");
3+
var getPartials = require("./get_partials");
4+
var path = require("path");
5+
var md5 = require("md5");
6+
var Q = require("q");
7+
var buildHash = require("./build_hash");
108

119
/**
1210
* @parent bit-docs-generate-html/modules

site/default/templates/templates.md renamed to site/default/default.md

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

4-
@description Templates that come with the default theme.
4+
@description Templates and styles come with the default theme.
55

66
@body
77

8+
### Templates
9+
810
Templates are used by `bit-docs` to generate the output of a website.
911

1012
By default, `bit-docs` provides a very basic theme that consists of template
@@ -26,3 +28,19 @@ primarily be editing the templates to add HTML markup for styling and
2628
structure purposes, in tandem with [bit-docs-generate-html/theme/styles].
2729

2830
For any template files not copied over, the default template will be used.
31+
32+
### Styles
33+
34+
Styles are used to modify the visual representation of a generated website.
35+
36+
By default, `bit-docs` provides a very basic theme that consists of styles
37+
that are meant to be copied over to your project and/or a custom theme,
38+
and modified there as needed to suit your specific design needs.
39+
40+
Any of these files can be copied over and modified as needed. For any LESS
41+
files not copied over, the default LESS file will be used.
42+
43+
Certain plugins provide their own LESS files for defining variables that
44+
are to be used in styling whatever they add, and will include your
45+
[variables.less] after their own so that you may override any LESS variables
46+
that you might wish to. A good example of this is [bit-docs-prettify].

site/default/static/static.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* @parent bit-docs-generate-html/site
3+
* @page bit-docs-generate-html/site/default/static/static.js default/static/static.js
4+
*
5+
* @description Contains all the static assets like LESS and images.
6+
*/
17
var packages = require("./packages");
28
require("./styles/styles.less!");
3-
window.PACKAGES = packages;
9+
window.PACKAGES = packages;

site/default/static/styles/mixins.less

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
/**
2-
* @parent bit-docs-generate-html/theme/styles
3-
* @page bit-docs-generate-html/theme/styles/mixins mixins
4-
* @group bit-docs-generate-html/theme/styles/mixins/helper #helper
2+
* @parent bit-docs-generate-html/theme
3+
* @module bit-docs-generate-html/site/default/static/styles/mixins.less mixins.less
54
*
65
* @description Mixins for site-wide visual layout.
76
*
87
* @body
98
*
109
* Mixins are useful as reusable rules that can be added into any declaration.
10+
*
11+
* Read more about mixins [here](http://lesscss.org/features/#mixins-feature).
1112
*/
1213

1314
#helper {
1415
/**
15-
* @function bit-docs-generate-html/theme/styles/mixins/helper/padding .padding
16-
* @parent bit-docs-generate-html/theme/styles/mixins/helper
16+
* @property {ParametricMixin} helper-padding #helper.padding
1717
*
1818
* Sets padding for passed sides.
1919
*
20-
* @signature `#helper.padding(@sides; @amount: @defaultPadding)`
20+
* @signature `#helper.padding(@sides; @amount: @defaultPadding);`
2121
*
2222
* @param {String} @sides A space-separated list of "sides", like `left right`.
2323
*
2424
* @param {Number} @amount An amount of padding in pixels, defaults to
25-
* [bit-docs-generate-html/theme/styles/variables/@defaultPadding @defaultPadding].
25+
* [bit-docs-generate-html/site/default/static/styles/variables.less.defaultPadding].
2626
*
2727
* @body
2828
*
@@ -39,12 +39,11 @@
3939
}
4040

4141
/**
42-
* @function bit-docs-generate-html/theme/styles/mixins/helper/flex .flex
43-
* @parent bit-docs-generate-html/theme/styles/mixins/helper
42+
* @property {ParametricMixin} helper-flex #helper.flex
4443
*
4544
* Sets flexbox "grow" and "shrink" in most compatible way.
4645
*
47-
* @signature `#helper.flex(@grow: 0, @shrink: 1)`
46+
* @signature `#helper.flex(@grow: 0, @shrink: 1);`
4847
*
4948
* @param {Number} @grow The amount this flex item should grow, defaults to 0.
5049
*
@@ -60,7 +59,7 @@
6059
* }
6160
* ```
6261
*/
63-
.flex(@grow: 0, @shrink: 1) {
62+
.flex(@grow: 0; @shrink: 1) {
6463
-webkit-box-flex: @grow;
6564
-webkit-flex: @grow @shrink auto;
6665
-moz-box-flex: @grow;
@@ -69,19 +68,18 @@
6968
}
7069

7170
/**
72-
* @function bit-docs-generate-html/theme/styles/mixins/helper/property-names .property-names
73-
* @parent bit-docs-generate-html/theme/styles/mixins/helper
71+
* @property {ParametricMixin} helper-property-names #helper.property-names
7472
* @hide
7573
*
7674
* Helper for setting multiple dash properties to same value.
7775
*
78-
* @signature `#helper.property-names(@p; @s; @v)`
76+
* @signature `#helper.property-names(@p; @s; @v: 0);`
7977
*
8078
* @param {String} @p The property name to prepend before the dash and string.
8179
*
8280
* @param {String} @s A space-separated list of strings to iterate over.
8381
*
84-
* @param {Number} @v The value to set each concatenated property to.
82+
* @param {Number} @v The value to set each concatenated property to, defaults to 0.
8583
*
8684
* @body
8785
*
@@ -97,7 +95,7 @@
9795
* }
9896
* ```
9997
*/
100-
.property-names(@p; @s; @v) {
98+
.property-names(@p; @s; @v: 0) {
10199
.-(@i: length(@s)) when (@i > 0) {
102100
@n: extract(@s, @i);
103101
& {@{p}-@{n}: @v}
@@ -109,8 +107,7 @@
109107
// Flexbox (flexbugs: https://github.com/philipwalton/flexbugs)
110108

111109
/**
112-
* @property bit-docs-generate-html/theme/styles/mixins/display-flex .display-flex
113-
* @parent bit-docs-generate-html/theme/styles/mixins
110+
* @property {Mixin} display-flex .display-flex
114111
*
115112
* Sets the display to flex using vendor prefixes.
116113
*
@@ -133,8 +130,7 @@
133130
}
134131

135132
/**
136-
* @property bit-docs-generate-html/theme/styles/mixins/flex-row .flex-row
137-
* @parent bit-docs-generate-html/theme/styles/mixins
133+
* @property {Mixin} flex-row .flex-row
138134
*
139135
* Sets the display to flex and direction to row using vendor prefixes.
140136
*
@@ -160,8 +156,7 @@
160156
}
161157

162158
/**
163-
* @property bit-docs-generate-html/theme/styles/mixins/flex-column .flex-column
164-
* @parent bit-docs-generate-html/theme/styles/mixins
159+
* @property {Mixin} flex-column .flex-column
165160
*
166161
* Sets the display to flex and direction to column using vendor prefixes.
167162
*
@@ -187,8 +182,7 @@
187182
}
188183

189184
/**
190-
* @property bit-docs-generate-html/theme/styles/mixins/flex-initial .flex-initial
191-
* @parent bit-docs-generate-html/theme/styles/mixins
185+
* @property {Mixin} flex-initial .flex-initial
192186
*
193187
* Emulates `flex: initial;` in a compatible way using vendor prefixes.
194188
*
@@ -207,8 +201,7 @@
207201
}
208202

209203
/**
210-
* @property bit-docs-generate-html/theme/styles/mixins/flex-auto .flex-auto
211-
* @parent bit-docs-generate-html/theme/styles/mixins
204+
* @property {Mixin} flex-auto .flex-auto
212205
*
213206
* Emulates `flex: auto;` in a compatible way using vendor prefixes.
214207
*
@@ -227,8 +220,7 @@
227220
}
228221

229222
/**
230-
* @property bit-docs-generate-html/theme/styles/mixins/flex-none .flex-none
231-
* @parent bit-docs-generate-html/theme/styles/mixins
223+
* @property {Mixin} flex-none .flex-none
232224
*
233225
* Emulates `flex: none;` in a compatible way using vendor prefixes.
234226
*

site/default/static/styles/styles.less

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
11
/**
22
* @parent bit-docs-generate-html/theme
3-
* @page bit-docs-generate-html/theme/styles styles
3+
* @module bit-docs-generate-html/site/default/static/styles/styles.less styles.less
44
*
55
* @description The primary styles for the default theme.
66
*
77
* @body
8-
*
9-
* Styles are used to modify the visual representation of a generated website.
10-
*
11-
* By default, `bit-docs` provides a very basic theme that consists of styles
12-
* that are meant to be copied over to your project and/or a custom theme,
13-
* and modified there as needed to suit your specific design needs.
148
*
159
* The default `styles.less` is based on flexbox, and relies on two less files:
1610
*
17-
* - [bit-docs-generate-html/theme/styles/variables]
18-
* - [bit-docs-generate-html/theme/styles/mixins]
19-
*
20-
* Any of these files can be copied over and modified as needed. For any less
21-
* files not copied over, the default less file will be used.
11+
* - [bit-docs-generate-html/site/default/static/styles/variables.less]
12+
* - [bit-docs-generate-html/site/default/static/styles/mixins.less]
2213
*
23-
* Certain plugins provide their own less files for defining variables that
24-
* are to be used in styling whatever they add, and will include your
25-
* variables.less after their own so that you may override any less variables
26-
* that you might wish to. A good example of this is [bit-docs-prettify].
14+
* The styles are very basic, and primarily focus on mobile and desktop layout.
2715
*/
2816

2917
@import "locate://bit-docs-site/styles/variables.less";

site/default/static/styles/variables.less

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/**
2-
* @parent bit-docs-generate-html/theme/styles
3-
* @page bit-docs-generate-html/theme/styles/variables variables
2+
* @parent bit-docs-generate-html/theme
3+
* @module bit-docs-generate-html/site/default/static/styles/variables.less variables.less
44
*
55
* @description Variables to hold site-wide visual configurations.
66
*/
77

88
/**
9-
* @property bit-docs-generate-html/theme/styles/variables/defaultFontFamily @defaultFontFamily
10-
* @parent bit-docs-generate-html/theme/styles/variables
9+
* @property {Variable} defaultFontFamily @defaultFontFamily
1110
*
1211
* The default font family.
1312
*
@@ -24,8 +23,7 @@
2423
@defaultFontFamily: "Helvetica Neue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
2524

2625
/**
27-
* @property bit-docs-generate-html/theme/styles/variables/defaultPadding @defaultPadding
28-
* @parent bit-docs-generate-html/theme/styles/variables
26+
* @property {Variable} defaultPadding @defaultPadding
2927
*
3028
* Defualt padding for content containers.
3129
*
@@ -42,8 +40,7 @@
4240
@defaultPadding: 25px;
4341

4442
/**
45-
* @property bit-docs-generate-html/theme/styles/variables/smartphones @smartphones
46-
* @parent bit-docs-generate-html/theme/styles/variables
43+
* @property {Variable} smartphones @smartphones
4744
*
4845
* Media query breakpoint for smartphones.
4946
*
@@ -62,8 +59,7 @@
6259
@smartphones: ~"only screen and (max-width: 767px)";
6360

6461
/**
65-
* @property bit-docs-generate-html/theme/styles/variables/desktops @desktops
66-
* @parent bit-docs-generate-html/theme/styles/variables
62+
* @property {Variable} desktops @desktops
6763
*
6864
* Media query breakpoint for desktops.
6965
*
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@parent bit-docs-generate-html/theme
2+
@module bit-docs-generate-html/site/default/templates/body.mustache body.mustache
3+
4+
@description The default body template.
5+
6+
@body
7+
8+
### Usage
9+
10+
The default `body.mustache` template.

site/default/templates/content.mustache

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
{{/unless}}
1515

1616
{{#unless hideBody}}
17+
{{#if signatures}}
18+
{{#each signatures}}
19+
{{> signature.mustache}}
20+
{{/each}}
21+
{{else}}
22+
{{#types}}
23+
{{> signature.mustache}}
24+
{{/types}}
25+
{{/if}}
1726
{{#if body}}
1827
{{> body.mustache}}
1928
{{/if}}

site/default/templates/content.mustache.md

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

44
@description The default content template.
55

66
@body
77

8-
The `content.mustache` template includes other mustache files, by default:
8+
### Usage
9+
10+
The default `content.mustache` template contains the main HTML markup and
11+
includes these other mustache files:
912

1013
- `sidebar.mustache`
1114
- `title.mustache`
1215
- `description.mustache`
1316
- `body.mustache`
1417

15-
Additionally, the template includes the main HTML markup.
16-
17-
Copy this file into your own project or theme to modify HTML markup, or include
18-
other available templates.
19-
20-
For instance, [bit-docs-js] provides the `signature.mustache` template that can
21-
be included to show function signatures in the generated output:
18+
Copy this file into your own project or theme to modify HTML markup, or
19+
include other available templates. For instance, [bit-docs-js] provides the
20+
`signature.mustache` template that can be included to show function
21+
signatures in the generated output:
2222

2323
```
2424
{{#unless hideBody}}

0 commit comments

Comments
 (0)