# brython_coderunner

> A Brython-Coderunner IDE

Latest version **1.4.0** (published 2021-03-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install brython_coderunner
pnpm add brython_coderunner
yarn add brython_coderunner
bun add brython_coderunner
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2021-03-26 |
| First published | 2021-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andreas Siebel |
| Maintainers | a_siebel |
| Keywords | brython, processing, repl, ide, coding |

## Links

- npm: https://www.npmjs.com/package/brython_coderunner
- Repository: https://codeberg.org/a_siebel/brython_coderunner
- npm.io page: https://npm.io/package/brython_coderunner

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 1.4.0 (latest) — 2021-03-26
- 1.3.1 — 2021-03-23
- 1.3.0 — 2021-03-23
- 1.2.3 — 2021-03-21
- 1.2.2 — 2021-03-21
- 1.2.1 — 2021-03-21
- 1.2.0 — 2021-03-21
- 1.1.0 — 2021-03-20
- 1.0.1 — 2021-03-17
- 1.0.0 — 2021-03-17

## README

# Brython Coderunner

Brython Coderunner transforms your Markdown fields and textareas into a Brython IDE. You can execute code immediately and even use Processing (Brython+Processing = Brocessing).

## Usage

Currently there are the following ways to generate a Brython field:

### Code-Field

#### Prequesites

Brython-Coderunner is build on top of ace-Editor and p5 Library. So you need following imports:

```
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/ace-editor-builds@1.2.4/src-min-noconflict/ace.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/p5@1.3.0/lib/p5.min.js"></script>
    <script type="text/javascript" src="path-to-brython-coderunner/src/brython_coderunner.js"></script>
```

Code fields with the following classes are transformed in Brython-IDES:

```
<code class="language-brython_coderunner>
</code>


or simply

<code class="brython_coderunner">
</code>
```

Textareas can also be converted. To do this, the textareas must be enclosed by a div in the following form:

```
<div class="brython_textarea">
<textarea>
</textarea>
</div>
```
### Options

Options can be passed to the representation. The most elegant way to do this is to pass a JSON field right after the opening tag:
 
```
<code class="brython_coderunner">
{options="processing buttons editor"}
</code>
```

Possible options:

  * **editor**: Displays the editor.

  * **buttons** Displays buttons (Run, Clear).

  * **canvas** Displays a canvas where code can be rendered.

  * **brocessing** / **processing**: Loads the code as processing code.
  
  * **turtle** / Transforms import turtle in brython (loads libraries and turtle-canvas) (alpha)

#### Load Brython Coderunner

Coderunner can be loaded with following Code:

```
<!-- Brython / Processing -->
<script src="https://cdn.jsdelivr.net/npm/p5@1.3.0/lib/p5.min.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/brython_coderunner@1.2.3/src/brython_coderunner.js"></script>
<script>
    $(window).on('load', function() {
            brython_coderunner("/resources/brython_coderunner/").then(function() {
                console.info("then");
            }); // then
    }); // on
</script>
```
(Change version to actual version or use local path)

##### Moodle integration

You can use Brython Coderunner as moodle database activity or embed it with a moodle-text-block. See moodle directory.

---
_Source: https://npm.io/package/brython_coderunner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
