Skip to content

Commit f6e5738

Browse files
committed
feat: add revision-specific content development guide
1 parent 13b1d1b commit f6e5738

File tree

21 files changed

+489
-34
lines changed

21 files changed

+489
-34
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
An open documentation for the C/C++ programming languages and their standard libraries.
44

5+
> [!TIP]
6+
> Currently CppDoc community members are working hard on migrating [cppreference](https://en.cppreference.com/index.html) pages to CppDoc. You’re more than welcomed to join us if you want to help!
7+
8+
## Quick Start
9+
10+
Clone the project to your local:
11+
12+
```bash
13+
git clone https://github.com/cppdoc-cc/cppdoc.git
14+
cd cppdoc
15+
```
16+
17+
Start a development server:
18+
19+
```bash
20+
npm i
21+
npm run dev
22+
```
23+
24+
## Contributing
25+
26+
CppDoc is an open documentation. Everyone is more than welcomed to contibute! Any kinds of contribution are greatly appreciated, including _but not limited_ to bug reports, bug fixes, feature requests, translations, new pages, and new documentation features.
27+
28+
You can report a bug or request a new feature by [opening a new GitHub issue](https://github.com/cppdoc-cc/cppdoc/issues/new).
29+
30+
If you have made some changes, you can [open a new GitHub pull request](https://github.com/cppdoc-cc/cppdoc/compare).
31+
532
## License
633

734
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: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { defineConfig } from "astro/config";
33
import starlight from "@astrojs/starlight";
44
import starlightUtils from "@lorenzo_lewis/starlight-utils";
55
import starlightAutoSidebar from "starlight-auto-sidebar";
6-
import starlightContextualMenu from "starlight-contextual-menu";
76
import starlightHeadingBadges from "starlight-heading-badges";
87

98
// https://astro.build/config
@@ -51,9 +50,6 @@ export default defineConfig({
5150
},
5251
plugins: [
5352
starlightAutoSidebar(),
54-
starlightContextualMenu({
55-
actions: ["chatgpt", "claude", "grok"],
56-
}),
5753
starlightHeadingBadges(),
5854
starlightUtils({
5955
multiSidebar: {

package-lock.json

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"nanostores": "^1.1.0",
1818
"sharp": "^0.34.2",
1919
"starlight-auto-sidebar": "0.1.3",
20-
"starlight-contextual-menu": "0.1.5",
2120
"starlight-heading-badges": "0.6.1"
2221
},
2322
"devDependencies": {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Decl, DeclDoc } from "@components/decl-doc";
2+
3+
<DeclDoc>
4+
<Decl slot="decl">
5+
```cpp
6+
int main() { /* body */ }
7+
```
8+
</Decl>
9+
10+
A `main` function is the entry point of a program.
11+
</DeclDoc>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Decl, DeclDoc } from "@components/decl-doc";
2+
3+
<DeclDoc>
4+
<Decl slot="decl">
5+
```cpp
6+
int main() { /* body */ }
7+
```
8+
</Decl>
9+
<Decl slot="decl">
10+
```cpp
11+
int main(int argc, char *argv[]) { /* body */ }
12+
```
13+
</Decl>
14+
15+
A `main` function is the entry point of a program.
16+
</DeclDoc>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Decl, DeclDoc } from "@components/decl-doc";
2+
import { RevisionBlock } from "@components/revision";
3+
4+
<DeclDoc autorevSince="C++11">
5+
<Decl slot="decl">
6+
<RevisionBlock since="C++11" until="C++14" noborder>
7+
```cpp
8+
template <typename T>
9+
typename std::remove_reference<T>::type&& move(T&& t) noexcept;
10+
```
11+
</RevisionBlock>
12+
</Decl>
13+
<Decl slot="decl">
14+
<RevisionBlock since="C++14" noborder>
15+
```cpp
16+
template <class T>
17+
constexpr std::remove_reference_t<T>&& move(T&& t) noexcept;
18+
```
19+
</RevisionBlock>
20+
</Decl>
21+
22+
`std::move` is used to _indicate_ that an object `t` may be "moved from", i.
23+
e. allowing the efficient transfer of resources from `t` to another object.
24+
</DeclDoc>

src/components/decl-doc/DeclDoc.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const hasId = id !== undefined;
3939
}
4040

4141
.decl-doc > .doc {
42-
margin: 1em;
42+
margin: 0;
43+
padding: 1em;
4344
}
4445
</style>

src/components/revision/Revision.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
import type { RevisionRange } from "@src/types";
32
import RevisionTags from "./RevisionTags.astro";
43
import { autoRev } from "./autorev";
4+
import type { RevisionInfo } from "./types";
55
6-
interface Props extends RevisionRange {
6+
interface Props extends RevisionInfo {
77
noborder?: boolean;
88
}
99

src/content/docs/c/language/basic/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Overview
3-
order: 1
3+
sidebar:
4+
order: 1
45
cppdoc:
56
keys: ["c.lang.basic"]
67
---

0 commit comments

Comments
 (0)