Skip to content

Commit 0aab1fe

Browse files
committed
Add base styles for signature template
1 parent 6ad017d commit 0aab1fe

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

bit-docs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var path = require("path");
55
/**
66
* @module {function} bit-docs-js
77
* @parent plugins
8+
* @group bit-docs-js/static static
89
*
910
* @description A collection of tags, templates, and basic styles for JavaScript applications.
1011
*
@@ -13,12 +14,16 @@ var path = require("path");
1314
* TBD
1415
*/
1516
module.exports = function(bitDocs){
17+
var pkg = require("./package.json");
18+
var dependencies = {};
19+
dependencies[pkg.name] = pkg.version;
20+
1621
// register your tags
1722
bitDocs.register("tags", tags);
1823
bitDocs.register("processor", processJavaScript);
1924

2025
bitDocs.register("html", {
21-
templates: path.join(__dirname, "templates")
26+
templates: path.join(__dirname, "templates"),
27+
dependencies: dependencies
2228
});
23-
2429
};

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./static/styles/styles.less');

static/styles/signature.less

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@import "locate://bit-docs-site/styles/variables.less";
2+
3+
/**
4+
* @parent bit-docs-js/static
5+
* @module bit-docs-js/static/styles/signature.less
6+
*
7+
* @description Base styles for signature tag.
8+
*
9+
* @body
10+
*
11+
* Keep spacing consistent for signature options and/or parameters when the
12+
* description text ends in a paragraph that has a bottom margin, or ends in
13+
* another element without a default bottom margin (such as an HTML list).
14+
*
15+
* Uses `>` selectors to scope only those `<ul>`/`<ol>` added by the template.
16+
*
17+
* Paragraphs have a default bottom margin of 1em, so this collapses with that.
18+
*/
19+
.signature {
20+
.options, .parameters {
21+
&>*>li {
22+
margin-bottom: 1em;
23+
}
24+
}
25+
}

templates/signature.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{{#returns}}
3636
<div class="returns">
3737
<h3 class="returns-title">Returns</h3>
38-
<p>{{{makeReturn}}}: {{{makeHtml (makeLinks description)}}}</p>
38+
{{{makeReturn}}}: {{{makeHtml (makeLinks description)}}}
3939
</div>
4040
{{/returns}}
4141

0 commit comments

Comments
 (0)