---
title: Code editor: multi-language
slug: docs/_Dmw-code-editor-multi-language
description: This document offers a comprehensive code editor that empowers users to effortlessly exhibit and duplicate code examples. With the ability to create multiple tabs and rearrange them through a simple drag-and-drop process, users can conveniently organize t
docTags: 
createdAt: 2020-11-13T12:28:51.000Z
---

Our code editor is where you can show off code examples that can be easily copied.

You can add multiple tabs using the same language and use drag-and-drop to reorganize tabs.

![](https://api.archbee.com/api/optimize/bNBm7nPJgXjbjLyfbHNh2/THSqdEtr4ZHb3KqpazPfo_f4dgqb8.gif)

When you add a new tab, you can also change the name to something like a file, e.g., `main.js`

See our example:

:::CodeblockTabs
main.js

```javascript
fetch("https://api.cakes.com", {
  "method": "GET",
  "headers": {
    "Accept": "application/json"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});

```

```go
// We can use channels to synchronize execution
// across goroutines. Here's an example of using a
// blocking receive to wait for a goroutine to finish.
// When waiting for multiple goroutines to finish,
// you may prefer to use a [WaitGroup](waitgroups).

package main

import "fmt"
import "time"

// This is the function we'll run in a goroutine. The
// `done` channel will be used to notify another
// goroutine that this function's work is done.
func worker(done chan bool) {
    fmt.Print("working...")
    time.Sleep(time.Second)
    fmt.Println("done")

    // Send a value to notify that we're done.
    done <- true
}

func main() {

    // Start a worker goroutine, giving it the channel to
    // notify on.
    done := make(chan bool, 1)
    go worker(done)

    // Block until we receive a notification from the
    // worker on the channel.
    <-done
}

```

```python
# Python3 program to demonstrate 
# the use of sample() function . 
  
# import random  
import random 
  
  
# Prints list of random items of 
# length 3 from the given list. 
list1 = [1, 2, 3, 4, 5, 6]  
print("With list:", random.sample(list1, 3)) 
  
# Prints list of random items of 
# length 4 from the given string.  
string = "GeeksforGeeks"
print("With string:", random.sample(string, 4)) 
  
# Prints list of random items of 
# length 4 from the given tuple. 
tuple1 = ("ankit", "geeks", "computer", "science", 
                   "portal", "scientist", "btech") 
print("With tuple:", random.sample(tuple1, 4)) 
  
  
# Prints list of random items of 
# length 3 from the given set. 
set1 = {"a", "b", "c", "d", "e"} 
print("With set:", random.sample(set1, 3)) 
```

```php
<?php
$name = "Quincy";
echo "Hi! My name is " . $name . "<br>";
echo "Hi! My name is " . $NAME . "<br>";
echo "Hi! My name is " . $NaMe . "<br>";
?>
```

```csharp
/*
 * C# Program to Check Whether the Entered Year is a Leap Year or Not
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Program
{
    class leapyear
    {
        static void Main(string[] args)
        {
            leapyear obj = new leapyear();
            obj.readdata();
            obj.leap();
        }
        int y;
        public void readdata()
        {
            Console.WriteLine("Enter the Year in Four Digits : ");
            y = Convert.ToInt32(Console.ReadLine());
        }
        public void leap()
        {
            if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))
            {
                Console.WriteLine("{0} is a Leap Year", y);
            }
            else
            {
                Console.WriteLine("{0} is not a Leap Year", y);
            }
            Console.ReadLine();
        }
    }
}
```
:::

## Markdown

### Code block with a single tab

```nodejs
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World!');
}).listen(8080);
```

Use the following Markdown to generate a code block with a single code example:

````markdown
## Code block

```nodejs
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World!');
}).listen(8080);
```
````

### Code blocks without language

:::CodeblockTabs
```text
// code block not specified
```

```text
// code block not specified
```

```text
// code block not specified
```
:::

Use the following Markdown to generate a code block without specifying the language:

````markdown
## Code blocks

:::::codeblocktabs

```
// code block not specified
```

```
// code block not specified
```

```
// code block not specified
```

:::::
````

### Code editor with multiple tabs

:::CodeblockTabs
```php
// PHP is the best.
```

```java
// and JAVA too
```

```go
// demo go
```

```javascript
// demo js
```
:::

Use the following Markdown to generate a Code block with multiple tabs:

````markdown
## Demo Code Blocks

:::::codeblocktabs

```php
// PHP is the best.
```

```java
// and JAVA too
```

```go
// demo go
```

```javascript
// demo js
```

:::::
````

***

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-C1IcmVcG0rx4ZLHX6X7V7-20250911-192557.png"}
:FontAwesome[]{icon="fa-solid fa-cubes"} &#x20;**&#x20;Find other blocks**

Discover new ways and blocks to create stunning and functional documentation pages.

[Check out all blocks](docId:6B0VTQTVUnMP93e-SZQ2p)&#x20;
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-YRyGGWKsNS1ZZJa5XJy0z-20250911-192608.png"}
:FontAwesome[]{icon="fa-solid fa-headset"}**&#x20; Need help?  ⬇️**

Use the **blue** **chat bubble&#x20;**&#x66;rom bottom right corner.

Or try **AI Chat** (from search box) for quick answers.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-MS_ubDHlXgoktt4svD2rL-20250911-192619.png"}
:FontAwesome[]{icon="fa-solid fa-hand-holding-heart"}**&#x20;  Your opinion matters**

Use the below feedback form, anonymously.

Or ask a question in **Q\&A section** and our team or AI will give you a solution.
:::
::::

