Skip to content

Commit 8cd67cd

Browse files
authored
Merge pull request #21646 from AnnsAnns/move_coc
doc: Integrate Governance, Code of Conduct and C++ Tutorial into Starlight
2 parents 2809870 + 00c0c8f commit 8cd67cd

File tree

7 files changed

+85
-52
lines changed

7 files changed

+85
-52
lines changed

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
guides/generated

doc/doxygen/src/using-cpp.md

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,5 @@
1-
Using C++ in RIOT {#using-cpp}
2-
=================
1+
Using C++ in RIOT {#using-cpp}
2+
==================
33

4-
[TOC]
5-
6-
Levels of Support {#levels-of-support}
7-
=================
8-
9-
A CPU in RIOT can have three levels of support for C++ code:
10-
11-
1. No support for C++ at all
12-
2. C++ is supported, but no libstdc++ implementation is available
13-
3. C++ is supported and a libstdc++ implementation is available
14-
15-
The reason for missing or only partial C++ support can be one (or more) of
16-
the following:
17-
18-
- No libstdc++ implementation for the target platform is available to RIOT, or
19-
the official RIOT docker image is missing it
20-
- Missing toolchain support for a given target platform
21-
- The C++ toolchain requires library code (such as constructor guards for the
22-
thread safe initialization of statically allocated instances) or hooks in
23-
the startup process to perform initialization
24-
25-
Using C++
26-
=========
27-
28-
In order for C++ code to compile with RIOT, the following needs to be done:
29-
30-
- All C++ files must have the file extension `.cpp`, all C++ headers `.hpp`
31-
- For external code, overwriting the make variable `SRCXXEXT` e.g. to
32-
`cxx` can be used to compile C++ files with other extensions, e.g. `.cxx`
33-
- `FEATURES_REQUIRED += cpp` must be added to the applications `Makefile`
34-
- If additionally the libstdc++ is used, `FEATURES_REQUIRED += libstdcpp`
35-
must be used additionally
36-
37-
RIOT Modules in C++ {#cpp-in-riot}
38-
===================
39-
40-
RIOT modules should be written in C, so that boards/platforms without or partial
41-
C++ support can still use these modules. However, external modules, packages,
42-
and modules that require C++ support anyway (e.g. the Arduino compatibility
43-
features) can be written in C++. Also, some modules might be designed as
44-
compatibility layer for C++ or provide convenient access to RIOT-OS' features
45-
using C++ APIs. These modules/packages have to depend on the
46-
`cpp` feature (`FEATURES_REQUIRED += cpp`) and possibly the `libstdcpp`
47-
feature using their `Makefile.dep`.
48-
49-
See Also {#see-also}
50-
========
51-
52-
Reference @ref cpp for a list of C++ modules.
4+
@deprecated Guides have moved to the [Guide Site](https://guide.riot-os.org/c_tutorials/using_cpp/).
5+
This page will be removed after release 2026.04.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Using C++ in RIOT
3+
description: This document explains how to use C++ in RIOT, including levels of support and requirements for C++ code.
4+
---
5+
6+
# Levels of Support
7+
8+
A CPU in RIOT can have three levels of support for C++ code:
9+
10+
1. No support for C++ at all
11+
2. C++ is supported, but no libstdc++ implementation is available
12+
3. C++ is supported and a libstdc++ implementation is available
13+
14+
The reason for missing or only partial C++ support
15+
can be one (or more) of the following:
16+
17+
- No libstdc++ implementation for the target platform is available to RIOT,
18+
or the official RIOT docker image is missing it
19+
- Missing toolchain support for a given target platform
20+
- The C++ toolchain requires library code
21+
(such as constructor guards for the thread safe initialization of statically
22+
allocated instances) or hooks in the startup process to perform initialization
23+
24+
# Using C++
25+
26+
In order for C++ code to compile with RIOT, the following needs to be done:
27+
28+
- All C++ files must have the file extension `.cpp`, all C++ headers `.hpp`
29+
- For external code, overwriting the make variable `SRCXXEXT`
30+
e.g. to `cxx` can be used to compile C++ files with other extensions,
31+
e.g. `.cxx`
32+
- `FEATURES_REQUIRED += cpp` must be added to the applications `Makefile`
33+
- If additionally the libstdc++ is used,
34+
`FEATURES_REQUIRED += libstdcpp` must be set.
35+
36+
## RIOT Modules in C++
37+
38+
RIOT modules should be written in C, so that boards/platforms without
39+
or partial C++ support can still use these modules.
40+
However, external modules, packages and modules that require C++ support anyway
41+
(e.g. the Arduino compatibility features) can be written in C++.
42+
Also, some modules might be designed as compatibility layer for C++
43+
or provide convenient access to RIOT-OS' features using C++ APIs.
44+
These modules/packages have to depend on the `cpp` feature
45+
(`FEATURES_REQUIRED += cpp`) and possibly the `libstdcpp` feature
46+
using their `Makefile.dep`.
47+
48+
## See Also
49+
50+
Reference [C++ modules](https://doc.riot-os.org/group__cpp.html)
51+
for a list of C++ modules.

doc/starlight/Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ RIOTMAKE ?= $(RIOTBASE)/makefiles
33
RIOTTOOLS ?= $(RIOTBASE)/dist/tools
44

55
.PHONY: install
6-
install:
6+
install: integrate_outside_files
77
@echo "Installing starlight..."
88
@npm install --prefix $(CURDIR) --prefer-offline
99
@echo "Starlight installed successfully."
@@ -18,5 +18,20 @@ dev: install
1818
@echo "Starting starlight live server..."
1919
@npm run dev --prefix $(CURDIR)
2020

21+
.PHONY: clean
2122
clean:
2223
-@rm -rf node_modules .astro dist
24+
25+
.PHONY: integrate_outside_files
26+
integrate_outside_files: code_of_conduct governance
27+
28+
.PHONY: code_of_conduct
29+
code_of_conduct: ../../CODE_OF_CONDUCT.md
30+
-@mkdir -p ../guides/generated
31+
-@echo "Generating Code of Conduct documentation..."
32+
-@sed '1,2d' $< | cat ./templates/CODE_OF_CONDUCT.template.md - > ../guides/generated/CODE_OF_CONDUCT.md
33+
34+
.PHONY: governance
35+
governance: ../../GOVERNANCE.md
36+
-@echo "Generating Governance documentation..."
37+
-@sed '1,2d' $< | sed '/<!-- TOC start -->/,/<!-- TOC end -->/d' | cat ./templates/GOVERNANCE.template.md - > ../guides/generated/GOVERNANCE.md

doc/starlight/astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export default defineConfig({
4747
{ label: "Introduction", slug: "index" },
4848
"general/structure",
4949
"general/vision",
50+
"general/governance",
51+
"general/code_of_conduct",
5052
],
5153
},
5254
{
@@ -71,6 +73,7 @@ export default defineConfig({
7173
"c_tutorials/threads",
7274
"c_tutorials/gpio",
7375
"c_tutorials/saul",
76+
"c_tutorials/using_cpp",
7477
],
7578
},
7679
{
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Code of Conduct
3+
description: This document outlines the code of conduct for contributors of RIOT.
4+
slug: general/code_of_conduct
5+
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Governance
3+
description: This document outlines the governance structure of RIOT.
4+
slug: general/governance
5+
---

0 commit comments

Comments
 (0)