From 6734b74a44a2fe50b894d2db1d18214fad81877e Mon Sep 17 00:00:00 2001
From: RigelShrimp <809239189@qq.com>
Date: Wed, 17 Dec 2025 22:17:35 +0800
Subject: [PATCH 1/2] fix: improve the styles and fix typo
---
.../docs/cpp/language/preprocessor.mdx | 2 +-
src/content/docs/cpp/language/templates.mdx | 57 ++++++++++++-------
2 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/src/content/docs/cpp/language/preprocessor.mdx b/src/content/docs/cpp/language/preprocessor.mdx
index 44444444..7be6ad56 100644
--- a/src/content/docs/cpp/language/preprocessor.mdx
+++ b/src/content/docs/cpp/language/preprocessor.mdx
@@ -1,5 +1,5 @@
---
-title: preprocessor
+title: Preprocessor
cppdoc:
keys: ["cpp.lang.preprocessor"]
---
diff --git a/src/content/docs/cpp/language/templates.mdx b/src/content/docs/cpp/language/templates.mdx
index 9d0ff0b3..1c0bafc2 100644
--- a/src/content/docs/cpp/language/templates.mdx
+++ b/src/content/docs/cpp/language/templates.mdx
@@ -38,16 +38,16 @@ The definition of a class template must be visible at the point of implicit inst
- ```cpp
- template requires-clause(optional) declaration
+ ```cpp cxx-mark
+ template *$s:parameter-list*/> /*$s:requires-clause*//*$opt*//*$s:declaration*/
```
- ```cpp
- export template declaration
+ ```cpp cxx-mark
+ export template *$s:parameter-list*/> /*$s:requires-clause*//*$opt*//*$s:declaration*/
```
@@ -55,8 +55,8 @@ The definition of a class template must be visible at the point of implicit inst
- ```cpp
- template concept concept-name = constraint-expression;
+ ```cpp cxx-mark
+ template *$s:parameter-list*/> concept /*$s:concept-name*/ = /*$s:constraint-expression*/;
```
@@ -65,18 +65,15 @@ The definition of a class template must be visible at the point of implicit inst
- a non-empty comma-separated list of the template parameters, each of which is either constant parameter, a type parameter, a template parameter, or a parameter pack of any of those(since C++11).
+ a non-empty comma-separated list of the template parameters, each of which is either constant parameter, a type parameter, a template parameter, or a parameter pack of any of those.
- (since C++20) a requires-clause that specifies the constraints on the template arguments.
+ a requires-clause that specifies the constraints on the template arguments.
- declaration of a class (including struct and union), a member class or member enumeration type, a function or member function, a static data member at namespace scope, a variable or static data member at class scope(since C++14), or an alias template(since C++11). It may also define a template specialization.
+ declaration of a class (including struct and union), a member class or member enumeration type, a function or member function, a static data member at namespace scope, a variable or static data member at class scope, or an alias template. It may also define a template specialization.
-
- concept-name
-
-
+
see constraints and concepts
@@ -91,8 +88,8 @@ A template identifier has one of the following syntaxes:
- ```cpp
- template-name
+ ```cpp cxx-mark
+ /*$s:template-name*/*$s:template-argument-list*//*$opt*/>
```
@@ -100,8 +97,8 @@ A template identifier has one of the following syntaxes:
- ```cpp
- operator op
+ ```cpp cxx-mark
+ operator /*$s:op*/*$s:template-argument-list*//*$opt*/>
```
@@ -109,8 +106,8 @@ A template identifier has one of the following syntaxes:
- ```cpp
- operator "" identifier
+ ```cpp cxx-mark
+ operator "" /*$s:identifier*/*$s:template-argument-list*//*$opt*/>
```
@@ -118,14 +115,32 @@ A template identifier has one of the following syntaxes:
- ```cpp
- operator user-defined-string-literal
+ ```cpp cxx-mark
+ operator user-defined-string-literal*$s:template-argument-list*//*$opt*/>
```
A user-defined string literal operator.
+
+
+
+ an identifier that names a template
+
+
+ an overloadable operator
+
+
+ an identifier
+
+
+ `""` followed by an identifier
+
+
+
+
+
A simple template identifier that names a class template specialization names a class.
A template identifier that names an alias template specialization names a type.
From 187ed63cc41bba7a7913a7f4dea074f8527cec59 Mon Sep 17 00:00:00 2001
From: RigelShrimp <809239189@qq.com>
Date: Wed, 17 Dec 2025 22:40:34 +0800
Subject: [PATCH 2/2] fix: remove all the keys
---
src/content/docs/cpp/language/basics.mdx | 2 --
src/content/docs/cpp/language/comments.mdx | 2 --
src/content/docs/cpp/language/exceptions.mdx | 2 --
src/content/docs/cpp/language/main_function.mdx | 2 --
src/content/docs/cpp/language/preprocessor.mdx | 2 --
src/content/docs/cpp/language/templates.mdx | 2 --
src/content/docs/cpp/library/index.mdx | 2 --
src/content/docs/cpp/library/utilities/move.mdx | 1 -
8 files changed, 15 deletions(-)
diff --git a/src/content/docs/cpp/language/basics.mdx b/src/content/docs/cpp/language/basics.mdx
index 33833ce5..3b976b5d 100644
--- a/src/content/docs/cpp/language/basics.mdx
+++ b/src/content/docs/cpp/language/basics.mdx
@@ -2,8 +2,6 @@
title: Overview
sidebar:
order: 1
-cppdoc:
- keys: ["cpp.lang.basic"]
---
import { Revision } from "@components/revision";
diff --git a/src/content/docs/cpp/language/comments.mdx b/src/content/docs/cpp/language/comments.mdx
index 5e73d037..76f17c05 100644
--- a/src/content/docs/cpp/language/comments.mdx
+++ b/src/content/docs/cpp/language/comments.mdx
@@ -1,8 +1,6 @@
---
title: Comments
description: Auto‑generated from cppreference
-cppdoc:
- keys: ["cpp.lang.comments"]
---
import { Desc, DescList, DocLink } from '@components/index';
diff --git a/src/content/docs/cpp/language/exceptions.mdx b/src/content/docs/cpp/language/exceptions.mdx
index 8a4e6ad6..79f61dca 100644
--- a/src/content/docs/cpp/language/exceptions.mdx
+++ b/src/content/docs/cpp/language/exceptions.mdx
@@ -1,7 +1,5 @@
---
title: Exceptions
-cppdoc:
- keys: ["cpp.lang.exceptions"]
---
import { Decl, DeclDoc } from "@components/decl-doc";
diff --git a/src/content/docs/cpp/language/main_function.mdx b/src/content/docs/cpp/language/main_function.mdx
index d1cb5535..f9642ed0 100644
--- a/src/content/docs/cpp/language/main_function.mdx
+++ b/src/content/docs/cpp/language/main_function.mdx
@@ -1,7 +1,5 @@
---
title: Main function
-cppdoc:
- keys: ["cpp.lang.main"]
---
import Code from "@astrojs/starlight/components";
diff --git a/src/content/docs/cpp/language/preprocessor.mdx b/src/content/docs/cpp/language/preprocessor.mdx
index 7be6ad56..18da92a4 100644
--- a/src/content/docs/cpp/language/preprocessor.mdx
+++ b/src/content/docs/cpp/language/preprocessor.mdx
@@ -1,7 +1,5 @@
---
title: Preprocessor
-cppdoc:
- keys: ["cpp.lang.preprocessor"]
---
import { Desc, DescList, DocLink } from '@components/index';
diff --git a/src/content/docs/cpp/language/templates.mdx b/src/content/docs/cpp/language/templates.mdx
index 1c0bafc2..f46dd9ab 100644
--- a/src/content/docs/cpp/language/templates.mdx
+++ b/src/content/docs/cpp/language/templates.mdx
@@ -1,7 +1,5 @@
---
title: Templates
-cppdoc:
- keys: ["cpp.lang.templates"]
---
import { Decl, DeclDoc } from "@components/decl-doc";
diff --git a/src/content/docs/cpp/library/index.mdx b/src/content/docs/cpp/library/index.mdx
index 2c05e0a5..ea76debf 100644
--- a/src/content/docs/cpp/library/index.mdx
+++ b/src/content/docs/cpp/library/index.mdx
@@ -2,8 +2,6 @@
title: Overview
sidebar:
order: 1
-cppdoc:
- keys: ["cpp.library"]
---
import { Card } from "@astrojs/starlight/components";
diff --git a/src/content/docs/cpp/library/utilities/move.mdx b/src/content/docs/cpp/library/utilities/move.mdx
index 40755f21..bce1eaf7 100644
--- a/src/content/docs/cpp/library/utilities/move.mdx
+++ b/src/content/docs/cpp/library/utilities/move.mdx
@@ -1,7 +1,6 @@
---
title: std::move
cppdoc:
- keys: ["cpp.library.utilities.move"]
revision:
since: C++11
---