Giter Site home page Giter Site logo

marketingpipeline / code-runner-web-component Goto Github PK

View Code? Open in Web Editor NEW
49.0 3.0 10.0 132 KB

A web component that allows you to run high level programming languages on your websites (static websites included!)

License: GNU General Public License v3.0

JavaScript 85.71% CSS 14.29%
web-component code-runner compiler custom-element github html javascript online-compiler online-ide programming-examples run-code static-site web-components code-execution code-executor piston piston-api web-ide code-editor repl

code-runner-web-component's Introduction

Code-Runner-Web-Component

ezgif-5-d9d9221610

A web component that allows you to run high level programming languages on your website via the public Piston API
Show your support!

Example and usage

You can view a demo of the Code Runner web component in use here.

How to use Code Runner:

Set a language attribute to a supported programming language you prefer to use - example below

<code-runner language="python"></code-runner>

include this script in your HTML document.

<script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Code-Runner-Web-Component@main/dist/code-runner-wc.min.js" defer></script> 

How to use Code Runner with Pre-Defined Code:

You can pre-define a code example to run, simply by inserting the code inside of a code-runner element like so -

<code-runner language="python">print('hello world')</code-runner>

Options

Attribute Meaning Default Required
language The programming language to execute code with Undefined Yes

Supported Languages

awk, bash, befunge93, brachylog, brainfuck, bqn, c, c++, cjam, clojure, cobol, coffeescript, cow, crystal, csharp, csharp.net, d, dart, dash, dragon, elixir, emacs, emojicode, erlang, file, forte, forth, fortran, freebasic, fsharp.net, fsi, go, golfscript, groovy, haskell, husk, iverilog, japt, java, javascript, jelly, julia, kotlin, lisp, llvm_ir, lolcode, lua, matl, nasm, nasm64, nim, ocaml, octave, osabie, paradoc, pascal, perl, php, ponylang, powershell, prolog, pure, pyth, python, python2, racket, raku, retina, rockstar, rscript, ruby, rust, scala, smalltalk, sqlite3, swift, typescript, basic, basic.net, vlang, vyxal, yeethon, zig,


Contributing GitHub

Want to improve this? Create a pull request with detailed changes / improvements! If approved you will be added to the list of contributors of this awesome project!

See also the list of contributors who participate in this project.

License GitHub

This project is licensed under the GPL-3.0 License - see the LICENSE.md file for details.

code-runner-web-component's People

Contributors

marketingpip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

code-runner-web-component's Issues

[Bug Report]: v1.0.4 has shared state issue.

This current version has a shared state issue - which went un-noticed to my own self error in not properly testing the library before publishing it.

In the case's where more than <code-runnner> is included the dom. The value from the last included web component is being used to be sent to the API.

This is due to not properly grabbing the values of the Ace Editor API - as far as I do believe.

Steps to reproduce the behavior:

  1. Go to demo page.
  2. Add console.log('test') into "Undefined Code".
  3. Press run on both displayed components.

Previous versions of this web component do NOT have this issue.

[Feature Request]: Multiple Tab Support

Is your feature request related to a problem? Please describe.

To compile / run scripts such as HTML, CSS / JS in the web component. Tabs will be required. This will also provide support for running multiple files as tabs via the Piston API and other plugins that allow usage of tabs.

Describe the solution you'd like

Possibly a plugin / addons or function built directly into the web component that allows / detects if tabs are needed.

Needs to-

  • allow tab content to be easily used in other plugins / addons.
  • allow plugin / addon to detect if tabs are needed or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.