Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexbinary/nw-playground

Quick experiments with NW.js
https://github.com/alexbinary/nw-playground

Last synced: 1 day ago
JSON representation

Quick experiments with NW.js

Awesome Lists containing this project

README

        

# nw-playground

> Quick experiments with NW.js

## Install

```
npm install nw-playground
```

## Usage

```javascript
require('nw-playground')(document).convertAll();
```

This will turn all code that looks like this :

```html


console.log('hello');

```

Into this :

```html



console.log('hello');


Run


```

User will be able to edit the content of the `

` tag.

Clicking the `Run` button will create a `` tag containing the code currently inside the `<pre>` tag nested inside a closure, and append it at the end of the `<body>` :

```html
<body>
<!-- ... -->
<script>
(function() {
console.log('hello');
})();




hljs.configure(/* ... */);
require('nw-playground')(document, hljs).convertAll();