Skip to content

Commit 9859127

Browse files
committed
feat: add docs for NamedReq
1 parent bdc0e21 commit 9859127

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

src/content/docs/development/guide/component-docs-for-llm.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,26 @@ import { CppHeader } from "@components/header";
288288

289289
Base component for `CHeader` and `CppHeader`. Not used directly.
290290

291+
### NamedReq
292+
293+
The `NamedReq` component renders an inline link to a named requirement.
294+
295+
#### Props
296+
297+
- `name` (required): The name of the requirement.
298+
- `bold` (optional): If `true`, the text renders bold.
299+
- `displayName` (optional): Custom display text.
300+
- `nolink` (optional): If `true`, renders as plain text without a link.
301+
302+
#### Usage
303+
304+
305+
import NamedReq from "@components/NamedReq.astro"
306+
307+
A <NamedReq name="FunctionObject" /> type is the type of an object
308+
that can be used on the left of the function call operator.
309+
310+
291311
## Feature Test Macros
292312

293313
### FeatureTestMacro

src/content/docs/development/guide/doc-everything.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import DocLink from "@components/DocLink.astro";
1313
import { DR, DRList } from "@components/defect-report";
1414
import { FeatureTestMacro, FeatureTestMacroValue } from "@components/feature-test-macro";
1515
import Missing from "@components/Missing.astro";
16+
import NamedReq from "@components/NamedReq.astro"
1617
import { ParamDoc, ParamDocList } from "@components/param-doc";
1718
import { RevisionBlock } from "@components/revision";
1819

@@ -384,6 +385,40 @@ Entities in it can be used in a C++ program by including the header
384385
If documentation for the specified header does not exist yet, the `CHeader` and the `CppHeader` component will render the header name as plain text without a link.
385386
</Aside>
386387

388+
### Link to Named Requirement
389+
390+
The `NamedReq` component renders an inline link to the documentation page of a named requirement.
391+
392+
```mdx
393+
import NamedReq from "@components/NamedReq.astro";
394+
395+
A <NamedReq name="FunctionObject" /> type is the type of an object
396+
that can be used on the left of the function call operator.
397+
```
398+
399+
<Card title="Preview">
400+
A <NamedReq name="FunctionObject" /> type is the type of an object
401+
that can be used on the left of the function call operator.
402+
</Card>
403+
404+
You can set the `bold` attribute to `true`, to make the requirement name appear in bold.
405+
406+
```mdx
407+
import NamedReq from "@components/NamedReq.astro";
408+
409+
A <NamedReq name="FunctionObject" bold /> type is the type of an object
410+
that can be used on the left of the function call operator.
411+
```
412+
413+
<Card title="Preview">
414+
A <NamedReq name="FunctionObject" bold /> type is the type of an object
415+
that can be used on the left of the function call operator.
416+
</Card>
417+
418+
<Aside type="tip">
419+
If documentation for the specified named requirement does not exist yet, the `NamedReq` component will render the requirement name as plain text without a link.
420+
</Aside>
421+
387422
## Feature Test Macros
388423

389424
The `FeatureTestMacro` component renders to a box that shows information about a feature test macro.

0 commit comments

Comments
 (0)