Merge branch 'astro' into 'main'

Astro

See merge request pls5618/docs!1
This commit is contained in:
Olivier Demers 2023-09-02 18:51:34 +00:00
commit bbfc79c80a
39 changed files with 4243 additions and 11155 deletions

31
.gitignore vendored
View File

@ -1,20 +1,21 @@
# Dependencies # build output
/node_modules dist/
# generated types
.astro/
# Production # dependencies
/build node_modules/
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# logs
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store

View File

@ -21,4 +21,4 @@ deploy:
- ncftpput -R -u "$ftp_user" -p "$ftp_pass" pls5618.com docs build/* - ncftpput -R -u "$ftp_user" -p "$ftp_pass" pls5618.com docs build/*
environment: environment:
name: docs name: docs
url: https://docs.pls5618.com url: https://docs.pls5618.com

51
README.md Normal file
View File

@ -0,0 +1,51 @@
# Starlight Starter Kit: Basics
```
npm create astro@latest -- --template starlight
```
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## 🚀 Project Structure
Inside of your Astro + Starlight project, you'll see the following folders and files:
```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
Static assets, like favicons, can be placed in the `public/` directory.
## 🧞 Commands
All commands are run from the root of the project, from a terminal:
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
## 👀 Want to learn more?
Check out [Starlights docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

33
astro.config.mjs Normal file
View File

@ -0,0 +1,33 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: 'Documentation PLS5618',
sidebar: [
{
label: 'Java',
autogenerate: { directory: 'java' },
},
{
label: 'Robot',
items: [
{ label: "Débuter", autogenerate: { directory: "robot/debuter" } },
{ label: "Nouveau Projet", autogenerate: { directory: "robot/nouveau_projet" } }
],
},
],
locales: {
root: {
label: "Français",
lang: "fr",
},
}
}),
],
// Process images with sharp: https://docs.astro.build/en/guides/assets/#using-sharp
image: { service: { entrypoint: 'astro/assets/services/sharp' } },
});

View File

@ -1,3 +0,0 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};

View File

@ -1,146 +0,0 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Doc PLS5618",
tagline: "Documentation PLS5618",
favicon: "img/favicon.ico",
// Set the production url of your site here
url: "https://docs.pls5618.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "fr",
locales: ["fr"],
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
plugins: [
[
"@docusaurus/plugin-content-docs",
{
id: "java",
path: "java",
routeBasePath: "java",
sidebarPath: require.resolve("./sidebars.js"),
},
],
[
"@docusaurus/plugin-content-docs",
{
id: "robot",
path: "robot",
routeBasePath: "robot",
sidebarPath: require.resolve("./sidebars2.js"),
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: "img/logo.png",
navbar: {
title: "PLS 5618",
logo: {
alt: "PLS 5618",
src: "img/logo.png",
},
items: [
{
type: "doc",
docId: "index",
position: "left",
label: "Java",
docsPluginId: "java",
},
{
type: "doc",
docId: "index",
position: "left",
label: "Robot",
docsPluginId: "robot",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Documentation",
items: [
{
label: "Java",
to: "/java",
},
{
label: "Robot",
to: "/robot",
},
],
},
{
title: "Communauté",
items: [
{
label: "Facebook",
href: "https://www.facebook.com/PLS5618",
},
{
label: "Twitter",
href: "https://twitter.com/pls5618",
},
{
label: "Instagram",
href: "https://www.instagram.com/team5618",
},
{
label: "Site Internet",
href: "https://pls5618.com/",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} PLS 5618. Fait avec Docusaurus.`,
},
prism: {
additionalLanguages: ["java", "groovy"],
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
algolia: {
appId: "FWL5E6J51N",
apiKey: "311ff1b7dfe8b50e47c8f1b58617356d",
indexName: "pls5618",
contextualSearch: true,
},
}),
};
module.exports = config;

View File

@ -1 +0,0 @@
# Classes

View File

@ -1,8 +0,0 @@
---
sidebar_position: 1
---
# Introduction
Pour programmer le robot, nous utilisons le langage de programmation **Java**.
Dans cette section, vous allez apprendre les bases de Java.

View File

@ -1 +0,0 @@
# Syntaxe

View File

@ -1 +0,0 @@
# Try-Catch

14827
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +1,17 @@
{ {
"name": "docs", "name": "pls-docs",
"version": "0.0.0", "type": "module",
"private": true, "version": "0.0.1",
"scripts": { "scripts": {
"docusaurus": "docusaurus", "dev": "astro dev",
"start": "docusaurus start", "start": "astro dev",
"build": "docusaurus build", "build": "astro build",
"swizzle": "docusaurus swizzle", "preview": "astro preview",
"deploy": "docusaurus deploy", "astro": "astro"
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "^2.4.0", "@astrojs/starlight": "^0.9.0",
"@docusaurus/plugin-content-docs": "^2.4.0", "astro": "^3.0.6",
"@docusaurus/preset-classic": "^2.4.0", "sharp": "^0.32.5"
"@docusaurus/theme-search-algolia": "^2.4.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/eslint-plugin": "^2.4.0",
"@docusaurus/module-type-aliases": "^2.4.0"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=16.14"
} }
} }

1
public/favicon.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill-rule="evenodd" d="M81 36 64 0 47 36l-1 2-9-10a6 6 0 0 0-9 9l10 10h-2L0 64l36 17h2L28 91a6 6 0 1 0 9 9l9-10 1 2 17 36 17-36v-2l9 10a6 6 0 1 0 9-9l-9-9 2-1 36-17-36-17-2-1 9-9a6 6 0 1 0-9-9l-9 10v-2Zm-17 2-2 5c-4 8-11 15-19 19l-5 2 5 2c8 4 15 11 19 19l2 5 2-5c4-8 11-15 19-19l5-2-5-2c-8-4-15-11-19-19l-2-5Z" clip-rule="evenodd"/><path d="M118 19a6 6 0 0 0-9-9l-3 3a6 6 0 1 0 9 9l3-3Zm-96 4c-2 2-6 2-9 0l-3-3a6 6 0 1 1 9-9l3 3c3 2 3 6 0 9Zm0 82c-2-2-6-2-9 0l-3 3a6 6 0 1 0 9 9l3-3c3-2 3-6 0-9Zm96 4a6 6 0 0 1-9 9l-3-3a6 6 0 1 1 9-9l3 3Z"/><style>path{fill:#000}@media (prefers-color-scheme:dark){path{fill:#fff}}</style></svg>

After

Width:  |  Height:  |  Size: 696 B

View File

@ -1,5 +0,0 @@
---
sidebar_position: 2
---
# Créer un projet

View File

@ -1,7 +0,0 @@
---
sidebar_position: 2
---
# Premier Projet
Dans cette section, vous apprendrez comment installer le logiciel de programmation et comment créer un projet.

View File

@ -1,10 +0,0 @@
---
sidebar_position: 1
---
# Introduction
Comme vous l'aurez compris avec la section [Java](../java/), un robot _FRC_ peut être programmé en Java.
Il peut aussi être programmé en _C++_, _LabView_ ou _Python_, mais nous avons choisi _Java_ pour sa simplicité et sa robustesse.
Dans cette section, vous apprendrez comment programmer un robot _FRC_ en _Java_ en utilisant la bibliothèque [WPILib](https://docs.wpilib.org/)

View File

@ -1,5 +0,0 @@
---
sidebar_position: 3
---
# Nouveau Projet

View File

@ -1,33 +0,0 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
};
module.exports = sidebars;

View File

@ -1,6 +0,0 @@
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],
};
module.exports = sidebars;

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

7
src/content/config.ts Normal file
View File

@ -0,0 +1,7 @@
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
export const collections = {
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
};

15
src/content/docs/index.md Normal file
View File

@ -0,0 +1,15 @@
---
title: Documentation PLS5618
template: splash
hero:
title: Documentation de PLS 5618
actions:
- text: Java
link: /java/
variant: primary
- text: Robot
link: /robot/
variant: primary
---

View File

@ -0,0 +1,4 @@
---
title: Classes
---

View File

@ -0,0 +1,4 @@
---
title: Syntaxe
lang: fr
---

View File

@ -0,0 +1,3 @@
---
title: Try-Catch
---

View File

@ -1,8 +1,10 @@
--- ---
sidebar_position: 2 title: Variables et Types
lang: fr
sidebar:
order: 2
--- ---
# Variables et Types
En Java, comme dans plusieurs langagues de programmation, l'information est stockée dans des [variables](#variables). Ces variables ont toutes un [type](#types), qui permet de déterminer ce qu'elles peuvent contenir. En Java, comme dans plusieurs langagues de programmation, l'information est stockée dans des [variables](#variables). Ces variables ont toutes un [type](#types), qui permet de déterminer ce qu'elles peuvent contenir.

View File

@ -0,0 +1,8 @@
---
title: Créer un projet
lang: fr
sidebar:
order: 2
---

View File

@ -1,8 +1,10 @@
--- ---
sidebar_position: 1 title: Installation
lang: fr
sidebar:
order: 1
--- ---
# Installation
Pour programmer un robot _FRC_, nous avons plusieurs choses à installer: Pour programmer un robot _FRC_, nous avons plusieurs choses à installer:

View File

@ -1,8 +1,10 @@
--- ---
sidebar_position: 2 title: Installer AdvantageKit
lang: fr
sidebar:
order: 2
--- ---
# Installer AdvantageKit
AdvantageKit permet de recevoir plus d'information du robot, ce qui nous aidera à debug. AdvantageKit permet de recevoir plus d'information du robot, ce qui nous aidera à debug.

View File

@ -1,8 +1,10 @@
--- ---
sidebar_position: 1 title: Bibliothèques de composants
lang: fr
sidebar:
order: 1
--- ---
# Bibliothèques de composants
NavX NavX

View File

@ -1,8 +1,10 @@
--- ---
sidebar_position: 3 title: YAGSL (Swerve)
lang: fr
sidebar:
order: 3
--- ---
# YAGSL (Swerve)
[Yet Another Generic Swerve Library](https://github.com/BroncBotz3481/YAGSL) permet de facilement créer un sous-système swerve pour un robot. [Yet Another Generic Swerve Library](https://github.com/BroncBotz3481/YAGSL) permet de facilement créer un sous-système swerve pour un robot.

View File

@ -1,30 +0,0 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #189ad6;
--ifm-color-primary-dark: #1275a3;
--ifm-color-primary-darker: #0c506f;
--ifm-color-primary-darkest: #0c192e;
--ifm-color-primary-light: #1cb5fc;
--ifm-color-primary-lighter: #1ca8ff;
--ifm-color-primary-lightest: #1c98ff;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}
/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #189ad6;
--ifm-color-primary-dark: #1275a3;
--ifm-color-primary-darker: #0c506f;
--ifm-color-primary-darkest: #0c192e;
--ifm-color-primary-light: #1cb5fc;
--ifm-color-primary-lighter: #1ca8ff;
--ifm-color-primary-lightest: #1c98ff;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

2
src/env.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

View File

@ -1,44 +0,0 @@
import React from "react";
import clsx from "clsx";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import styles from "./index.module.css";
import Link from "@docusaurus/Link";
import Head from "@docusaurus/Head";
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx("hero hero--primary", styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link className="button button--secondary button--lg" to="/java">
<i class="fa-brands fa-java"></i> Java
</Link>
<Link className="button button--secondary button--lg" to="/robot">
<i class="fa-solid fa-robot"></i> Robot
</Link>
</div>
</div>
</header>
);
}
export default function Home() {
const { siteConfig } = useDocusaurusContext();
return (
<Layout title={`${siteConfig.title}`} description="Documentation PLS 5618">
<Head>
<script
src="https://kit.fontawesome.com/9e215b042a.js"
crossorigin="anonymous"
></script>
</Head>
<HomepageHeader />
<main></main>
</Layout>
);
}

View File

@ -1,24 +0,0 @@
/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/
.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
overflow: hidden;
}
@media screen and (max-width: 996px) {
.heroBanner {
padding: 2rem;
}
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

3
tsconfig.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "astro/tsconfigs/strict"
}