Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions docs/embedding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Embedding Unraid Docs

Use the following guidance when loading the Unraid documentation inside an iframe-driven experience. Query parameters cover the most common configuration options, and an optional `postMessage` API is available for hosts that need dynamic coordination.

## Required Query Parameters

- `embed=1` — Opts the page into iframe-specific presentation tweaks (hides the global navbar, footer, etc.). Include this on every embedded URL.

## Optional Query Parameters

- `theme=<light|dark>` — Forces the initial Docs theme. The value is persisted for the iframe session so reloads stay consistent.
- `entry=<path>` — Marks the logical entry point for the iframe session. Supply an absolute docs path (e.g. `/unraid-os/...`) or a full docs URL; the embedded UI shows a floating back icon that returns visitors to this path and hides itself while you remain on it. Defaults to the first loaded URL if omitted.
- `sidebar=1` — Re-enables the documentation sidebar and table of contents, which are hidden by default in embedded mode.

## Session Storage Keys

The iframe experience uses `window.sessionStorage` to remember state while a browser tab stays open. Host applications normally do not need to interact with these keys, but they are listed here for completeness.

| Key | Purpose |
| --- | --- |
| `unraidDocsIframe` | Tracks whether the current session originated inside an iframe. |
| `unraidDocsTheme` | Stores the last used Docs theme so reloads stay consistent. |
| `unraidDocsIframeEntry` | Holds the iframe entry path for the fallback back button. |
| `unraidDocsIframeSidebar` | Marks whether the sidebar was explicitly enabled. |

A host can clear these keys to reset the embedded state before opening a new iframe session.

## Example URL Builders

```js
function buildDocsUrl(path, { theme, entry, sidebar } = {}) {
const url = new URL(path, "https://docs.unraid.net");
url.searchParams.set("embed", "1");

if (theme === "light" || theme === "dark") {
url.searchParams.set("theme", theme);
}

if (entry) {
url.searchParams.set("entry", entry);
}

if (sidebar) {
url.searchParams.set("sidebar", "1");
}

return url.toString();
}
```

## Recommended Host Flow

1. Decide which route should serve as the iframe entry point and supply it via `entry` when loading the iframe.
2. Pass the current host theme if you want the Docs theme to match immediately.
3. Toggle `sidebar=1` only when the host layout can accommodate the wider viewport required for the sidebar.
4. When tearing down an iframe session, optionally clear the session-storage keys to remove residual state before launching a new session in the same tab.

## Messaging API

The embedded docs surface a lightweight `postMessage` API that reports readiness, navigation, and theme changes using structured message types. All messages share the shape `{ source: "unraid-docs", type: string, ...payload }` so hosts can quickly filter for docs-specific traffic.

### Messages emitted from the iframe

| Type | Payload | Purpose |
| --- | --- | --- |
| `unraid-docs:ready` | `{ theme: "light" \| "dark" }` | Fired once the iframe has applied its starting theme. |
| `unraid-docs:theme-change` | `{ theme: "light" \| "dark" }` | Fired whenever the iframe theme changes (including the initial emission). |
| `unraid-docs:navigation` | `{ pathname, search, hash, url }` | Fired whenever in-iframe navigation occurs. |

### Commands accepted by the iframe

| Type | Payload | Purpose |
| --- | --- | --- |
| `unraid-docs:set-theme` | `{ theme: "light" \| "dark" }` | Requests a theme change without requiring a reload. |

Example host handler:

```js
window.addEventListener('message', (event) => {
const data = event.data;
if (!data || data.source !== 'unraid-docs') {
return;
}

if (data.type === 'unraid-docs:theme-change') {
console.log('Docs theme changed to', data.theme);
}
});

function setIframeTheme(frame, theme) {
if (!frame.contentWindow) {
return;
}

frame.contentWindow.postMessage({
source: 'unraid-docs',
type: 'unraid-docs:set-theme',
theme,
}, '*');
}
```

Refer to `iframe-test.html` for a working example that exercises both outgoing and incoming messages.

### Legacy compatibility

For backwards compatibility the iframe still listens for `{ type: "theme-update", theme }` and continues to emit the historical `theme-ready` and `theme-changed` messages alongside the new message types. Hosts should migrate to the structured `unraid-docs:*` contract because the legacy events will be removed in a future release. The example test page also demonstrates how to broadcast both message formats during the transition period.
28 changes: 14 additions & 14 deletions docs/unraid-os/release-notes/7.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,19 @@ Login to the Unraid webGUI using Single Sign‑On (SSO) with your Unraid.net acc
### Linux kernel

- version 6.12.47-Unraid \[-beta.3]
- built-in: CONFIG_EFIVAR_FS: EFI Variable filesystem
- CONFIG_INTEL_RAPL: Intel RAPL support via MSR interface
- built-in: CONFIG\_EFIVAR\_FS: EFI Variable filesystem
- CONFIG\_INTEL\_RAPL: Intel RAPL support via MSR interface
- Added eMMC support: \[-beta.3]
- CONFIG_MMC: MMC/SD/SDIO card support
- CONFIG_MMC_BLOCK: MMC block device driver
- CONFIG_MMC_SDHCI: Secure Digital Host Controller Interface support
- CONFIG_MMC_SDHCI_PCI: SDHCI support on PCI bus
- CONFIG_MMC_SDHCI_ACPI: SDHCI support for ACPI enumerated SDHCI controllers
- CONFIG_MMC_SDHCI_PLTFM: SDHCI platform and OF driver helper
- CONFIG\_MMC: MMC/SD/SDIO card support
- CONFIG\_MMC\_BLOCK: MMC block device driver
- CONFIG\_MMC\_SDHCI: Secure Digital Host Controller Interface support
- CONFIG\_MMC\_SDHCI\_PCI: SDHCI support on PCI bus
- CONFIG\_MMC\_SDHCI\_ACPI: SDHCI support for ACPI enumerated SDHCI controllers
- CONFIG\_MMC\_SDHCI\_PLTFM: SDHCI platform and OF driver helper

### Base distro updates

- aaa_glibc-solibs: version 2.42
- aaa\_glibc-solibs: version 2.42
- adwaita-icon-theme: version 48.1
- at-spi2-core: version 2.56.4
- bash: version 5.3.003
Expand Down Expand Up @@ -218,7 +218,7 @@ Login to the Unraid webGUI using Single Sign‑On (SSO) with your Unraid.net acc
- iputils: version 20250605
- iw: version 6.17
- kbd: version 2.8.0
- kernel-firmware: version 20250909_4573c02
- kernel-firmware: version 20250909\_4573c02
- krb5: version 1.22
- less: version 679
- libXfixes: version 6.0.2
Expand All @@ -245,7 +245,7 @@ Login to the Unraid webGUI using Single Sign‑On (SSO) with your Unraid.net acc
- mcelog: version 206
- mesa: version 25.2.2
- nano: version 8.6
- ncurses: version 6.5_20250816
- ncurses: version 6.5\_20250816
- nettle: version 3.10.2
- nghttp2: version 1.67.0
- nghttp3: version 1.11.0
Expand All @@ -259,9 +259,9 @@ Login to the Unraid webGUI using Single Sign‑On (SSO) with your Unraid.net acc
- pango: version 1.56.4
- pciutils: version 3.14.0
- perl: version 5.42.0
- php: version 8.3.21-x86_64-1_LT with gettext extension
- php: version 8.3.21-x86\_64-1\_LT with gettext extension
- pixman: version 0.46.4
- rclone: version 1.70.1-x86_64-1_SBo_LT.tgz
- rclone: version 1.70.1-x86\_64-1\_SBo\_LT.tgz
- readline: version 8.3.001
- samba: version 4.22.2
- shadow: version 4.18.0
Expand All @@ -284,4 +284,4 @@ Login to the Unraid webGUI using Single Sign‑On (SSO) with your Unraid.net acc
- xkeyboard-config: version 2.45
- xorg-server: version 21.1.18
- xterm: version 402
- zfs: version zfs-2.3.4_6.12.47_Unraid-x86_64-2_LT
- zfs: version zfs-2.3.4\_6.12.47\_Unraid-x86\_64-2\_LT
Loading