# Run the Docs

[![npm badge](https://img.shields.io/npm/v/run-the-docs?style=flat-square)](https://www.npmjs.com/package/run-the-docs)
[![jsdelivr badge](https://data.jsdelivr.com/v1/package/npm/run-the-docs/badge)](https://www.jsdelivr.com/package/npm/run-the-docs)
[![Discord badge](https://img.shields.io/discord/830547562385113149?style=flat-square&color=%235865F2)](https://discord.gg/nbyZ6EpUum)
[![Twitter Follow badge](https://img.shields.io/twitter/follow/psychothan?color=%231DA1F2&label=%40psychothan&style=flat-square)](https://twitter.com/psychothan)

## Installation

```sh
$ npm install --save run-the-docs
```

## `props`

<!-- prettier-ignore -->
|  name  | default |   values  |  description  |
| :--------: | :-----: | :------: | :---------: |
| `packages` |  `[]`   | `Array`: [package names currently avalable](https://github.com/iodide-project/pyodide/tree/master/packages) in Pyodide   |  Uses Pyodide's [`loadPackage()`](https://pyodide.readthedocs.io/en/latest/using_pyodide_from_webworker.html#loading-packages) to preload packages   |
|  `console`  | `true`  | `Boolean`: `true` or `false` | `false` disables the HTML console which displays the results. |
|   `edit`   | `true`  |  `Boolean`: `true` or `false`   |  `false` disables the `textarea` input while still allowing the embedded code to be run. |
|   `scope`   | `false`  |  `Boolean`: `true` or `false`   |  `true` creates a new `Repl()` for the component with its own Python context. `false` shares the `Repl()` context between editors globally, i.e. one editor can reference variables from another. |
|   `onResult`   | `undefined`  |  `Function`: [function expression][f_exp] or reference  |  callback function that receives the results when the code is run. `(res, err) => { ... }` |
|   `code`   | `undefined`  |  `String` or `template literal` | placeholder code that populates the editor component on initialization. |

[f_exp]: https://developer.mozilla.org/en-US/docs/web/JavaScript/Reference/Operators/function

## Contributing/Requests

Open an [issue](https://github.com/dapperdataclub/run-the-docs/issues) or post a message in the [chatroom](https://discord.gg/nbyZ6EpUum). If you would like to contribute to the project (code, documentation, tutorials, etc.) see the [contributing guide](CONTRIBUTING.md) for how to get started 🙌


## License

Run the Docs uses the [Mozilla Public License Version 2.0](https://choosealicense.com/licenses/mpl-2.0/).