docs: reframe feature guides and mark experimental surfaces (#1760)
* docs: reframe feature guides and mark experimental surfaces * fix: tighten task demo framing * fix: validate experimental page status * docs: anchor experimental office status * fix(ci): isolate Wrangler preview install * docs: complete focused camera example * fix(ci): use valid Wrangler package name
This commit is contained in:
@@ -803,6 +803,14 @@ function assertFrontmatter(file, markdown) {
|
||||
`${file} must start with YAML frontmatter containing title and description`,
|
||||
);
|
||||
}
|
||||
|
||||
const statusMatch = block.match(/^status:\s*(.*?)\s*$/m);
|
||||
if (statusMatch) {
|
||||
const status = statusMatch[1].replace(/^(["'])(.*)\1$/, "$2");
|
||||
if (status !== "experimental") {
|
||||
throw new Error(`${file} has unsupported page status: ${status}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -291,6 +291,37 @@ description: y
|
||||
await assert.doesNotReject(validatePublicDocs(dir));
|
||||
});
|
||||
|
||||
test("rejects unsupported page status frontmatter", async () => {
|
||||
const dir = await createDocs(
|
||||
{
|
||||
"index.md": validPage.replace(
|
||||
'description: "Start using Kandev."',
|
||||
'description: "Start using Kandev."\nstatus: beta',
|
||||
),
|
||||
},
|
||||
{ pages: ["index"] },
|
||||
);
|
||||
|
||||
await assert.rejects(
|
||||
validatePublicDocs(dir),
|
||||
/index.md has unsupported page status: beta/,
|
||||
);
|
||||
});
|
||||
|
||||
test("accepts experimental page status frontmatter", async () => {
|
||||
const dir = await createDocs(
|
||||
{
|
||||
"index.md": validPage.replace(
|
||||
'description: "Start using Kandev."',
|
||||
'description: "Start using Kandev."\nstatus: experimental',
|
||||
),
|
||||
},
|
||||
{ pages: ["index"] },
|
||||
);
|
||||
|
||||
await assert.doesNotReject(validatePublicDocs(dir));
|
||||
});
|
||||
|
||||
test("rejects published pages without title and description frontmatter", async () => {
|
||||
const dir = await createDocs(
|
||||
{ "index.md": "# Kandev\n" },
|
||||
|
||||
Reference in New Issue
Block a user