diff --git a/astro.config.mjs b/astro.config.mjs index 103fef52..0f47e9fb 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,7 +10,7 @@ import starlightHeadingBadges from "starlight-heading-badges"; export default defineConfig({ site: process.env.CPPDOC_SITE, base: process.env.CPPDOC_BASE, - trailingSlash: "never", + trailingSlash: "always", integrations: [ starlight({ title: "CppDoc", diff --git a/src/components/DocLink.astro b/src/components/DocLink.astro index 29e316c1..63ef626a 100644 --- a/src/components/DocLink.astro +++ b/src/components/DocLink.astro @@ -1,25 +1,24 @@ --- -import { getLinkToKey } from "../lib/doc-index"; +import { isLinkMissing, normalizeLink } from "../lib/doc-link"; interface Props { - src: string; + dest: string; section?: string; } -const { src, section } = Astro.props; -const rawLink = await getLinkToKey(src); +const { dest, section } = Astro.props; -const missing = rawLink === undefined; -const link = rawLink ? rawLink + (section ? "#" + section : "") : ""; +const missing = await isLinkMissing(dest); +const link = normalizeLink(dest) + (section ? "#" + section : ""); --- { missing ? ( - + ) : ( - + ) diff --git a/src/components/NamedReq.astro b/src/components/NamedReq.astro index d728fab5..b30084be 100644 --- a/src/components/NamedReq.astro +++ b/src/components/NamedReq.astro @@ -9,12 +9,12 @@ interface Props { } const { name, bold, displayName, nolink } = Astro.props; -const src = `/cpp/named_req/${name}`; +const dest = `/cpp/named_req/${name}`; const text = displayName ?? name; const As = nolink ? Fragment : DocLink; -const asProps = nolink ? {} : { src }; +const asProps = nolink ? {} : { dest }; --- diff --git a/src/components/header/Header.astro b/src/components/header/Header.astro index 23bbe207..1f46b4a8 100644 --- a/src/components/header/Header.astro +++ b/src/components/header/Header.astro @@ -11,13 +11,13 @@ export interface Props { const { lang, name, displayName, nolink } = Astro.props; const langPrefix = lang == "C" ? "/c" : "/cpp"; -const src = `${langPrefix}/library/headers/${name}`; +const dest = `${langPrefix}/library/headers/${name}`; const extension = lang === "C" ? ".h" : ""; const text = displayName ?? `<${name}${extension}>`; const As = nolink ? Fragment : DocLink; -const asProps = nolink ? {} : { src }; +const asProps = nolink ? {} : { dest }; --- diff --git a/src/content/docs/c/comment.mdx b/src/content/docs/c/comment.mdx index e18b4062..8813d599 100644 --- a/src/content/docs/c/comment.mdx +++ b/src/content/docs/c/comment.mdx @@ -14,13 +14,13 @@ Comments serve as a sort of in-code documentation. When inserted into a program, 1) Often known as "C-style" or "multi-line" comments. 2) Often known as "C++-style" or "single-line" comments. -All comments are removed from the program at translation phase 3 by replacing each comment with a single whitespace character. +All comments are removed from the program at translation phase 3 by replacing each comment with a single whitespace character. ### C-style C-style comments are usually used to comment large blocks of text or small fragments of code; however, they can be used to comment single lines. To insert text as a C-style comment, simply surround the text with `/*` and `*/`. C-style comments tell the compiler to ignore all content between `/*` and `*/`. Although it is not part of the C standard, `/**` and `**/` are often used to indicate documentation blocks; this is legal because the second asterisk is simply treated as part of the comment. -Except within a character constant, a string literal, or a comment, the characters `/*` introduce a comment. The contents of such a comment are examined only to identify multibyte characters and to find the characters `*/` that terminate the comment. C-style comments cannot be nested. +Except within a character constant, a string literal, or a comment, the characters `/*` introduce a comment. The contents of such a comment are examined only to identify multibyte characters and to find the characters `*/` that terminate the comment. C-style comments cannot be nested. @@ -28,7 +28,7 @@ Except within a character constant C++-style comments are usually used to comment single lines of text or code; however, they can be placed together to form multi-line comments. To insert text as a C++-style comment, simply precede the text with `//` and follow the text with the new line character. C++-style comments tell the compiler to ignore all content between `//` and a new line. -Except within a character constant, a string literal, or a comment, the characters `//` introduce a comment that includes all multibyte characters up to, but not including, the next new-line character. The contents of such a comment are examined only to identify multibyte characters and to find the new-line character that terminates the comment. C++-style comments can be nested: +Except within a character constant, a string literal, or a comment, the characters `//` introduce a comment that includes all multibyte characters up to, but not including, the next new-line character. The contents of such a comment are examined only to identify multibyte characters and to find the new-line character that terminates the comment. C++-style comments can be nested: ```c // y = f(x); // invoke algorithm @@ -53,7 +53,7 @@ A C++-style comment may appear within a C-style comment; this is a mechanism for ### Notes -Because comments are removed before the preprocessor stage, a macro cannot be used to form a comment and an unterminated C-style comment doesn't spill over from an #include'd file. +Because comments are removed before the preprocessor stage, a macro cannot be used to form a comment and an unterminated C-style comment doesn't spill over from an #include'd file. ```c /* An attempt to use a macro to form a comment. */ @@ -151,6 +151,6 @@ Hello, again - C++ documentation for Comments + C++ documentation for Comments diff --git a/src/content/docs/c/language/basic_concepts.mdx b/src/content/docs/c/language/basic_concepts.mdx index 2ead7b90..4e5f9b29 100644 --- a/src/content/docs/c/language/basic_concepts.mdx +++ b/src/content/docs/c/language/basic_concepts.mdx @@ -12,12 +12,12 @@ import DocLink from "@components/DocLink.astro"; This section provides definitions for the specific terminology and the concepts used when describing the C programming language. -A C program is a sequence of text files (typically header and source files) that contain declarations. They undergo translation to become an executable program, which is executed when the OS calls its main function (unless it is itself the OS or another *freestanding* program, in which case the entry point is implementation-defined). +A C program is a sequence of text files (typically header and source files) that contain declarations. They undergo translation to become an executable program, which is executed when the OS calls its main function (unless it is itself the OS or another *freestanding* program, in which case the entry point is implementation-defined). -Certain words in a C program have special meaning, they are keywords. Others can be used as identifiers, which may be used to identify objects, functions, struct, union, or enumeration tags, their members, typedef names, labels, or macros. +Certain words in a C program have special meaning, they are keywords. Others can be used as identifiers, which may be used to identify objects, functions, struct, union, or enumeration tags, their members, typedef names, labels, or macros. -Each identifier (other than macro) is only valid within a part of the program called its scope and belongs to one of four kinds of name spaces. Some identifiers have linkage which makes them refer to the same entities when they appear in different scopes or translation units. +Each identifier (other than macro) is only valid within a part of the program called its scope and belongs to one of four kinds of name spaces. Some identifiers have linkage which makes them refer to the same entities when they appear in different scopes or translation units. -Definitions of functions include sequences of statements and declarations, some of which include expressions, which specify the computations to be performed by the program. +Definitions of functions include sequences of statements and declarations, some of which include expressions, which specify the computations to be performed by the program. -Declarations and expressions create, destroy, access, and manipulate objects. Each object, function, and expression in C is associated with a type. +Declarations and expressions create, destroy, access, and manipulate objects. Each object, function, and expression in C is associated with a type. diff --git a/src/content/docs/cpp/keywords.mdx b/src/content/docs/cpp/keywords.mdx index dd6477b8..51647f8f 100644 --- a/src/content/docs/cpp/keywords.mdx +++ b/src/content/docs/cpp/keywords.mdx @@ -5,11 +5,11 @@ description: Auto‑generated from cppreference import { Desc, DescList, DocLink, Revision, RevisionBlock } from '@components/index'; -This is a list of reserved keywords in C++. Since they are used by the language, these keywords are not available for re-definition or overloading. As an exception, they are not considered reserved in attributes (excluding attribute argument lists). +This is a list of reserved keywords in C++. Since they are used by the language, these keywords are not available for re-definition or overloading. As an exception, they are not considered reserved in attributes (excluding attribute argument lists). | A – C | D – P | R – Z | | :---- | :---- | :---- | -| `alignas` (C++11)
`alignof` (C++11)
`and`
`and_eq`
`asm`
`atomic_cancel` (TM TS)
`atomic_commit` (TM TS)
`atomic_noexcept` (TM TS)
`auto` (1) (3) (4) (5)
`bitand`
`bitor`
`bool`
`break`
`case`
`catch`
`char`
`char8_t` (C++20)
`char16_t` (C++11)
`char32_t` (C++11)
`class` (1)
`compl`
`concept` (C++20)
`const`
`consteval` (C++20) (5)
`constexpr` (C++11) (3)
`constinit` (C++20)
`const_cast`
`continue`
`contract_assert` (C++26)
`co_await` (C++20)
`co_return` (C++20)
`co_yield` (C++20)
| `decltype` (C++11) (2)
`default` (1)
`delete` (1)
`do`
`double`
`dynamic_cast`
`else`
`enum` (1)
`explicit`
`export` (1) (4)
`extern` (1)
`false`
`float`
`for` (1)
`friend`
`goto`
`if` (3) (5)
`inline` (1) (3)
`int` (1)
`long`
`mutable` (1)
`namespace`
`new`
`noexcept` (C++11)
`not`
`not_eq`
`nullptr` (C++11)
`operator` (1)
`or`
`or_eq`
`private` (4)
`protected`
`public`
| `reflexpr` (reflection TS)
`register` (3)
`reinterpret_cast`
`requires` (C++20)
`return`
`short`
`signed`
`sizeof` (1)
`static`
`static_assert` (C++11)
`static_cast`
`struct` (1)
`switch`
`synchronized` (TM TS)
`template`
`this` (5)
`thread_local` (C++11)
`throw` (3) (4)
`true`
`try`
`typedef`
`typeid`
`typename` (3) (4)
`union`
`unsigned`
`using` (1) (4)
`virtual`
`void`
`volatile`
`wchar_t`
`while`
`xor`
`xor_eq` | +| `alignas` (C++11)
`alignof` (C++11)
`and`
`and_eq`
`asm`
`atomic_cancel` (TM TS)
`atomic_commit` (TM TS)
`atomic_noexcept` (TM TS)
`auto` (1) (3) (4) (5)
`bitand`
`bitor`
`bool`
`break`
`case`
`catch`
`char`
`char8_t` (C++20)
`char16_t` (C++11)
`char32_t` (C++11)
`class` (1)
`compl`
`concept` (C++20)
`const`
`consteval` (C++20) (5)
`constexpr` (C++11) (3)
`constinit` (C++20)
`const_cast`
`continue`
`contract_assert` (C++26)
`co_await` (C++20)
`co_return` (C++20)
`co_yield` (C++20)
| `decltype` (C++11) (2)
`default` (1)
`delete` (1)
`do`
`double`
`dynamic_cast`
`else`
`enum` (1)
`explicit`
`export` (1) (4)
`extern` (1)
`false`
`float`
`for` (1)
`friend`
`goto`
`if` (3) (5)
`inline` (1) (3)
`int` (1)
`long`
`mutable` (1)
`namespace`
`new`
`noexcept` (C++11)
`not`
`not_eq`
`nullptr` (C++11)
`operator` (1)
`or`
`or_eq`
`private` (4)
`protected`
`public`
| `reflexpr` (reflection TS)
`register` (3)
`reinterpret_cast`
`requires` (C++20)
`return`
`short`
`signed`
`sizeof` (1)
`static`
`static_assert` (C++11)
`static_cast`
`struct` (1)
`switch`
`synchronized` (TM TS)
`template`
`this` (5)
`thread_local` (C++11)
`throw` (3) (4)
`true`
`try`
`typedef`
`typeid`
`typename` (3) (4)
`union`
`unsigned`
`using` (1) (4)
`virtual`
`void`
`volatile`
`wchar_t`
`while`
`xor`
`xor_eq` | * (1) — meaning changed or new meaning added in C++11. * (2) — new meaning added in C++14. @@ -17,37 +17,37 @@ This is a list of reserved keywords in C++. Since they are used by the language, * (4) — meaning changed or new meaning added in C++20. * (5) — new meaning added in C++23. -Note that: `and`, `bitor`, `or`, `xor`, `compl`, `bitand`, `and_eq`, `or_eq`, `xor_eq`, `not` and `not_eq` (along with digraphs: `%`, `%<`, `<:`, `:>`, `%:`, `%:%:` and trigraphs: `??<`, `??>`, `??(`, `??)`, `??=`, `??/`, `??'`, `??!`, `??-`) provide an alternative way to represent standard tokens. These keywords are also considered reserved in attributes (excluding attribute argument lists), but some implementations handle them the same as the others. +Note that: `and`, `bitor`, `or`, `xor`, `compl`, `bitand`, `and_eq`, `or_eq`, `xor_eq`, `not` and `not_eq` (along with digraphs: `%`, `%<`, `<:`, `:>`, `%:`, `%:%:` and trigraphs: `??<`, `??>`, `??(`, `??)`, `??=`, `??/`, `??'`, `??!`, `??-`) provide an alternative way to represent standard tokens. These keywords are also considered reserved in attributes (excluding attribute argument lists), but some implementations handle them the same as the others. In addition to keywords, there are _identifiers with special meaning_, which may be used as names of objects or functions, but have special meaning in certain contexts. | | | :---- | -| `final` (C++11)
`override` (C++11)
`transaction_safe` (TM TS)
`transaction_safe_dynamic` (TM TS)
`import` (C++20)
`module` (C++20)
`pre` (C++26)
`post` (C++26)
`trivially_relocatable_if_eligible` (C++26)
`replaceable_if_eligible` (C++26) | +| `final` (C++11)
`override` (C++11)
`transaction_safe` (TM TS)
`transaction_safe_dynamic` (TM TS)
`import` (C++20)
`module` (C++20)
`pre` (C++26)
`post` (C++26)
`trivially_relocatable_if_eligible` (C++26)
`replaceable_if_eligible` (C++26) | -Also, all identifiers that contain a double underscore `__` in any position and each identifier that begins with an underscore followed by an uppercase letter is always reserved, and all identifiers that begin with an underscore are reserved for use as names in the global namespace. See identifiers for more details. +Also, all identifiers that contain a double underscore `__` in any position and each identifier that begins with an underscore followed by an uppercase letter is always reserved, and all identifiers that begin with an underscore are reserved for use as names in the global namespace. See identifiers for more details. -The namespace `std` is used to place names of the standard C++ library. See Extending namespace std for the rules about adding names to it. +The namespace `std` is used to place names of the standard C++ library. See Extending namespace std for the rules about adding names to it. The name `posix` is reserved for a future top-level namespace. The behavior is undefined if a program declares or defines anything in that namespace. -The following tokens are recognized by the preprocessor when in context of a preprocessor directive: +The following tokens are recognized by the preprocessor when in context of a preprocessor directive: | | | | :---- | :---- | -| `if`
`elif`
`else`
`endif`
`ifdef`
`ifndef`
`elifdef` (C++23)
`elifndef` (C++23)
`define`
`undef` | `include`
`embed` (C++26)
`line`
`error`
`warning` (C++23)
`pragma`
`defined`
`__has_include` (C++17)
`__has_cpp_attribute` (C++20)
`__has_embed` (C++26)
`export` (C++20)
`import` (C++20)
`module` (C++20) | +| `if`
`elif`
`else`
`endif`
`ifdef`
`ifndef`
`elifdef` (C++23)
`elifndef` (C++23)
`define`
`undef` | `include`
`embed` (C++26)
`line`
`error`
`warning` (C++23)
`pragma`
`defined`
`__has_include` (C++17)
`__has_cpp_attribute` (C++20)
`__has_embed` (C++26)
`export` (C++20)
`import` (C++20)
`module` (C++20) | -The following tokens are recognized by the preprocessor _outside_ the context of a preprocessor directive: +The following tokens are recognized by the preprocessor _outside_ the context of a preprocessor directive: | | | :---- | -| `_Pragma` (C++11) | +| `_Pragma` (C++11) | ### See also -C documentation for keywords +C documentation for keywords diff --git a/src/content/docs/cpp/language/basic_concepts/modules.mdx b/src/content/docs/cpp/language/basic_concepts/modules.mdx index 54a5d7fd..42647f69 100644 --- a/src/content/docs/cpp/language/basic_concepts/modules.mdx +++ b/src/content/docs/cpp/language/basic_concepts/modules.mdx @@ -12,11 +12,11 @@ import DocLink from "@components/DocLink.astro"; import { DR, DRList } from "@components/defect-report"; import { FeatureTestMacro, FeatureTestMacroValue } from "@components/feature-test-macro"; -Most C++ projects use multiple translation units, and so they need to share declarations and definitions across those units. The usage of headers is prominent for this purpose, an example being the standard library whose declarations can be provided by including the corresponding header. +Most C++ projects use multiple translation units, and so they need to share declarations and definitions across those units. The usage of headers is prominent for this purpose, an example being the standard library whose declarations can be provided by including the corresponding header. Modules are a language feature to share declarations and definitions across translation units. They are an alternative to some use cases of headers. -Modules are orthogonal to namespaces. +Modules are orthogonal to namespaces. ```cpp // helloworld.cpp @@ -115,7 +115,7 @@ export/*$opt*/ module /*$s:module-name*/ /*$s:module-partition*//*$opt*/ /*$s:at The module name consists of one or more identifiers separated by dots (for example: `mymodule`, `mymodule.mysubmodule`, `mymodule2`, etc.). Dots have no intrinsic meaning, however they are used informally to represent hierarchy. -If any identifier in the module name or module partition is defined as an object-like macro, the program is ill-formed. +If any identifier in the module name or module partition is defined as an object-like macro, the program is ill-formed. A _named module_ is the collection of module units with the same module name. @@ -210,7 +210,7 @@ int main() { } ``` -`#include` should not be used in a module unit (outside the _global module fragment_), because all included declarations and definitions would be considered part of the module. Instead, headers can also be imported as _header units_ with an _import declaration_: +`#include` should not be used in a module unit (outside the _global module fragment_), because all included declarations and definitions would be considered part of the module. Instead, headers can also be imported as _header units_ with an _import declaration_: ```cpp cxx-mark export/*$opt*/ import /*$s:header-name*/ /*$s:attr*//*$opt*/; @@ -254,7 +254,7 @@ module; /*$s:module-declaration*/ ``` -If a module-unit has a global module fragment, then its first declaration must be `module;`. Then, only preprocessing directives can appear in the global module fragment. Then, a standard module declaration marks the end of the global module fragment and the start of the module content. +If a module-unit has a global module fragment, then its first declaration must be `module;`. Then, only preprocessing directives can appear in the global module fragment. Then, a standard module declaration marks the end of the global module fragment and the start of the module content. ```cpp // A.cpp @@ -413,7 +413,7 @@ In general, if a declaration appears after the module declaration in a module un If a declaration of an entity is attached to a named module, that entity can only be defined in that module. All declarations of such an entity must be attached to the same module. -If a declaration is attached to a named module, and it is not exported, the declared name has module linkage. +If a declaration is attached to a named module, and it is not exported, the declared name has module linkage. ```cpp export module lib_A; @@ -429,7 +429,7 @@ int f() { return 1; } // OK, f in lib_A and f in lib_B refer to different entiti export int y = f(); // y equals 1 ``` -If two declarations of an entity are attached to different modules, the program is ill-formed; no diagnostic is required if neither is reachable from the other. +If two declarations of an entity are attached to different modules, the program is ill-formed; no diagnostic is required if neither is reachable from the other. ```cpp // decls.h @@ -458,8 +458,8 @@ int k(); // Error: matches #4 The following declarations are not attached to any named module (and thus the declared entity can be defined outside the module): -- namespace definitions with external linkage; -- declarations within a language linkage specification. +- namespace definitions with external linkage; +- declarations within a language linkage specification. ```cpp export module lib_A; diff --git a/src/content/docs/cpp/language/basics.mdx b/src/content/docs/cpp/language/basics.mdx index 0056ea08..33833ce5 100644 --- a/src/content/docs/cpp/language/basics.mdx +++ b/src/content/docs/cpp/language/basics.mdx @@ -13,22 +13,22 @@ import DocLink from "@components/DocLink.astro"; This section provides definitions for the specific terminology and the concepts used when describing the C++ programming language. -A C++ program is a sequence of text files (typically header and source files) that contain declarations. They undergo translation to become an executable program, which is executed when the C++ implementation calls its main function. +A C++ program is a sequence of text files (typically header and source files) that contain declarations. They undergo translation to become an executable program, which is executed when the C++ implementation calls its main function. -Certain words in a C++ program have special meaning, and these are known as keywords. Others can be used as identifiers. Comments are ignored during translation. C++ programs also contain literals, the values of characters inside them are determined by character sets and encodings. Certain characters in the program have to be represented with escape sequences. +Certain words in a C++ program have special meaning, and these are known as keywords. Others can be used as identifiers. Comments are ignored during translation. C++ programs also contain literals, the values of characters inside them are determined by character sets and encodings. Certain characters in the program have to be represented with escape sequences. -The *entities* of a C++ program are values, objects, references, structured bindings, result bindings, functions, enumerators, types, class members, templates, template specializations, packs, and namespaces. Preprocessor macros are not C++ entities. +The *entities* of a C++ program are values, objects, references, structured bindings, result bindings, functions, enumerators, types, class members, templates, template specializations, packs, and namespaces. Preprocessor macros are not C++ entities. -Declarations may introduce entities, associate them with names and define their properties. The declarations that define all properties required to use an entity are definitions. A program must contain only one definition of any non-inline function or variable that is odr-used. +Declarations may introduce entities, associate them with names and define their properties. The declarations that define all properties required to use an entity are definitions. A program must contain only one definition of any non-inline function or variable that is odr-used. -Definitions of functions usually include sequences of statements, some of which include expressions, which specify the computations to be performed by the program. +Definitions of functions usually include sequences of statements, some of which include expressions, which specify the computations to be performed by the program. -Names encountered in a program are associated with the declarations that introduced them using name lookup. Each name is only valid within a part of the program called its scope. Some names have linkage which makes them refer to the same entities when they appear in different scopes or translation units. +Names encountered in a program are associated with the declarations that introduced them using name lookup. Each name is only valid within a part of the program called its scope. Some names have linkage which makes them refer to the same entities when they appear in different scopes or translation units. -Each object, reference, function, expression in C++ is associated with a type, which may be fundamental, compound, or user-defined, complete or incomplete, etc. +Each object, reference, function, expression in C++ is associated with a type, which may be fundamental, compound, or user-defined, complete or incomplete, etc. -Declared objects and declared references that are not non-static data members are *variables ​*. +Declared objects and declared references that are not non-static data members are *variables ​*. ## See also -C documentation for Basic concepts \ No newline at end of file +C documentation for Basic concepts \ No newline at end of file diff --git a/src/content/docs/cpp/language/comments.mdx b/src/content/docs/cpp/language/comments.mdx index 681f233f..5e73d037 100644 --- a/src/content/docs/cpp/language/comments.mdx +++ b/src/content/docs/cpp/language/comments.mdx @@ -31,7 +31,7 @@ Comments serve as a sort of in-code documentation. When inserted into a program, Often known as "C++-style" or "single-line" comments. -All comments are removed from the program at translation phase 3 by replacing each comment with a single whitespace character. +All comments are removed from the program at translation phase 3 by replacing each comment with a single whitespace character. ## C-style @@ -43,7 +43,7 @@ C++-style comments are usually used to comment single lines, however, multiple C ## Notes -Because comments are removed before the preprocessor stage, a macro cannot be used to form a comment and an unterminated C-style comment doesn't spill over from an #include'd file. +Because comments are removed before the preprocessor stage, a macro cannot be used to form a comment and an unterminated C-style comment doesn't spill over from an #include'd file. Besides commenting out, other mechanisms used for source code exclusion are @@ -107,6 +107,6 @@ Output: -C documentation for comment +C documentation for comment diff --git a/src/content/docs/cpp/language/main_function.mdx b/src/content/docs/cpp/language/main_function.mdx index 576a6d35..d1cb5535 100644 --- a/src/content/docs/cpp/language/main_function.mdx +++ b/src/content/docs/cpp/language/main_function.mdx @@ -189,6 +189,6 @@ The following behavior-changing defect reports were applied retroactively to pre - C documentation for **main function** + C documentation for **main function** diff --git a/src/content/docs/development/guide/component-docs-for-llm.mdx b/src/content/docs/development/guide/component-docs-for-llm.mdx index 804eeb29..81d47a5e 100644 --- a/src/content/docs/development/guide/component-docs-for-llm.mdx +++ b/src/content/docs/development/guide/component-docs-for-llm.mdx @@ -234,7 +234,7 @@ The `DocLink` component renders an inline link to a page associated with a doc k #### Props -- `src` (required): The absolute path (e.g., `"/cpp/library/utilities/move"`). +- `dest` (required): The absolute path (e.g., `"/cpp/library/utilities/move"`). - `section` (optional): The `id` of the HTML element to jump to, typically the `id` of heading tags generated from Markdown headings. #### Slots @@ -246,9 +246,7 @@ The `DocLink` component renders an inline link to a page associated with a doc k import DocLink from "@components/DocLink.astro"; -Check out this page for more information. - -Check out this page for more information. +Check out this page for more information. If the doc key does not exist, the component renders as plain text with missing styling. diff --git a/src/content/docs/development/guide/doc-everything.mdx b/src/content/docs/development/guide/doc-everything.mdx index dbe63e52..628ec729 100644 --- a/src/content/docs/development/guide/doc-everything.mdx +++ b/src/content/docs/development/guide/doc-everything.mdx @@ -349,12 +349,12 @@ The `DocLink` component allows you to render an inline link to a specified CppDo import DocLink from "@components/DocLink.astro"; Check out -this page +this page for more information about `std::move`. ``` - Check out this page for more information about `std::move`. + Check out this page for more information about `std::move`. By setting the `section` attribute, you can link to a specific section (or any HTML elements with corresponding `id` attribute) of a CppDoc page. @@ -363,7 +363,7 @@ By setting the `section` attribute, you can link to a specific section (or any H import DocLink from "@components/DocLink.astro"; Standard library hardening allows turning some instances of undefined behavior in the standard library into a contract violation. @@ -371,7 +371,7 @@ into a contract violation. Standard library hardening allows turning some instances of undefined behavior in the standard library into a contract violation. diff --git a/src/content/docs/development/migration/guideline.mdx b/src/content/docs/development/migration/guideline.mdx index 1947450f..bf1a423a 100644 --- a/src/content/docs/development/migration/guideline.mdx +++ b/src/content/docs/development/migration/guideline.mdx @@ -5,11 +5,12 @@ sidebar: --- import { Aside } from "@astrojs/starlight/components"; +import DocLink from "@components/DocLink.astro" This document gives guidelines to migrate content from cppreference to CppDoc.