Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Simple piece of code

To display a piece of code, use the following syntax:

var a = 2;
var b = 4;

javascript specifies the language so that the syntax is correctly highlighted.

Auto fold

You can auto fold some sections of your code by using this syntax:

// { autofold
  code which is collapsed
// }

visible code

Runnable snippet


For basic usage, you can make a simple piece of code runnable. To do that you need to create a piece of code by using the standard markdown syntax and then add the runnable keyword:

```javascript runnable
var a = 2;
var b = 4;

renders as

var a = 2;
var b = 4;

Compatible languages

This simple syntax is a shortcut for a given language that automatically selects a runner and a command.

Here you can find a table that summarizes the supported languages and the associated docker image, command and filename.

LanguageDocker imagecommand filename
javajava:latestbash -c "javac" && java Main"
 javascriptnode:latestnode index.js index.js
Cgcc:latestbash -c "gcc main.c -o exe && ./exe" main.c
C#mono:5bash -c "mcs main.cs && mono main.exe" main.cs
C++gcc:latestbash -c "g++ -o exe && ./exe"
dartgoogle/dart:latestdart main.dart main.dart
elixirelixir:latestelixir main.exs main.exs
F#mono5:latestbash -c "fsharpc --nologo main.fs && mono main.exe" main.fs
gogolang:latestgo run main.go main.go
groovygroovy:latestgroovy main.groovy main.groovy
haskellhaskell:latestbash -c "ghc main.hs -o exe && ./exe" main.hs
htmlubuntu:latestecho "TECHIO> open -s /project/target index.html" index.html
kotlintechio/ main.ktmain.kt
phpphp:latestphp main.php main.php
Rr-base:latestRscript main.R main.R
rubyruby:latestruby main.rb main.rb
rustrust:latestbash -c "rustc && ./main"
scalatechio/scala-sbt:2.12bash -c "scalac Main.scala && scala Main" Main.scala
swiftswift:latestswift main.swift main.swift
vb.netmono:5bash -c "vbnc /nologo main.vb && mono main.exe" main.vb

For any language in the language column you can create a snippet by specifying the language and the keyword runnable as seen before.

When the user presses the Run button, it automatically saves this piece of code in a file (filename column) stored in the specific docker image and then executes the command.

If you want us to add new language extension, feel free to contact us by giving us all required data (docker image, command, filename):

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content