Skip to content

Commit bb299e3

Browse files
committed
Documentation showing on bit-docs-website
1 parent b1dc207 commit bb299e3

File tree

6 files changed

+183
-41
lines changed

6 files changed

+183
-41
lines changed

bit-docs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ var mergeOnto = function(prop, dest, source){
99
};
1010

1111
/**
12+
* @parent plugins
1213
* @module {function} bit-docs-generate-html
14+
* @group bit-docs-generate-html/theme theme
1315
* @group bit-docs-generate-html/modules modules
14-
* @group bit-docs-generate-html/styles styles
15-
* @group bit-docs-generate-html/templates templates
16-
* @parent plugins
1716
*
1817
* @description Generates HTML for a docMap. Supports plugins.
1918
*

site/default/static/styles/mixins.less

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* @parent bit-docs-generate-html/styles
3-
* @page bit-docs-generate-html/styles/mixins mixins
4-
* @group bit-docs-generate-html/styles/mixins/helper #helper
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
55
*
66
* @description Mixins for site-wide visual layout.
77
*
@@ -12,8 +12,8 @@
1212

1313
#helper {
1414
/**
15-
* @function bit-docs-generate-html/styles/mixins/helper/padding .padding
16-
* @parent bit-docs-generate-html/styles/mixins/helper
15+
* @function bit-docs-generate-html/theme/styles/mixins/helper/padding .padding
16+
* @parent bit-docs-generate-html/theme/styles/mixins/helper
1717
*
1818
* Sets padding for passed sides.
1919
*
@@ -22,7 +22,7 @@
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/styles/variables/@defaultPadding @defaultPadding].
25+
* [bit-docs-generate-html/theme/styles/variables/@defaultPadding @defaultPadding].
2626
*
2727
* @body
2828
*
@@ -39,8 +39,8 @@
3939
}
4040

4141
/**
42-
* @function bit-docs-generate-html/styles/mixins/helper/flex .flex
43-
* @parent bit-docs-generate-html/styles/mixins/helper
42+
* @function bit-docs-generate-html/theme/styles/mixins/helper/flex .flex
43+
* @parent bit-docs-generate-html/theme/styles/mixins/helper
4444
*
4545
* Sets flexbox "grow" and "shrink" in most compatible way.
4646
*
@@ -69,8 +69,8 @@
6969
}
7070

7171
/**
72-
* @function bit-docs-generate-html/styles/mixins/helper/property-names .property-names
73-
* @parent bit-docs-generate-html/styles/mixins/helper
72+
* @function bit-docs-generate-html/theme/styles/mixins/helper/property-names .property-names
73+
* @parent bit-docs-generate-html/theme/styles/mixins/helper
7474
* @hide
7575
*
7676
* Helper for setting multiple dash properties to same value.
@@ -109,8 +109,8 @@
109109
// Flexbox (flexbugs: https://github.com/philipwalton/flexbugs)
110110

111111
/**
112-
* @property .display-flex
113-
* @parent bit-docs-generate-html/styles/mixins
112+
* @property bit-docs-generate-html/theme/styles/mixins/display-flex @display-flex
113+
* @parent bit-docs-generate-html/theme/styles/mixins
114114
*
115115
* Sets the display to flex using vendor prefixes.
116116
*
@@ -133,8 +133,8 @@
133133
}
134134

135135
/**
136-
* @property .flex-row
137-
* @parent bit-docs-generate-html/styles/mixins
136+
* @property bit-docs-generate-html/theme/styles/mixins/flex-row @flex-row
137+
* @parent bit-docs-generate-html/theme/styles/mixins
138138
*
139139
* Sets the display to flex and direction to row using vendor prefixes.
140140
*
@@ -160,8 +160,8 @@
160160
}
161161

162162
/**
163-
* @property .flex-column
164-
* @parent bit-docs-generate-html/styles/mixins
163+
* @property bit-docs-generate-html/theme/styles/mixins/flex-column @flex-column
164+
* @parent bit-docs-generate-html/theme/styles/mixins
165165
*
166166
* Sets the display to flex and direction to column using vendor prefixes.
167167
*
@@ -187,8 +187,8 @@
187187
}
188188

189189
/**
190-
* @property .flex-initial
191-
* @parent bit-docs-generate-html/styles/mixins
190+
* @property bit-docs-generate-html/theme/styles/mixins/flex-initial @flex-initial
191+
* @parent bit-docs-generate-html/theme/styles/mixins
192192
*
193193
* Emulates `flex: initial;` in a compatible way using vendor prefixes.
194194
*
@@ -207,8 +207,8 @@
207207
}
208208

209209
/**
210-
* @property .flex-auto
211-
* @parent bit-docs-generate-html/styles/mixins
210+
* @property bit-docs-generate-html/theme/styles/mixins/flex-auto @flex-auto
211+
* @parent bit-docs-generate-html/theme/styles/mixins
212212
*
213213
* Emulates `flex: auto;` in a compatible way using vendor prefixes.
214214
*
@@ -227,8 +227,8 @@
227227
}
228228

229229
/**
230-
* @property .flex-none
231-
* @parent bit-docs-generate-html/styles/mixins
230+
* @property bit-docs-generate-html/theme/styles/mixins/flex-none @flex-none
231+
* @parent bit-docs-generate-html/theme/styles/mixins
232232
*
233233
* Emulates `flex: none;` in a compatible way using vendor prefixes.
234234
*

site/default/static/styles/styles.less

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
/**
2-
* @stylesheet styles.less Styles
3-
* @parent bit-docs/theme
2+
* @parent bit-docs-generate-html/theme
3+
* @page bit-docs-generate-html/theme/styles styles
44
*
5-
* @description Styles for the generated site.
5+
* @description The primary styles for the default theme.
6+
*
7+
* @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.
14+
*
15+
* The default `styles.less` is based on flexbox, and relies on two less files:
16+
*
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.
22+
*
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].
627
*/
728

829
@import "locate://bit-docs-site/styles/variables.less";
@@ -147,4 +168,4 @@ Desktop:
147168
overflow-y: auto;
148169
}
149170
}
150-
}
171+
}
Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,82 @@
11
/**
2-
* @page bit-docs-generate-html/styles/variables Variables
3-
* @parent bit-docs-generate-html/styles
4-
*
5-
* @description Variables to hold site-wide visual configurations.
6-
*/
2+
* @parent bit-docs-generate-html/theme/styles
3+
* @page bit-docs-generate-html/theme/styles/variables variables
4+
*
5+
* @description Variables to hold site-wide visual configurations.
6+
*/
77

88
/**
9-
* @option @defaultFontFamily The default font family.
9+
* @property bit-docs-generate-html/theme/styles/variables/defaultFontFamily @defaultFontFamily
10+
* @parent bit-docs-generate-html/theme/styles/variables
11+
*
12+
* The default font family.
13+
*
14+
* @body
15+
*
16+
* ### Use
17+
*
18+
* ```less
19+
* body {
20+
* font-family: @defaultFontFamily;
21+
* }
22+
* ```
1023
*/
1124
@defaultFontFamily: "Helvetica Neue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
1225

1326
/**
14-
* @option @smartphones Media query breakpoint for smartphones.
27+
* @property bit-docs-generate-html/theme/styles/variables/defaultPadding @defaultPadding
28+
* @parent bit-docs-generate-html/theme/styles/variables
29+
*
30+
* Defualt padding for content containers.
31+
*
32+
* @body
33+
*
34+
* ### Use
35+
*
36+
* ```less
37+
* body {
38+
* padding: @defaultPadding;
39+
* }
40+
* ```
1541
*/
16-
@smartphones: ~"only screen and (max-width: 767px)";
42+
@defaultPadding: 25px;
1743

1844
/**
19-
* @option @desktops Media query breakpoint for desktops.
45+
* @property bit-docs-generate-html/theme/styles/variables/smartphones @smartphones
46+
* @parent bit-docs-generate-html/theme/styles/variables
47+
*
48+
* Media query breakpoint for smartphones.
49+
*
50+
* @body
51+
*
52+
* ### Use
53+
*
54+
* ```less
55+
* @@media @smartphones {
56+
* body {
57+
* font-size: 18px;
58+
* }
59+
* }
60+
* ```
2061
*/
21-
@desktops: ~"only screen and (min-width: 767px)";
62+
@smartphones: ~"only screen and (max-width: 767px)";
2263

2364
/**
24-
* @option @defaultPadding Defualt padding for content containers.
65+
* @property bit-docs-generate-html/theme/styles/variables/desktops @desktops
66+
* @parent bit-docs-generate-html/theme/styles/variables
67+
*
68+
* Media query breakpoint for desktops.
69+
*
70+
* @body
71+
*
72+
* ### Use
73+
*
74+
* ```less
75+
* @@media @desktops {
76+
* body {
77+
* font-size: 12px;
78+
* }
79+
* }
80+
* ```
2581
*/
26-
@defaultPadding: 25px;
82+
@desktops: ~"only screen and (min-width: 767px)";
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@parent bit-docs-generate-html/theme/templates
2+
@page bit-docs-generate-html/theme/templates/content content
3+
4+
@description The default content template.
5+
6+
@body
7+
8+
The `content.mustache` template includes other mustache files, by default:
9+
10+
- `sidebar.mustache`
11+
- `title.mustache`
12+
- `description.mustache`
13+
- `body.mustache`
14+
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 a function signature in the generated output:
22+
23+
```
24+
{{#unless hideBody}}
25+
{{#if signatures}}
26+
{{#each signatures}}
27+
{{> signature.mustache}}
28+
{{/each}}
29+
{{else}}
30+
{{#types}}
31+
{{> signature.mustache}}
32+
{{/types}}
33+
{{/if}}
34+
{{#if body}}
35+
{{> body.mustache}}
36+
{{/if}}
37+
{{/unless}}
38+
```

site/default/templates/templates.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@parent bit-docs-generate-html/theme
2+
@page bit-docs-generate-html/theme/templates templates
3+
4+
@description Templates that come with the default theme.
5+
6+
@body
7+
8+
Templates are used by `bit-docs` to generate the output of a website.
9+
10+
By default, `bit-docs` provides a very basic theme that consists of template
11+
files that are meant to be copied over to your project and/or a custom theme,
12+
and modified there as needed to suite your specific layout needs.
13+
14+
The default templates do not make any assumptions about the type of website
15+
you are trying to generate. If you are generating documentation, you will
16+
probably want to add things like function signatures to the output of the
17+
generated website. That can be done by adding the `signature.mustache` to
18+
[bit-docs-generate-html/theme/templates/content].
19+
20+
Other documentation that you might want to expose will come from the various
21+
[docObjects] in the [docMap], and you will need to create your own mustache
22+
templates as well as helpers to support that.
23+
24+
Most users will be happy using the default output for documentation, and will
25+
primarily be editing the templates to add HTML markup for styling and
26+
structure purposes, in tandem with [bit-docs-generate-html/theme/styles].
27+
28+
For any template files not copied over, the default template will be used.

0 commit comments

Comments
 (0)