Skip to content

Commit 2d7953b

Browse files
docs: add iframe embed section for external sites to rich media page (#5613)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent d710ea8 commit 2d7953b

5 files changed

Lines changed: 107 additions & 36 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Keep prose dry and direct. State requirements and behavior plainly.
2323

2424
Internal links between documentation pages use **URL paths built from the YAML config**, not file paths on disk or relative paths.
2525

26+
**Before writing any internal link, open the target product's `docs.yml` and walk from the product slug down to the page.** Directory paths on disk are not a reliable hint — folders can be absent from the URL, and section slugs frequently differ from folder names.
27+
2628
### URL format
2729

2830
```
@@ -74,9 +76,13 @@ The correct link is:
7476
<!-- WRONG: guessed URL from file path (section slug differs from folder name) -->
7577
[LLMs.txt](/learn/docs/ai/llms-txt)
7678
79+
<!-- WRONG: includes folder segments that aren't part of any docs.yml section -->
80+
[Rich media](/learn/docs/component-library/writing-content/markdown-media)
81+
7782
<!-- CORRECT: URL from YAML config -->
7883
[Overview](/learn/docs/getting-started/overview)
7984
[LLMs.txt](/learn/docs/ai-features/llms-txt)
85+
[Rich media](/learn/docs/writing-content/markdown-media)
8086
```
8187

8288
### Steps to construct a link

fern/products/docs/pages/component-library/writing-content/markdown-media.mdx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Embed PDFs using the `<iframe>` element. Don't use the `<embed>` element, as it
5757
<Tab title="Rendered PDF">
5858
<iframe src="../default-components/all-about-ferns.pdf" width="100%" height="500px" style={{ border: 'none', borderRadius: '0.5rem' }} />
5959
</Tab>
60-
<Tab title="HTML">
60+
<Tab title="PDF syntax">
6161
```html
6262
<iframe src="../default-components/all-about-ferns.pdf" width="100%" height="500px" style={{ border: 'none', borderRadius: '0.5rem' }} />
6363
```
@@ -85,7 +85,7 @@ You can embed videos in your documentation using the HTML `<video>` tag. This gi
8585
>
8686
</video>
8787
</Tab>
88-
<Tab title="HTML">
88+
<Tab title="Video syntax">
8989
```html
9090
<video
9191
src="path/to/your/video.mp4"
@@ -173,6 +173,33 @@ You can embed videos from YouTube, Loom, Vimeo, and other streaming platforms us
173173

174174
See an example of [how it renders](https://elevenlabs.io/docs/conversational-ai/guides/integrations/zendesk#demo-video) on the corresponding docs page from the ElevenLabs documentation.
175175

176+
## External sites
177+
178+
You can embed any external web page in your documentation using an `<iframe>`.
179+
180+
<Info>
181+
If the target site sets headers like `X-Frame-Options` or a restrictive `Content-Security-Policy`, the browser blocks the embed. Verify that the site you want to embed allows being framed.
182+
</Info>
183+
184+
<Tabs>
185+
<Tab title="Rendered external site">
186+
<iframe
187+
src="https://en.wikipedia.org/wiki/Fern"
188+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
189+
></iframe>
190+
</Tab>
191+
<Tab title="External site syntax">
192+
```mdx
193+
<iframe
194+
src="https://en.wikipedia.org/wiki/Fern"
195+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
196+
/>
197+
```
198+
</Tab>
199+
</Tabs>
200+
201+
When [embedding a Fern Docs site](/learn/docs/customization/embedded-mode) inside another application, append `?embedded=true` to the URL to hide the header and footer.
202+
176203
## LaTeX
177204

178205
Fern supports [LaTeX](https://www.latex-project.org/) math equations. To use LaTeX, wrap your inline math equations in `$`. For example, `$(x^2 + y^2 = z^2)$` will render $x^2 + y^2 = z^2$.
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
---
22
title: Embedded mode
3-
subtitle: Hide the header and footer when embedding docs in iframes or dashboards
3+
description: Hide the header and footer when embedding docs in iframes or dashboards
44
---
55

6+
Embedded mode strips the header and footer (including navigation and logo) from a Fern Docs site so a page renders as content only. Use it to:
67

7-
Embedded mode removes the header and footer from your documentation pages, making them suitable for embedding in iframes, dashboards, or other contexts where you want to display only the content.
8+
- Surface docs inside a product dashboard or admin panel
9+
- Embed a page in an iframe without the standard navigation chrome
10+
- Render content-only views in another application
811

912
## Enable embedded mode
1013

11-
Add the `embedded=true` query parameter to any documentation URL:
14+
Add the `embedded=true` query parameter to the URL:
1215

13-
```
14-
https://docs.example.com/getting-started?embedded=true
15-
```
16-
17-
When enabled, the header (including navigation and logo) and footer are hidden, and the main content area adjusts to fill the available space.
16+
<Frame>
17+
<iframe
18+
src="https://elevenlabs.io/docs/overview/intro?embedded=true"
19+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
20+
></iframe>
21+
</Frame>
1822

19-
## Persistence
20-
21-
Once embedded mode is activated, it persists across navigation events within the same session. Users can navigate between pages without needing to add the query parameter to each URL.
23+
```jsx HTML
24+
<iframe
25+
src="https://elevenlabs.io/docs/overview/intro?embedded=true"
26+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
27+
></iframe>
28+
```
2229

23-
## Use cases
30+
Embedded mode persists across navigation within a session, so internal links keep it active without the query string on every URL.
2431

25-
Embedded mode is useful when you want to:
32+
## Embed external pages
2633

27-
- Display documentation within a product dashboard or admin panel
28-
- Create a seamless experience when embedding docs in an iframe
29-
- Show documentation content without the standard navigation chrome
34+
[Embedding external pages in your docs](/learn/docs/writing-content/markdown-media#embed-external-sites) uses the same `<iframe>` syntax, without `?embedded=true`.

fern/translations/zh/products/docs/pages/component-library/writing-content/markdown-media.mdx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ sidebar-title: Markdown 中的富媒体
5757
<Tab title="渲染的 PDF">
5858
<iframe src="../default-components/all-about-ferns.pdf" width="100%" height="500px" style={{ border: 'none', borderRadius: '0.5rem' }} />
5959
</Tab>
60-
<Tab title="HTML">
60+
<Tab title="PDF 语法">
6161
```html
6262
<iframe src="../default-components/all-about-ferns.pdf" width="100%" height="500px" style={{ border: 'none', borderRadius: '0.5rem' }} />
6363
```
@@ -85,7 +85,7 @@ sidebar-title: Markdown 中的富媒体
8585
>
8686
</video>
8787
</Tab>
88-
<Tab title="HTML">
88+
<Tab title="视频语法">
8989
```html
9090
<video
9191
src="path/to/your/video.mp4"
@@ -173,6 +173,33 @@ sidebar-title: Markdown 中的富媒体
173173

174174
请参阅 ElevenLabs 文档中相应文档页面上[渲染效果](https://elevenlabs.io/docs/conversational-ai/guides/integrations/zendesk#demo-video)的示例。
175175

176+
## 外部网站
177+
178+
您可以使用 `<iframe>` 在文档中嵌入任何外部网页。
179+
180+
<Info>
181+
如果目标站点设置了 `X-Frame-Options` 或限制性的 `Content-Security-Policy` 等响应头,浏览器将阻止嵌入。请验证您要嵌入的站点是否允许被框架嵌入。
182+
</Info>
183+
184+
<Tabs>
185+
<Tab title="渲染的外部网站">
186+
<iframe
187+
src="https://en.wikipedia.org/wiki/Fern"
188+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
189+
></iframe>
190+
</Tab>
191+
<Tab title="外部网站语法">
192+
```mdx
193+
<iframe
194+
src="https://en.wikipedia.org/wiki/Fern"
195+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
196+
/>
197+
```
198+
</Tab>
199+
</Tabs>
200+
201+
[嵌入 Fern 文档站点](/learn/docs/customization/embedded-mode)到其他应用程序时,请在 URL 后追加 `?embedded=true` 以隐藏页头和页脚。
202+
176203
## LaTeX
177204

178205
Fern 支持 [LaTeX](https://www.latex-project.org/) 数学方程式。要使用 LaTeX,请将您的内联数学方程式用 `$` 包围。例如,`$(x^2 + y^2 = z^2)$` 将渲染为 $x^2 + y^2 = z^2$。
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
---
22
title: 嵌入模式
3-
subtitle: 在 iframe 或仪表板中嵌入文档时隐藏页头和页脚
3+
description: 在 iframe 或仪表板中嵌入文档时隐藏页头和页脚
44
sidebar-title: 嵌入模式
55
---
66

7-
嵌入模式会从文档页面中移除页头和页脚,使其适合嵌入到 iframe、仪表板或其他只想显示内容的环境中。
7+
嵌入模式会从 Fern 文档站点中移除页头和页脚(包括导航和标志),使页面仅渲染内容。使用场景:
88

9-
## 启用嵌入模式
10-
11-
在任何文档 URL 中添加 `embedded=true` 查询参数:
9+
- 在产品仪表板或管理面板中呈现文档
10+
- 在 iframe 中嵌入页面,不带标准导航框架
11+
- 在其他应用程序中渲染仅内容视图
1212

13-
```
14-
https://docs.example.com/getting-started?embedded=true
15-
```
13+
## 启用嵌入模式
1614

17-
启用时,页头(包括导航和标志)和页脚将被隐藏,主要内容区域会调整以填充可用空间。
15+
在 URL 中添加 `embedded=true` 查询参数:
1816

19-
## 持久性
17+
<Frame>
18+
<iframe
19+
src="https://elevenlabs.io/docs/overview/intro?embedded=true"
20+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
21+
></iframe>
22+
</Frame>
2023

21-
一旦激活嵌入模式,它会在同一会话的导航事件中保持持久。用户可以在页面之间导航,无需在每个 URL 中添加查询参数。
24+
```jsx HTML
25+
<iframe
26+
src="https://elevenlabs.io/docs/overview/intro?embedded=true"
27+
style="width: 100%; height: 500px; border: none; border-radius: 8px;"
28+
></iframe>
29+
```
2230

23-
## 使用场景
31+
嵌入模式在同一会话的导航中保持激活状态,因此内部链接无需在每个 URL 中带查询字符串即可保持启用。
2432

25-
嵌入模式在以下情况下很有用:
33+
## 嵌入外部页面
2634

27-
- 在产品仪表板或管理面板中显示文档
28-
- 在 iframe 中嵌入文档时创建无缝体验
29-
- 显示文档内容而不显示标准导航框架
35+
[在文档中嵌入外部页面](/learn/docs/writing-content/markdown-media#embed-external-sites)使用相同的 `<iframe>` 语法,但不需要 `?embedded=true`

0 commit comments

Comments
 (0)