Skip to content

Commit 7b77804

Browse files
authored
fix: Main page/ Comment Page and deploy.yml (#47)
close #46
1 parent 7a1bf02 commit 7b77804

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
deploy:
2727
needs: build
2828
runs-on: ubuntu-latest
29+
if: github.repository == 'cppdoc-cc/cppdoc'
2930
environment:
3031
name: github-pages
3132
url: ${{ steps.deployment.outputs.page_url }}

src/content/docs/cpp/comments.mdx renamed to src/content/docs/cpp/language/comments.mdx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
---
22
title: Comments
33
description: Auto‑generated from cppreference
4+
cppdoc:
5+
keys: ["cpp.lang.comments"]
46
---
57

68
import { Desc, DescList, DocLink } from '@components/index';
7-
8-
# Comments
9+
import { Decl, DeclDoc } from "@components/decl-doc";
910

1011
Comments serve as a sort of in-code documentation. When inserted into a program, they are effectively ignored by the compiler; they are solely intended to be used as notes by the humans that read source code. Although specific documentation is not part of the C++ standard, several utilities exist that parse comments with different documentation formats.
1112

1213
## Syntax
1314

14-
#### Block Comment
15-
Often known as "C-style" or "multi-line" comments.
16-
17-
```
18-
/* comment */
19-
```
20-
#### Single-line Comment
21-
Often known as "C++-style" or "single-line" comments.
22-
```
23-
// comment
24-
```
15+
<DeclDoc>
16+
<Decl slot="decl">
17+
```cpp
18+
/* comment */
19+
```
20+
</Decl>
21+
22+
Often known as "C-style" or "multi-line" comments.
23+
</DeclDoc>
24+
25+
<DeclDoc>
26+
<Decl slot="decl">
27+
```cpp
28+
// comment
29+
```
30+
</Decl>
31+
Often known as "C++-style" or "single-line" comments.
32+
</DeclDoc>
2533

2634
All comments are removed from the program at <DocLink src="/cpp/language/translation_phases">translation phase 3</DocLink> by replacing each comment with a single whitespace character.
2735

src/content/docs/cpp/language/main_function.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Code from "@astrojs/starlight/components";
99
import Behavior from "@components/Behavior.astro";
1010
import { Decl, DeclDoc } from "@components/decl-doc";
1111
import { DR, DRList } from "@components/defect-report";
12+
import { Desc, DescList, DocLink } from '@components/index';
1213
import Missing from "@components/Missing.astro";
1314
import { ParamDoc, ParamDocList } from "@components/param-doc";
1415
import { Revision } from "@components/revision";
@@ -131,8 +132,16 @@ argv[3] == 0
131132
132133
## References
133134
134-
- C++23 standard (ISO/IEC 14882:2024):
135+
<DeclDoc style="text-align: center;">
136+
<Decl slot="decl">
137+
<div style="text-align: center;">
138+
<strong>Extended Content</strong>
139+
</div>
140+
</Decl>
141+
142+
- C++23 standard (ISO/IEC 14882:2024)
135143
- 6.9.3.1 main function [basic.start.main]
144+
</DeclDoc>
136145
137146
## Defect reports
138147
@@ -175,3 +184,11 @@ The following behavior-changing defect reports were applied retroactively to pre
175184
</Fragment>
176185
</DR>
177186
</DRList>
187+
188+
## See also
189+
190+
<DescList>
191+
<Desc>
192+
<DocLink slot="item" src="/c/language/main_function"> C documentation</DocLink> for <span> **main function** </span>
193+
</Desc>
194+
</DescList>

0 commit comments

Comments
 (0)