> ## Documentation Index
> Fetch the complete documentation index at: https://geni.masiting.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Documentation Renderers

> Serve your docs with the built-in portal, Scalar API Reference or Stoplight Elements.

## Overview

The docs UI route (`/docs/api` by default) can be rendered by three built-in renderers. All of them load the same OpenAPI document from the JSON route of the current API.

| Renderer | UI |
| - | - |
| `blade` (default) | Built-in portal: version switcher, Try It console, MCP-friendly, no build step |
| `scalar` | [Scalar API Reference](https://github.com/scalar/scalar) |
| `elements` | [Stoplight Elements](https://github.com/stoplightio/elements) |

Pick one with `geni.renderer`:

```php config/geni.php theme={null}
'renderer' => 'scalar', // 'blade' | 'scalar' | 'elements'
```

## Per-API Renderer

Each entry of `geni.apis` can choose its own renderer. APIs without a `renderer` key use the global `geni.renderer`:

```php config/geni.php theme={null}
'renderer' => 'blade',

'apis' => [
    'v1' => ['api_path' => 'api/v1'],
    'v2' => ['api_path' => 'api/v2', 'renderer' => 'scalar'],
],
```

## Built-in Portal (`blade`)

The default renderer is a standalone Blade, Tailwind and Alpine.js portal with live search, syntax highlighting, the interactive version switcher and a Try It console.

```php config/geni.php theme={null}
'renderers' => [
    'blade' => [
        'tailwind_cdn_url' => 'https://cdn.tailwindcss.com/3.4.17',
        'alpine_cdn_url' => 'https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js',
        'custom_css' => null,
    ],
],
```

* The Tailwind Play CDN and Alpine.js URLs are pinned. The docs login page uses the same URLs.
* `custom_css` is injected into the page's `<style>` element; it cannot close that element.

### API Overview

When the URL has no endpoint hash, the portal opens on an API overview showing the title, version and `info.description` of the document. Clicking the API title in the sidebar returns to it. Multi-line descriptions keep their line breaks.

### Markdown Descriptions

The API overview, operation descriptions and response descriptions are rendered as Markdown by a small, escaping-first renderer. It supports:

* Paragraphs and headings
* Bulleted and numbered lists
* Fenced code blocks and inline `code`
* **Bold** and *italic*
* Links with `http(s)` or relative URLs

Raw HTML is never interpreted; it is shown as text. See [PHPDoc Annotations](/annotations/phpdoc#summary-and-description) for how descriptions are read from docblocks.

## Scalar (`scalar`)

```php config/geni.php theme={null}
'renderer' => 'scalar',

'renderers' => [
    'scalar' => [
        'script_url' => null, // defaults to a pinned jsDelivr build
        'configuration' => [
            'theme' => 'laravel',
        ],
    ],
],
```

* By default Geni loads `https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.72.3/dist/browser/standalone.js`.
* `configuration` is passed to `Scalar.createApiReference()` as-is (for example `theme`, `layout`, `hideModels`). Geni sets `url` to the current API's JSON route and `theme` to `laravel` unless you override it.

## Stoplight Elements (`elements`)

```php config/geni.php theme={null}
'renderer' => 'elements',

'renderers' => [
    'elements' => [
        'script_url' => null,
        'stylesheet_url' => null,
        'layout' => 'sidebar', // 'sidebar' | 'stacked'
        'hide_try_it' => false,
        'theme' => 'light',    // 'light' | 'dark'
    ],
],
```

By default Geni loads the pinned `@stoplight/elements@9.0.25` build from jsDelivr:

* Script: `https://cdn.jsdelivr.net/npm/@stoplight/elements@9.0.25/web-components.min.js`
* Stylesheet: `https://cdn.jsdelivr.net/npm/@stoplight/elements@9.0.25/styles.min.css`

## Self-Hosting Assets

Scalar and Elements load pinned CDN builds. To serve them from your own domain (for example under a strict Content Security Policy), download the files and point `script_url` (and `stylesheet_url` for Elements) at your copies:

```php config/geni.php theme={null}
'renderers' => [
    'scalar' => [
        'script_url' => '/vendor/scalar/standalone.js',
    ],
],
```

## Custom Renderers

`geni.renderer` (or an API's `renderer`) may also be a class name implementing `Geni\Laravel\Renderer`:

```php theme={null}
namespace Geni\Laravel;

use Geni\Inference\Document\OpenApiDocument;
use Illuminate\Http\Response;

interface Renderer
{
    public function render(OpenApiDocument $document, array $config): Response;
}
```

An unknown value falls back to the `blade` renderer.

<Note>
  Renderers only change the UI. Access rules (`restrict_to_local`, the `viewApiDocs` gate, `docs_auth`) apply to every renderer. See [Documentation Authentication](/guides/authentication).
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.