File tree Expand file tree Collapse file tree 4 files changed +29
-11
lines changed Expand file tree Collapse file tree 4 files changed +29
-11
lines changed Original file line number Diff line number Diff line change
1
+ package-lock.json
1
2
node_modules /
2
3
temp /
Original file line number Diff line number Diff line change 1
1
/**
2
- * @module {function} bit-docs-prettify
3
2
* @parent plugins
3
+ * @module {function} bit-docs-prettify
4
+ * @group bit-docs-prettify/static static
4
5
*
5
6
* @description A bit-docs plugin that makes source-code snippets in HTML prettier.
6
- *
7
+ *
7
8
* @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).
10
16
*/
11
17
module . exports = function ( bitDocs ) {
12
18
var pkg = require ( "./package.json" ) ;
Original file line number Diff line number Diff line change 1
1
require ( "./prettify-engine" ) ;
2
2
require ( "./prettify.less" )
3
3
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
+ */
4
17
module . exports = function ( ) {
5
18
var codes = document . getElementsByTagName ( "code" ) ;
6
19
for ( var i = 0 ; i < codes . length ; i ++ ) {
Original file line number Diff line number Diff line change 4
4
@import " locate://bit-docs-site/styles/variables.less" ;
5
5
6
6
/* *
7
- * @stylesheet prettify.less Prettify
8
- * @parent bit-docs/theme
7
+ * @parent bit-docs- prettify/static
8
+ * @module bit-docs-prettify/prettify.less
9
9
*
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.
12
11
*
13
12
* @body
14
13
*
15
14
* 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) .
18
17
*
19
18
* Code "wells" are styled based on the use of the `<pre>` and `<code>` tags
20
19
* around your desired code example.
64
63
* }
65
64
* ```
66
65
*/
67
-
68
66
code {
69
67
padding : 0 5px ;
70
68
border-radius : 5px ;
You can’t perform that action at this time.
0 commit comments