For general contributing guidelines, see the Contributing Guide on DoneJS.com.
bit-docs-prettify
├── bit-docs.js # Registers this package into the bit-docs system as a dependency.
├── prettify.js # Bootstraps prism.
└── test.js # Creates temp/index.html with <pre><code>var str ='hello world';</code></pre>
# to verify that prettyprint gets applied after a timeout.
Install the packages defined in package.json
:
npm install
Tests are located in test.js
, at the root of this repo.
To run the tests, execute the test
script defined in package.json
:
npm test
This will produce a directory and file at temp/index.html
, containing the source-code snippet in HTML:
<pre><code class="language-javascript">var str = 'hello world';</code></pre>
<pre><code class="language-css">body{ margin: 0; background: purple; }</code></pre>
<pre><code>// some misc code</code></pre>
<p><code>var str = 'hello world';</code>
Running the tests will verify that this source-code snippet in HTML is correctly prettified by the plugin.
In test.js
, the bit-docs-generate-html plugin is generating HTML from the equivalent of this markdown:
```javascript
var str = 'hello world';
```
```css
body {
margin: 0;
background: purple;
}
```
```
// some misc code
```
`var str = 'hello world';`
That shows how a bit-docs "generator" plugin can generate the right HTML to play nice with bit-docs-prettify
.
You can open the file in your web browser to see the "pretty" result using http-server
:
npm install -g http-server
npm test && http-server
Now visit http://127.0.0.1:8080/temp/index.html
Our forums and Gitter chat are the best places to ask questions.