# Omni.UI Documentation Builder

The Documentation Builder extension finds enabled extensions with a [documentation] section in their extension.toml
and adds a menu to show that documentation in a popup window. Extensions do not need to depend on
omni.kit.documentation.builder to enable this functionality.

For example:

```toml
[documentation]
pages = ["docs/Overview.md"]
menu = "Help/API/omni.kit.documentation.builder"
title = "Omni UI Documentation Builder"
```

Documentation pages may contain code blocks with omni.ui calls that will be executed and displayed inline, by using
the "execute" language tag after three backticks:

````{code-block} markdown
---
dedent: 4
---
    ```execute
    import omni.ui as ui
    ui.Label("Hello World!")
    ```
````

## generate_for_sphinx

omni.kit.documentation.builder.generate_for_sphinx can be called to generate documentation offline for sphinx web pages:

```python
import omni.kit.app
import omni.kit.documentation.builder as builder
manager = omni.kit.app.get_app().get_extension_manager()
all_exts = manager.get_extensions()
for ext in all_exts:
    if ext.get("enabled", False):
        builder.generate_for_sphinx(ext.get("id", ""), f"/docs/{ext.get('name')}")
```

## create_docs_window

Explicity create a documentation window with the omni.kit.documentation.builder.create_docs_window function:

```python
import omni.kit.documentation.builder as builder
builder.create_docs_window("omni.kit.documentation.builder")
```
