Skip to content

Commit e95ceb0

Browse files
authored
Merge pull request #11 from bit-docs/docs
Update docs
2 parents c321a4c + 7c3cab2 commit e95ceb0

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
package-lock.json
12
node_modules/
23
temp/

bit-docs.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
/**
2-
* @module {function} bit-docs-prettify
32
* @parent plugins
3+
* @module {function} bit-docs-prettify
4+
* @group bit-docs-prettify/static static
45
*
56
* @description A bit-docs plugin that makes source-code snippets in HTML prettier.
6-
*
7+
*
78
* @body
8-
*
9-
* TBD
9+
*
10+
* This plugin registers onto the `html` hook.
11+
*
12+
* Registering the `html` hook adds a static JavaScript file
13+
* [bit-docs-prettify/prettify.js] that will go through every `<code>` element
14+
* on the page applying the
15+
* [code prettifier](https://github.com/google/code-prettify).
1016
*/
1117
module.exports = function(bitDocs){
1218
var pkg = require("./package.json");

prettify.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
require("./prettify-engine");
22
require("./prettify.less")
33

4+
/**
5+
* @parent bit-docs-prettify/static
6+
* @module {function} bit-docs-prettify/prettify.js
7+
*
8+
* Main front end JavaScript file for static portion of this plugin.
9+
*
10+
* @signature `prettyPrint()`
11+
*
12+
* Finds all `<code>` elements on the page and adds the `prettyprint` class
13+
* before executing the required pretty print engine.
14+
*
15+
* Also requires [bit-docs-prettify/prettify.less].
16+
*/
417
module.exports = function(){
518
var codes = document.getElementsByTagName("code");
619
for(var i = 0; i < codes.length; i ++){

prettify.less

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
@import "locate://bit-docs-site/styles/variables.less";
55

66
/**
7-
* @stylesheet prettify.less Prettify
8-
* @parent bit-docs/theme
7+
* @parent bit-docs-prettify/static
8+
* @module bit-docs-prettify/prettify.less
99
*
10-
* @description
11-
* Layout of code wells and syntax highlighting of code languages.
10+
* @description Layout of code wells and syntax highlighting of code languages.
1211
*
1312
* @body
1413
*
1514
* Syntax highlighting and colors provided by
16-
* <a href="https://github.com/google/code-prettify">prettify.js</a> and
17-
* <a href="https://github.com/chriskempson/tomorrow-theme">Tomorrow Theme</a>.
15+
* [JavaScript code prettifier](https://github.com/google/code-prettify) and
16+
* [Tomorrow Theme](https://github.com/chriskempson/tomorrow-theme).
1817
*
1918
* Code "wells" are styled based on the use of the `<pre>` and `<code>` tags
2019
* around your desired code example.
@@ -64,7 +63,6 @@
6463
* }
6564
* ```
6665
*/
67-
6866
code {
6967
padding: 0 5px;
7068
border-radius: 5px;

0 commit comments

Comments
 (0)