Logo Explicode

Explicode is an open-source project that lets you write rich Markdown documentation directly inside your code comments, turning a single source file into both runnable code and beautifully rendered documentation.

The VS Code extension provides live previews of your documentation directly inside the IDE. The npm package can convert supported source files into .md Markdown via the terminal or generate a GitHub Pages–ready docs/ folder. Because the documentation lives inside comments, it doesn’t affect your program or build process, no special compilers, configuration, or tooling changes are required. Simply write Markdown in your comments as you code. Keeping documentation in the same file as the code ensures it stays accurate and up to date, evolving alongside the implementation and automatically versioned with your project in Git. Explicode brings the principles of literate programming to modern development across many languages, without the need for language-specific frameworks or tedious setup.


View on GitHub

Features

Quick Start

Guidelines

Use Markdown syntax inside the multiline comments of your favorite language:

Everything outside a doc block is rendered as a syntax-highlighted code block. Full CommonMark syntax is supported, including headings, lists, math with LaTeX syntax, images, tables, and more.

Examples

Python

"""
# Fibonacci Sequence

Generates the first `n` Fibonacci numbers iteratively.

- **Input**: `n` (int) β€” how many numbers to generate
- **Output**: list of the first `n` Fibonacci numbers
"""

def fibonacci(n):
    if n <= 0:
        return []
    elif n == 1:
        return [0]
    seq = [0, 1]
    for _ in range(2, n):
        seq.append(seq[-1] + seq[-2])
    return seq

fibonacci(5)  # [0, 1, 1, 2, 3]

Markdown

# Fibonacci Sequence

Generates the first `n` Fibonacci numbers iteratively.

- **Input**: `n` (int) β€” how many numbers to generate
- **Output**: list of the first `n` Fibonacci numbers

```python
def fibonacci(n):
    if n <= 0:
        return []
    elif n == 1:
        return [0]
    seq = [0, 1]
    for _ in range(2, n):
        seq.append(seq[-1] + seq[-2])
    return seq

fibonacci(5)  # [0, 1, 1, 2, 3]
```

JavaScript

/*
# Fibonacci Sequence

Generates the first `n` Fibonacci numbers iteratively.

- **Input**: `n` (int) β€” how many numbers to generate
- **Output**: list of the first `n` Fibonacci numbers
*/

function fibonacci(n) {
    if (n <= 0) return [];
    if (n === 1) return [0];
    const seq = [0, 1];
    for (let i = 2; i < n; i++) {
        seq.push(seq[i - 1] + seq[i - 2]);
    }
    return seq;
}

fibonacci(5);  // [0, 1, 1, 2, 3]

Markdown


# Fibonacci Sequence

Generates the first `n` Fibonacci numbers iteratively.

- **Input**: `n` (int) β€” how many numbers to generate
- **Output**: list of the first `n` Fibonacci numbers

```javascript
function fibonacci(n) {
    if (n <= 0) return [];
    if (n === 1) return [0];
    const seq = [0, 1];
    for (let i = 2; i < n; i++) {
        seq.push(seq[i - 1] + seq[i - 2]);
    }
    return seq;
}

fibonacci(5);  // [0, 1, 1, 2, 3]
```

Supported Languages

Explicode currently supports:

Need support for another language? Open an issue or reach out.

Commonly Asked Questions

Why use Explicode?

Explicode keeps your documentation and code in the same place. By writing Markdown directly inside code comments, you can turn a single source file into both runnable code and clear, readable documentation. This makes documentation easier to maintain, keeps it versioned alongside your code, and helps others understand your work without needing separate documentation files or tools.

Do I need special files or tools to use Explicode?

No. Explicode works directly with your existing source files. Simply write Markdown inside your code comments and open the preview. There’s no need for special file formats, configuration, or changes to your build system.

Does Explicode change my code or build output?

No. Explicode only reads your source file β€” it never modifies it. Documentation lives inside standard language comments, so your compiler, interpreter, and build tools see exactly the same code they always did.

Does Explicode store my code?

No. Explicode only reads your source file locally to generate the rendered preview. Your code is never uploaded or stored in any database.

How is this different from JSDoc, Doxygen, or Sphinx?

Tools like JSDoc and Sphinx extract documentation from special comment annotations (for example @param or @returns) and generate API reference docs. Explicode takes a different approach: your comments are free-form Markdown prose, letting you write narrative documentation, tutorials, or literate-programming-style explanations β€” not just API stubs. It also works across many languages without any language-specific toolchain.

My favorite language isn't listed, can I request it?

Absolutely. Open an issue on GitHub with the language name and its block comment syntax. Languages that use /* ... */ style block comments are usually trivial to add.

Is Explicode free and open source?

Yes! The extension is free to install from the VS Code Marketplace. Check the repository for license details and source code.

Contact

Have a bug report, feature request, or collaboration idea?
Reach out at froem076@umn.edu.


Explicode logo Explicode Β· 2026