2.0.8 • Published 6 months ago

executor-editor v2.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
6 months ago

executor-editor

node version npm version downloads count size license github-ci

šŸ”Ø Display and evaluate your JavaScript code.

Preview šŸŽ‰

https://piecioshka.github.io/executor-editor/demo/

npm.io

Features

  • āœ… Embed any programming code
  • āœ… Highlight JavaScript syntax
  • āœ… Auto-evaluate the JavaScript code
  • āœ… Execute code on demand
  • āœ… Layout modes: horizontal, vertical
  • āœ… Multiple instance on single page
  • āœ… Support skins
  • āœ… Display errors in red color

Usage

Installation:

npm install executor-editor

or

bower install executor-editor
  1. Add CSS class executor-editor to HTML element:

    <pre class="executor-editor">
    class Cake {
        toString() {
            return '[Cake]';
        }
    }
    
    console.log(String(new Cake()));
    </pre>
  2. Add on the bottom of page, example before </body>

    <link href="/path/to/executor-editor/dist/executor-editor.css"/>
    <link href="/path/to/executor-editor/dist/skins/blue-skin.css"/>
    <link href="/path/to/executor-editor/dist/skins/normal-skin.css"/>
    
    <script src="/path/to/executor-editor/dist/executor-editor.js"></script>
    <script>ExecutorEditor.setup();</script>

API

All settings you can pass by HTML attributes.

data-autoevaluate

  • Default: true
  • Options: true | false
  • Example:

    <pre class="executor-editor" data-autoevaluate="false">
        [...]
    </pre>

data-autofocus

  • Default: true
  • Options: true | false
  • Example:

    <pre class="executor-editor" data-autofocus="true">
        [...]
    </pre>

data-skin

  • Default: normal
  • Options: normal | blue
  • Example:

    <pre class="executor-editor" data-skin="blue">
        [...]
    </pre>

Purpose

The project was created for presentation slides, to embed code and quickly execute it.

License

The MIT License @ 2015

2.0.8

6 months ago

2.0.7

9 months ago

2.0.6

9 months ago

2.0.5

9 months ago

2.0.3

9 months ago

2.0.4

9 months ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.2

7 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.9.6

9 years ago