Skip to content

Commit

Permalink
Improved README.md (Install)
Browse files Browse the repository at this point in the history
  • Loading branch information
abodelot committed Aug 19, 2019
1 parent 4ae7456 commit 232969b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions README.md
Expand Up @@ -14,17 +14,27 @@ Features:

Check out the [demo page](http://rawgit.com/abodelot/jquery.json-viewer/master/demo.html)!

## Usage

Import `jquery.json-viewer.js` and `jquery.json-viewer.css` in your application.
## Install

Copy sources from git repository, or use npm:

```sh
npm install jquery.json-viewer
```

Then just call the `jsonViewer()` method and pass your JSON data in argument:
Make sure jQuery is already included. Then import `jquery.json-viewer.js` and `jquery.json-viewer.css` in your HTML document:

```html
<head>
<script src="json-viewer/jquery.json-viewer.js"></script>
<link href="json-viewer/jquery.json-viewer.css" type="text/css" rel="stylesheet">
</head>
```

## Usage

Call the `jsonViewer()` method on target element and pass your JSON data in argument:

```html
<pre id="json-renderer"></pre>
```
Expand Down
2 changes: 1 addition & 1 deletion demo.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="json-viewer/jquery.json-viewer.js"></script>
<link href="json-viewer/jquery.json-viewer.css" type="text/css" rel="stylesheet" />
<link href="json-viewer/jquery.json-viewer.css" type="text/css" rel="stylesheet">

<style type="text/css">
body {
Expand Down

0 comments on commit 232969b

Please sign in to comment.