Skip to content

Commit 7398ca1

Browse files
committed
Made documentation better
1 parent 9f61af7 commit 7398ca1

6 files changed

Lines changed: 36 additions & 145 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Install this component using NPM like so:
44
```bash
5-
npm install react-deferred-component --save-dev
5+
npm install react-highlight.js --save
66
```
77

88
# License

demo/Highlight.demo.jsx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,34 @@ export default class HighlightDemoDemo extends Component {
5151
To use this component simply <code>npm install react-highlight</code> and optionally choose a custom stylesheet from
5252
<a href="https://highlightjs.org/">highlight.js</a>.
5353
</p>
54+
<h2>Demo</h2>
5455
<p>
5556
Try it yourself by specifying a language and content below:
5657
</p>
57-
<p>
58-
<label>Language</label>
59-
<input
60-
type='text'
61-
name='language'
62-
defaultValue={language}
63-
onChange={event => this._debouncedSetState('language', event.target.value)}/>
64-
</p>
65-
<p>
66-
<label>Content</label>
67-
<textarea
68-
type='text'
69-
name='content'
70-
defaultValue={content}
71-
onChange={event => this._debouncedSetState('content', event.target.value)}/>
72-
</p>
73-
<Highlight language={language}>
74-
{content}
75-
</Highlight>
58+
<form>
59+
<div className='form-group'>
60+
<label>Language</label>
61+
<input
62+
className='form-control'
63+
type='text'
64+
name='language'
65+
defaultValue={language}
66+
onChange={event => this._debouncedSetState('language', event.target.value)}/>
67+
</div>
68+
<div className='form-group'>
69+
<label>Content</label>
70+
<textarea
71+
className='form-control'
72+
type='text'
73+
name='content'
74+
defaultValue={content}
75+
onChange={event => this._debouncedSetState('content', event.target.value)}/>
76+
</div>
77+
<label>Highlight</label>
78+
<Highlight language={language}>
79+
{content}
80+
</Highlight>
81+
</form>
7682
</div>
7783
)
7884
}

demo/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'purecss'
22
import 'highlight.js/styles/github.css'
33
import './highlight.css'
4-
import './main.css'
54

65
import React from 'react'
76
import ReactDOM from 'react-dom'

demo/main.css

Lines changed: 0 additions & 110 deletions
This file was deleted.

lib/index_template.tpl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@
66
{% if (o.htmlWebpackPlugin.files.favicon) { %}
77
<link rel="shortcut icon" href="{%=o.htmlWebpackPlugin.files.favicon%}">
88
{% } %}
9+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
910
{% for (var css in o.htmlWebpackPlugin.files.css) { %}
1011
<link href="{%=o.htmlWebpackPlugin.files.css[css] %}" rel="stylesheet">
1112
{% } %}
1213
</head>
1314
<body>
14-
<div class="pure-g">
15-
<header class="pure-u-1">
16-
<h1>%name%</h1>
15+
<div class="container">
16+
<h1 class='page-header'>%name%</h1>
17+
<p class="lead">%description%</p>
1718

18-
<div class="description">%description%</div>
19-
</header>
20-
21-
<article class="pure-u-1">
22-
<section class="demonstration">%demo%</section>
23-
<section class="documentation">%documentation%</section>
24-
</article>
19+
<div class="demonstration">%demo%</div>
20+
<div class="documentation">%documentation%</div>
2521
</div>
2622

2723
{% for (var chunk in o.htmlWebpackPlugin.files.chunks) { %}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "react-highlight",
2+
"name": "react-highlight.js",
33
"description": "A lightweight React wrapper around the Highlight.js syntaxt highlighting library",
44
"author": "Brian Vaughn",
55
"user": "bvaughn",
@@ -106,11 +106,11 @@
106106
},
107107
"repository": {
108108
"type": "git",
109-
"url": "https://github.com/bvaughn/react-deferred-component.git"
109+
"url": "https://github.com/bvaughn/react-highlight.js.git"
110110
},
111-
"homepage": "https://github.com/bvaughn/react-deferred-component/",
111+
"homepage": "https://github.com/bvaughn/react-highlight.js/",
112112
"bugs": {
113-
"url": "https://github.com/bvaughn/react-deferred-component/issues"
113+
"url": "https://github.com/bvaughn/react-highlight.js/issues"
114114
},
115115
"keywords": [
116116
"react",

0 commit comments

Comments
 (0)