Skip to content

Commit 7ae7a98

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents b16f791 + dc2e600 commit 7ae7a98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3788
-253
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contribute to CppDoc
2+
3+
## Migrate a page from cppreference to CppDoc
4+
5+
We're now in the process of migrating contents from [cppreference] to CppDoc. Please checkout our [migration guide](https://cppdoc.cc/development/migration) for guidelines.
6+
7+
## Report a documentation bug
8+
9+
We use GitHub issues to track documentation bugs. To report a bug, please [opening a new GitHub issue](https://github.com/cppdoc-cc/cppdoc/issues/new).
10+
11+
## Add new content
12+
13+
> [!NOTE]
14+
> Incomplete.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ You can report a bug or request a new feature by [opening a new GitHub issue](ht
3636

3737
If you have made some changes, you can [open a new GitHub pull request](https://github.com/cppdoc-cc/cppdoc/compare).
3838

39+
For more information on contributing to CppDoc, please refer to our [contribution guide](./CONTRIBUTING.md).
40+
3941
## License
4042

4143
The content of the documentation is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](./LICENSE.CC-BY-SA-4.0) and the [GNU Free Documentation License](./LICENSE.GFDL). The underlying source code used to process, format, and display that content is licensed under the [MIT license](./LICENSE.MIT).

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import starlightHeadingBadges from "starlight-heading-badges";
1010
export default defineConfig({
1111
site: process.env.CPPDOC_SITE,
1212
base: process.env.CPPDOC_BASE,
13+
trailingSlash: "always",
1314
integrations: [
1415
starlight({
1516
title: "CppDoc",

ec.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @ts-check
2+
import { pluginCxxMark } from "./src/plugins/expressive-code/cxx-mark.ts";
3+
4+
/** @type {import('@astrojs/starlight/expressive-code').StarlightExpressiveCodeOptions} */
5+
export default {
6+
plugins: [pluginCxxMark()],
7+
};

migrate/PROMPT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You are a professional C++ documentation writer. You are now migrating cpprefere
44
3. For links, take the URL part, remove `/w/` and the latter part `.html`, and then wrap it with `DocLink`. For example:
55
If the current path is: `/w/cpp/language/basics.html`
66
Link: `<a href="declarations.html" title="cpp/language/declarations">declarations</a>`
7-
You should, based on the current link, change it to: `<DocLink src="/cpp/language/declarations">declarations</DocLink>`
7+
You should, based on the current link, change it to: `<DocLink dest="/cpp/language/declarations">declarations</DocLink>`
88
4. Currently available components:
99
```mdx
1010
{{LLM_DOCS}}

migrate/migrate-bot.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ ${imageUrl ? `![Text Diff](${imageUrl})` : "(No text diff image)"}
418418
body: prBody,
419419
head: branchName,
420420
base: "main",
421+
draft: true,
421422
});
422423

423424
console.log(`Created PR #${pr.number}`);

migrate/slug_map.json

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10115,6 +10115,10 @@
1011510115
"cppref": "cpp/utility/in_range",
1011610116
"cppdoc": "cpp/library/utility/in_range"
1011710117
},
10118+
{
10119+
"cppref": "cpp/utility/rtti",
10120+
"cppdoc": "cpp/library/utility/rtti"
10121+
},
1011810122
{
1011910123
"cppref": "cpp/utility/program",
1012010124
"cppdoc": "cpp/library/utility/program"
@@ -22115,6 +22119,134 @@
2211522119
"cppref": "c/header",
2211622120
"cppdoc": "c/library/header"
2211722121
},
22122+
{
22123+
"cppref": "c/header/assert",
22124+
"cppdoc": "c/library/headers/assert"
22125+
},
22126+
{
22127+
"cppref": "c/header/complex",
22128+
"cppdoc": "c/library/headers/complex"
22129+
},
22130+
{
22131+
"cppref": "c/header/ctype",
22132+
"cppdoc": "c/library/headers/ctype"
22133+
},
22134+
{
22135+
"cppref": "c/header/errno",
22136+
"cppdoc": "c/library/headers/errno"
22137+
},
22138+
{
22139+
"cppref": "c/header/fenv",
22140+
"cppdoc": "c/library/headers/fenv"
22141+
},
22142+
{
22143+
"cppref": "c/header/float",
22144+
"cppdoc": "c/library/headers/float"
22145+
},
22146+
{
22147+
"cppref": "c/header/inttypes",
22148+
"cppdoc": "c/library/headers/inttypes"
22149+
},
22150+
{
22151+
"cppref": "c/header/iso646",
22152+
"cppdoc": "c/library/headers/iso646"
22153+
},
22154+
{
22155+
"cppref": "c/header/limits",
22156+
"cppdoc": "c/library/headers/limits"
22157+
},
22158+
{
22159+
"cppref": "c/header/locale",
22160+
"cppdoc": "c/library/headers/locale"
22161+
},
22162+
{
22163+
"cppref": "c/header/math",
22164+
"cppdoc": "c/library/headers/math"
22165+
},
22166+
{
22167+
"cppref": "c/header/setjmp",
22168+
"cppdoc": "c/library/headers/setjmp"
22169+
},
22170+
{
22171+
"cppref": "c/header/signal",
22172+
"cppdoc": "c/library/headers/signal"
22173+
},
22174+
{
22175+
"cppref": "c/header/stdalign",
22176+
"cppdoc": "c/library/headers/stdalign"
22177+
},
22178+
{
22179+
"cppref": "c/header/stdarg",
22180+
"cppdoc": "c/library/headers/stdarg"
22181+
},
22182+
{
22183+
"cppref": "c/header/stdatomic",
22184+
"cppdoc": "c/library/headers/stdatomic"
22185+
},
22186+
{
22187+
"cppref": "c/header/stdbit",
22188+
"cppdoc": "c/library/headers/stdbit"
22189+
},
22190+
{
22191+
"cppref": "c/header/stdbool",
22192+
"cppdoc": "c/library/headers/stdbool"
22193+
},
22194+
{
22195+
"cppref": "c/header/stdckdint",
22196+
"cppdoc": "c/library/headers/stdckdint"
22197+
},
22198+
{
22199+
"cppref": "c/header/stddef",
22200+
"cppdoc": "c/library/headers/stddef"
22201+
},
22202+
{
22203+
"cppref": "c/header/stdint",
22204+
"cppdoc": "c/library/headers/stdint"
22205+
},
22206+
{
22207+
"cppref": "c/header/stdio",
22208+
"cppdoc": "c/library/headers/stdio"
22209+
},
22210+
{
22211+
"cppref": "c/header/stdlib",
22212+
"cppdoc": "c/library/headers/stdlib"
22213+
},
22214+
{
22215+
"cppref": "c/header/stdmchar",
22216+
"cppdoc": "c/library/headers/stdmchar"
22217+
},
22218+
{
22219+
"cppref": "c/header/stdnoreturn",
22220+
"cppdoc": "c/library/headers/stdnoreturn"
22221+
},
22222+
{
22223+
"cppref": "c/header/string",
22224+
"cppdoc": "c/library/headers/string"
22225+
},
22226+
{
22227+
"cppref": "c/header/tgmath",
22228+
"cppdoc": "c/library/headers/tgmath"
22229+
},
22230+
{
22231+
"cppref": "c/header/threads",
22232+
"cppdoc": "c/library/headers/threads"
22233+
},
22234+
{
22235+
"cppref": "c/header/time",
22236+
"cppdoc": "c/library/headers/time"
22237+
},
22238+
{
22239+
"cppref": "c/header/uchar",
22240+
"cppdoc": "c/library/headers/uchar"
22241+
},
22242+
{
22243+
"cppref": "c/header/wchar",
22244+
"cppdoc": "c/library/headers/wchar"
22245+
},
22246+
{
22247+
"cppref": "c/header/wctype",
22248+
"cppdoc": "c/library/headers/wctype"
22249+
},
2211822250
{
2211922251
"cppref": "c/locale",
2212022252
"cppdoc": "c/library/locale"
@@ -24499,6 +24631,22 @@
2449924631
"cppref": "cpp/identifier_with_special_meaning/override",
2450024632
"cppdoc": "cpp/language/keywords/override"
2450124633
},
24634+
{
24635+
"cppref": "cpp/identifier_with_special_meaning/pre",
24636+
"cppdoc": "cpp/language/keywords/pre"
24637+
},
24638+
{
24639+
"cppref": "cpp/identifier_with_special_meaning/post",
24640+
"cppdoc": "cpp/language/keywords/post"
24641+
},
24642+
{
24643+
"cppref": "cpp/identifier_with_special_meaning/trivially_relocatable_if_eligible",
24644+
"cppdoc": "cpp/language/keywords/trivially_relocatable_if_eligible"
24645+
},
24646+
{
24647+
"cppref": "cpp/identifier_with_special_meaning/replaceable_if_eligible",
24648+
"cppdoc": "cpp/language/keywords/replaceable_if_eligible"
24649+
},
2450224650
{
2450324651
"cppref": "cpp/identifier_with_special_meaning/module",
2450424652
"cppdoc": "cpp/language/keywords/module"
@@ -24651,6 +24799,10 @@
2465124799
"cppref": "cpp/language/modules",
2465224800
"cppdoc": "cpp/language/basic_concepts/modules"
2465324801
},
24802+
{
24803+
"cppref": "cpp/language/contracts",
24804+
"cppdoc": "cpp/language/basic_concepts/contracts"
24805+
},
2465424806
{
2465524807
"cppref": "cpp/language/copy_initialization",
2465624808
"cppdoc": "cpp/language/initialization/copy_initialization"

migrate/update-migrate-progress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ function generateUrls(
4747
function generateMarkdown(status: EntryStatus): string {
4848
const { entry, migrated, cpprefUrl, cppdocUrl, issueUrl } = status;
4949
if (migrated) {
50-
return `| ✅ | [cppref](${cpprefUrl}) | [cppdoc](${cppdocUrl}) | \`${entry}\` | `;
50+
return `| ✅ | [cppref](${cpprefUrl}) | [cppdoc](${cppdocUrl}) | \`${entry.cppdoc ?? entry.cppref + "(cppref)"}\` | `;
5151
} else {
5252
return `| ❌ | [cppref](${cpprefUrl}) | ${
5353
entry.cppdoc ? `[create](${issueUrl})` : "N/A"
54-
} | \`${entry}\` |`;
54+
} | \`${entry.cppdoc ?? entry.cppref + "(cppref)"}\` |`;
5555
}
5656
}
5757

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```cpp cxx-mark
2+
// syntax of for statement
3+
/*$s:attr*//*$opt*/ for ( /*$s:init-statement*/ /*$s:condition*//*$opt*/ ; /*$s:expression*//*$opt*/ ) /*$s:statement*/
4+
5+
// exposition only alias template of conditionally const type
6+
template< bool Const, class T >
7+
using /*$e:maybe-const*/ = std::conditional_t<Const, const T, T>;
8+
```

src/components/DocLink.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
2-
import { getLinkToKey } from "../lib/doc-index";
2+
import { isLinkMissing, normalizeLink } from "../lib/doc-link";
33
44
interface Props {
5-
src: string;
5+
dest: string;
6+
section?: string;
67
}
78
8-
const { src } = Astro.props;
9-
const rawLink = await getLinkToKey(src);
9+
const { dest, section } = Astro.props;
1010
11-
const missing = rawLink === undefined;
12-
const link = rawLink ?? "";
11+
const missing = await isLinkMissing(dest);
12+
const link = normalizeLink(dest) + (section ? "#" + section : "");
1313
---
1414

1515
{
1616
missing ? (
17-
<span class="doc-link missing" title={`${src} (missing)`}>
17+
<span class="doc-link missing" title={`${dest} (missing)`}>
1818
<slot />
1919
</span>
2020
) : (
21-
<a class="doc-link" href={link} title={src}>
21+
<a class="doc-link" href={link} title={dest}>
2222
<slot />
2323
</a>
2424
)

0 commit comments

Comments
 (0)