Skip to content

Commit 99baf47

Browse files
jsundaiDuncanma
andauthored
add links to explainer series vids (#5007)
Co-authored-by: Duncan Mackenzie <duncanma@duncanmackenzie.net>
1 parent a88c7ca commit 99baf47

6 files changed

Lines changed: 129 additions & 0 deletions

File tree

MARKDOWN_PIPELINE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Each component maps to a strategy in `COMPONENT_REGISTRY` (in `scripts/mdx-to-md
109109
| `SdkTabs` / `SdkTabs.<Lang>` | `sdk-tabs` | Same, with language labels (`DotNet`**.NET**) |
110110
| `CodeSnippet` | `code-snippet` | Fenced code block using the `language` prop |
111111
| `CaptionedImage`, `EnlargeImage`, `Components.CaptionedImage` | `captioned-image` | `![alt or caption or title](src)` |
112+
| YouTube/`<iframe>` embeds (often in a styled `<div>`) | strip | Removed; keep a markdown Watch link in surrounding tip/prose for LLMs |
112113
| `PhotoCarousel` | `photo-carousel` | One `![caption](url)` per entry in the `images`/`captions` arrays |
113114
| `CallToAction` | `call-to-action` | `- [h3 title](href): p description` |
114115
| `ReleaseNoteHeader` | `release-note-header` | `> **Public Preview** — Go, Java…` availability note + body blockquote. The self-closing form (`<ReleaseNoteHeader … />`) emits just the note and leaves the page body intact. |

docs/encyclopedia/activities/activities.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ This guide provides a comprehensive overview of Temporal Activities including
2121
[Activity Definition](/activity-definition), [Activity Type](/activity-definition#activity-type),
2222
[Activity Execution](/activity-execution), [Local Activity](/local-activity), and [Standalone Activity](/standalone-activity).
2323

24+
:::tip
25+
26+
Watch [What is an Activity in Temporal?](https://www.youtube.com/watch?v=rtWrzjnKlSQ) for a short overview.
27+
28+
<div style={{ display: 'flex', justifyContent: 'center' }}>
29+
<iframe
30+
width="560"
31+
height="315"
32+
src="https://www.youtube.com/embed/rtWrzjnKlSQ"
33+
title="What is an Activity in Temporal?"
34+
frameBorder="0"
35+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
36+
referrerPolicy="strict-origin-when-cross-origin"
37+
allowFullScreen
38+
></iframe>
39+
</div>
40+
41+
:::
42+
2443
An Activity is a normal function or method that executes a single, well-defined action (either short or long running),
2544
such as calling another service, transcoding a media file, or sending an email message. Activity code can be
2645
non-deterministic. We recommend that it be [idempotent](/activity-definition#idempotency).

docs/encyclopedia/temporal.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,25 @@ If a failure occurs, the Workflow Execution can resume from the last recorded ev
3939

4040
## What is the Temporal Platform? {/* #temporal-platform */}
4141

42+
:::tip
43+
44+
Watch [What is the Temporal Platform?](https://www.youtube.com/watch?v=EwweiH2rd7M) for a short overview.
45+
46+
<div style={{ display: 'flex', justifyContent: 'center' }}>
47+
<iframe
48+
width="560"
49+
height="315"
50+
src="https://www.youtube.com/embed/EwweiH2rd7M"
51+
title="What is the Temporal Platform?"
52+
frameBorder="0"
53+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
54+
referrerPolicy="strict-origin-when-cross-origin"
55+
allowFullScreen
56+
></iframe>
57+
</div>
58+
59+
:::
60+
4261
The Temporal Platform consists of supervising software called the [Temporal Service](/temporal-service) and application code bundled as [Worker Processes](/workers#worker-process).
4362
Together these components create a runtime for your [Temporal Application](/temporal#temporal-application).
4463

docs/encyclopedia/workflow/workflow-overview.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ This guide provides a comprehensive overview of Temporal Workflows and covers th
2323

2424
## Intro to Workflows
2525

26+
:::tip
27+
28+
Watch [What Is a Workflow in Temporal?](https://www.youtube.com/watch?v=zLjhNrOKphE) for a short overview.
29+
30+
<div style={{ display: 'flex', justifyContent: 'center' }}>
31+
<iframe
32+
width="560"
33+
height="315"
34+
src="https://www.youtube.com/embed/zLjhNrOKphE"
35+
title="What Is a Workflow in Temporal?"
36+
frameBorder="0"
37+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
38+
referrerPolicy="strict-origin-when-cross-origin"
39+
allowFullScreen
40+
></iframe>
41+
</div>
42+
43+
:::
44+
2645
Conceptually, a workflow defines a sequence of steps. With Temporal, those steps are defined by writing code, known as a Workflow Definition, and are carried out by running that code, which results in a Workflow Execution.
2746

2847
In day-to-day conversations, the term Workflow might refer to Workflow Type, a Workflow Definition, or a Workflow Execution.

scripts/mdx-to-md.mjs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* - <SetupSteps>/<SetupStep> → prose children + code from the `code={}` prop
2424
* - <ZoomPanPinch> → transparent wrapper, pass inner content
2525
* - <ViewSourceCodeNotice href> → plain markdown link line
26+
* - YouTube/HTML embeds → stripped (keep a markdown Watch link in prose for LLMs)
2627
* - imported .md components → transcluded inline (e.g. <AWSRegions />)
2728
* - import / export stmts → stripped
2829
* - {/* MDX comments *​/} → stripped
@@ -447,6 +448,36 @@ const State = {
447448
SETUP_STEP: "SETUP_STEP",
448449
};
449450

451+
/**
452+
* If `lines[i]` starts an HTML/JSX video embed (`<iframe>` or styled `<div>`
453+
* wrapping one), return the inclusive end index of the block. Otherwise null.
454+
* Authors should keep a markdown Watch link in surrounding prose for LLMs.
455+
*/
456+
export function findHtmlEmbedEnd(lines, i) {
457+
const trimmed = (lines[i] || "").trim();
458+
if (/^<iframe\b/i.test(trimmed)) {
459+
let j = i;
460+
while (j < lines.length) {
461+
if (/<\/iframe>/i.test(lines[j]) || /\/>\s*$/.test(lines[j].trim())) {
462+
return j;
463+
}
464+
j++;
465+
}
466+
return i;
467+
}
468+
if (/^<div\b/i.test(trimmed) && /style=\{/.test(trimmed)) {
469+
let depth = 0;
470+
for (let j = i; j < lines.length; j++) {
471+
if (/<div\b/i.test(lines[j])) depth++;
472+
if (/<\/div>/i.test(lines[j])) {
473+
depth--;
474+
if (depth === 0) return j;
475+
}
476+
}
477+
}
478+
return null;
479+
}
480+
450481
/**
451482
* Main transform function.
452483
* @param {string} mdxContent - raw MDX file content
@@ -876,6 +907,12 @@ export function transformMdx(mdxContent, options = {}) {
876907
admonitionLines = [];
877908
admonitionType = null;
878909
} else {
910+
// Drop YouTube/HTML embeds inside tips; keep the markdown Watch link.
911+
const embedEnd = findHtmlEmbedEnd(lines, i);
912+
if (embedEnd !== null) {
913+
i = embedEnd;
914+
continue;
915+
}
879916
admonitionLines.push(line);
880917
}
881918
continue;
@@ -1098,6 +1135,15 @@ export function transformMdx(mdxContent, options = {}) {
10981135
continue;
10991136
}
11001137

1138+
// --- HTML/JSX video embeds (YouTube iframes) — strip; keep prose links ---
1139+
if (state === State.NORMAL) {
1140+
const embedEnd = findHtmlEmbedEnd(lines, i);
1141+
if (embedEnd !== null) {
1142+
i = embedEnd;
1143+
continue;
1144+
}
1145+
}
1146+
11011147
// --- Image components (self-closing, may span lines) ---
11021148
// <CaptionedImage|EnlargeImage|Components.CaptionedImage
11031149
// src="..." alt|caption|title="..." /> → ![text](src)

tests/test-mdx-to-md.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,31 @@ test("CaptionedImage uses caption/title when no alt", () => {
565565
assertContains(markdown, "![Persistence](/diagrams/x.svg)");
566566
});
567567

568+
test("YouTube iframe embeds are stripped; Watch links kept", () => {
569+
const input = `:::tip
570+
571+
Watch [What Is a Workflow in Temporal?](https://www.youtube.com/watch?v=zLjhNrOKphE) for a short overview.
572+
573+
<div style={{ display: 'flex', justifyContent: 'center' }}>
574+
<iframe
575+
width="560"
576+
height="315"
577+
src="https://www.youtube.com/embed/zLjhNrOKphE"
578+
title="What Is a Workflow in Temporal?"
579+
frameBorder="0"
580+
allowFullScreen
581+
></iframe>
582+
</div>
583+
584+
:::
585+
`;
586+
const { markdown } = transformMdx(input);
587+
assertContains(markdown, "[What Is a Workflow in Temporal?](https://www.youtube.com/watch?v=zLjhNrOKphE)");
588+
assertNotContains(markdown, "iframe");
589+
assertNotContains(markdown, "youtube.com/embed");
590+
assertNotContains(markdown, "<div");
591+
});
592+
568593
test("PhotoCarousel emits one image per entry with captions", () => {
569594
const input = `<PhotoCarousel\n images={[\n 'https://x/a.jpeg',\n 'https://x/b.jpeg',\n ]}\n captions={[\n 'First',\n 'Second',\n ]}\n/>`;
570595
const { markdown } = transformMdx(input);

0 commit comments

Comments
 (0)