diff --git a/doc/starlight/src/components/contact.astro b/doc/starlight/src/components/contact.astro new file mode 100644 index 0000000000..a437171648 --- /dev/null +++ b/doc/starlight/src/components/contact.astro @@ -0,0 +1,15 @@ +--- +import { Aside } from "@astrojs/starlight/components"; +--- + + diff --git a/doc/starlight/src/components/gitsetup.mdx b/doc/starlight/src/components/gitsetup.mdx new file mode 100644 index 0000000000..4fe9155393 --- /dev/null +++ b/doc/starlight/src/components/gitsetup.mdx @@ -0,0 +1,40 @@ +:::note +This tutorial assumes that you have already set up your development environment +as described in the [Getting Started](/getting-started/installing/) guide. +::: + +Now that we have played around with the examples and have a basic understanding of how to use RIOT, let's create a new project from scratch. We will create a simple hello world program that will print "Hello World!" to the console. + +#### Step 1: Create a new git repository + +We start by creating a new git repository for our project. If you have never worked with git before, you can find a good introduction [here](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) or [here](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git). + +Let's create a new directory for our project in which we will store our code. We will call this directory `hello_world`. + +```bash +mkdir hello_world && cd hello_world +``` + +Next, we initialize a new git repository in this directory. This will allow us to track changes to our code and collaborate with others and also allows us to easily get RIOT as a submodule. + +```bash +git init +``` + +![The output of the git init command](img/gitsetup/01_empty_git.png) + +Congratulations! You have now created a new empty git repository. In the next step, we will add RIOT as a submodule to our project. + +#### Step 2: Add RIOT as a submodule + +We want to import RIOT as a submodule to our project. This will allow us to easily update to newer versions of RIOT and also allows us to easily share our project with others on GitHub, Gitlab, or any other git hosting service. + +To add RIOT as a submodule, we use the following command: + +```bash +git submodule add https://github.com/RIOT-OS/RIOT.git +``` + +![Adding the submodule](img/gitsetup/02_riot_submodule.png) + +When looking into our directory via `ls`, we can see that a new directory called `RIOT` has been created. This directory contains the RIOT source code. If you were to push your project to a git hosting service, the `RIOT` directory would not be included in the repository. Instead, the repository would contain a reference to the commit of the RIOT repository that you have added as a submodule. This way, the repository stays small and only contains the code that you have written and not the entire RIOT source code. diff --git a/doc/starlight/src/components/img/gitsetup/01_empty_git.png b/doc/starlight/src/components/img/gitsetup/01_empty_git.png new file mode 100644 index 0000000000..4de56b7854 Binary files /dev/null and b/doc/starlight/src/components/img/gitsetup/01_empty_git.png differ diff --git a/doc/starlight/src/components/img/gitsetup/02_riot_submodule.png b/doc/starlight/src/components/img/gitsetup/02_riot_submodule.png new file mode 100644 index 0000000000..63798d7cc8 Binary files /dev/null and b/doc/starlight/src/components/img/gitsetup/02_riot_submodule.png differ diff --git a/doc/starlight/tsconfig.json b/doc/starlight/tsconfig.json index 8bf91d3bb9..24dcf489bb 100644 --- a/doc/starlight/tsconfig.json +++ b/doc/starlight/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "astro/tsconfigs/strict", "include": [".astro/types.d.ts", "**/*"], - "exclude": ["dist"] + "exclude": ["dist"], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@components/*": ["src/components/*"], + }, + "types": ["astro/client", "astro/astro-jsx"] + } }