From 6af9d6851c25a88851a55b7c93216b2ce6d68d86 Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Sun, 1 Oct 2023 21:57:24 +1300 Subject: [PATCH] chore: cleanup some typos and wording --- CONTRIBUTING.md | 2 +- astro.config.mjs | 19 ++- src/components/about-tuhura.astro | 7 +- src/content/docs/guides/about.md | 10 ++ .../docs/guides/git/{basics.md => basics.mdx} | 35 ++-- .../docs/guides/javascript/setting-up.mdx | 2 +- src/content/docs/guides/python/setting-up.mdx | 154 ------------------ src/content/docs/index.mdx | 2 +- src/content/docs/ncea/about.md | 10 ++ src/content/docs/ncea/level-2/about.md | 8 + src/content/docs/ncea/level-3/about.md | 8 + src/content/docs/tuhura-tech/contributing.md | 8 + .../docs/tuhura-tech/infrastructure.md | 6 + tailwind.config.cjs | 2 +- 14 files changed, 99 insertions(+), 174 deletions(-) create mode 100644 src/content/docs/guides/about.md rename src/content/docs/guides/git/{basics.md => basics.mdx} (77%) delete mode 100644 src/content/docs/guides/python/setting-up.mdx create mode 100644 src/content/docs/ncea/about.md create mode 100644 src/content/docs/ncea/level-2/about.md create mode 100644 src/content/docs/ncea/level-3/about.md create mode 100644 src/content/docs/tuhura-tech/contributing.md create mode 100644 src/content/docs/tuhura-tech/infrastructure.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 97115d5b..20c465e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,4 +2,4 @@ ## Setup -This project uses pnpm to manage my dependencies. Run `pnpm install` to setup and `pnpm dev` to run a dev environment. \ No newline at end of file +This project uses pnpm to manage dependencies. Run `pnpm install` to setup and `pnpm dev` to run a dev environment. diff --git a/astro.config.mjs b/astro.config.mjs index a1514394..df5839d8 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -25,22 +25,35 @@ export default defineConfig({ logo: { light: './src/assets/logo-light.png', dark: './src/assets/logo-dark.png', + replacesTitle: true, }, social: { github: 'https://github.com/Tuhura-Tech/Wiki', discord: 'https://discord.gg/PNxh7cwKfQ', }, editLink: { - baseUrl: 'https://github.com/Tuhura-Tech/Wiki/edit/main/docs/', + baseUrl: 'https://github.com/Tuhura-Tech/Wiki/blob/main/', }, sidebar: [ { label: 'Guides', - autogenerate: { directory: 'guides' }, + items: [ + { label: "About our Guides", link: 'guides/about' }, + { label: "Javascript", autogenerate: { directory: 'guides/javascript' } }, + // { label: "Python", autogenerate: { directory: 'guides/python' } }, + { label: "Git", autogenerate: { directory: 'guides/git' } }, + { label: "Cybersecurity", autogenerate: { directory: 'guides/cybersecurity' } }, + + ] }, { label: 'NCEA Resources', - autogenerate: { directory: 'ncea' }, + items: [ + { label: "About our Resources", link: 'guides/about' }, + { label: "NCEA Level 2", autogenerate: { directory: 'ncea/level-2' } }, + { label: "NCEA Level 3", autogenerate: { directory: 'ncea/level-3' } }, + + ] }, { label: 'Projects', diff --git a/src/components/about-tuhura.astro b/src/components/about-tuhura.astro index 0a7b0406..34afdddc 100644 --- a/src/components/about-tuhura.astro +++ b/src/components/about-tuhura.astro @@ -1,4 +1,7 @@ --- +import { Image } from "astro:assets"; +import logoIcon from "./../assets/logo.svg"; + interface Props { title: string; } @@ -6,8 +9,8 @@ interface Props { const { title } = Astro.props; --- -
- +
+ {title} Tūhura Tech diff --git a/src/content/docs/guides/about.md b/src/content/docs/guides/about.md new file mode 100644 index 00000000..a48fc703 --- /dev/null +++ b/src/content/docs/guides/about.md @@ -0,0 +1,10 @@ +--- +title: About our Guides +description: About the guides in this wiki. + +sidebar: + # Make this always the first + order: 1 +--- + +As part of our mission we make our resources and guides public which you can use to learn new topics. diff --git a/src/content/docs/guides/git/basics.md b/src/content/docs/guides/git/basics.mdx similarity index 77% rename from src/content/docs/guides/git/basics.md rename to src/content/docs/guides/git/basics.mdx index 5d475eda..e04fd7b5 100644 --- a/src/content/docs/guides/git/basics.md +++ b/src/content/docs/guides/git/basics.mdx @@ -3,23 +3,37 @@ title: Basics description: This is a page in my Starlight-powered site --- +import { Tabs, TabItem } from "@astrojs/starlight/components"; + ## Installing Git -::: code-group + + -```sh [Chocolatey] -choco install git -``` +**Debian/Ubuntu** -```sh [Homebrew] -brew install git -``` - -```sh [Debian] +```sh sudo apt install git ``` -::: +For other distros look at the git documentation found [here](https://git-scm.com/download/linux). + + + + + ```sh + brew install git + ``` + + + + + ```sh + winget install --id Git.Git -e --source winget + ``` + + + ## Creating a git repository @@ -44,7 +58,6 @@ Once a change has been saved to staging we can commit ("save") that change to ve ## Git Remotes (GitHub/GitLab/ForgeJo) - ## Reverting Changes ## Branches and Pull Requests diff --git a/src/content/docs/guides/javascript/setting-up.mdx b/src/content/docs/guides/javascript/setting-up.mdx index ecf17b4e..d374da32 100644 --- a/src/content/docs/guides/javascript/setting-up.mdx +++ b/src/content/docs/guides/javascript/setting-up.mdx @@ -1,6 +1,6 @@ --- title: Setting Up -description: This is a page in my Starlight-powered site +description: This is how to setup a JavaScript enfironment. --- import { Tabs, TabItem } from "@astrojs/starlight/components"; diff --git a/src/content/docs/guides/python/setting-up.mdx b/src/content/docs/guides/python/setting-up.mdx deleted file mode 100644 index 71fe1208..00000000 --- a/src/content/docs/guides/python/setting-up.mdx +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: Setting Up -description: This is a page in my Starlight-powered site ---- - -import { Tabs, TabItem } from "@astrojs/starlight/components"; - -There are many ways to set up your Python environment with different advantages and disadvantages. This guide will help you get fully setup to start coding in Python. - -## Local development - -This is the most flexible option as you can use any IDE you want and does not rely on an internet connection. This should be done on your personal computer and not on a school computer. This option also has the most complexity and learning due to all advanced features being available immediately. To use this option you will need to install Python and a code editor. You can download Python from the [Python website](https://www.python.org/downloads/). You can use any code editor you want, but we recommend [Visual Studio Code](https://code.visualstudio.com/). - -### Installing Python - -There are multiple ways to install Python, but the easiest way is to download the latest version from the [Python website](https://www.python.org/downloads/). Once you have downloaded the installer you can run it and follow the instructions to install Python. - -You can also install python using a package manager for a more advanced setup. If you are using macOS you can use [Homebrew](https://brew.sh) to install Python. If you are using Linux you can use your package manager to install Python. If you are using Windows you can use [Chocolatey](https://chocolatey.org) to install Python. - - - - - -```sh -choco install python -``` - - - - -```sh -brew install python -``` - - - - -```sh -sudo apt install python3 -``` - - - - -```sh -asdf plugin add python -asdf install python latest -``` - - - - -:::tip[Not sure how to run commands?] -If you are not sure how to run commands we recommend installing python using the installer from the [Python website](https://www.python.org/downloads/). -::: - -Once you have installed Python you can check that it has installed correctly by running the following command: - -```sh -python --version -``` - -:::note[How to run commands on your computer] -To run commands on your computer you will need to open a terminal. On macOS and Linux you can open a terminal by pressing `⌘ + Space` and typing `Terminal`. On Windows you can open a terminal by pressing `⊞ + Space` and typing `Terminal`. You can then run the command by typing it into the terminal and pressing `Enter`. The `$` is not part of the command and is just used to show that it is a command. You should not type the `$` when running the command. -::: - -You should get an output similar to the following: - -```sh -Python 3.11.1 -``` - -### Setting up a project - -To set up a project you will need to create a new folder for your project. You can then open this folder in your code editor. You will also need to setup the virtual environment for your project. You can do this by running the following command: - -```sh -poetry init -``` - -This will create a `pyproject.toml` file in your project folder. This file contains all the information about your project and is used by Python Poetry to manage your project. You can then install libraries using Python Poetry. - -### Adding libraries - -You can add libraries to your project by running the following command: - -```sh -poetry add -``` - -## Next steps - -### Using Python Poetry - -### Useful libraries - -There are several libraries that are useful when programming in Python and can help with either style/formatting or type checking. - -#### Style and formatting - -These libraries help with formatting and style of your code, they can be used to automatically format your code to a standard style and can also be used to check your code for style errors. They should be added to your style dependencies using the below commands. - -- [Black Formatter](https://black.readthedocs.io/en/stable/) -- [Flake8](https://flake8.pycqa.org/en/latest/) - -You can add them by running the following commands: - -```sh -poetry add black flake8 --group test -``` - -##### Using Black Formatter - -Black is a Python formatter that will automatically format your code to a standard style. You can run Black by running the following command: - -```sh -poetry run black . -``` - -##### Using Flake8 - -Flake8 is a Python linter that will check your code for style errors. You can run Flake8 by running the following command: - -```sh -poetry run flake8 . -``` - -#### Type checking - -These libraries help with type checking your code, they can be used to check your code for type errors. They should be added to the test dependencies using the below commands. - -- [MyPy](https://mypy.readthedocs.io/en/stable/) - -You can add them by running the following command: - -```sh -poetry add mypy --group test -``` - -##### Using MyPy - -MyPy is a Python type checker that will check your code for type errors. You can run MyPy by running the following command: - -```sh -poetry run mypy . -``` - -## Useful resources - -- [Python documentation](https://docs.python.org/3/) -- [Python Poetry](https://python-poetry.org) -- [Black Formatter](https://black.readthedocs.io/en/stable/) -- [Flake8](https://flake8.pycqa.org/en/latest/) -- [MyPy](https://mypy.readthedocs.io/en/stable/) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index f6717233..83beb616 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -8,7 +8,7 @@ hero: file: ../../assets/logo.svg actions: - text: Our guides - link: ./guides/cybersecurity/competitions + link: ./guides/about icon: right-arrow variant: primary - text: Our Website diff --git a/src/content/docs/ncea/about.md b/src/content/docs/ncea/about.md new file mode 100644 index 00000000..ee0d64f0 --- /dev/null +++ b/src/content/docs/ncea/about.md @@ -0,0 +1,10 @@ +--- +title: About our Resources +description: About the NCEA resources in this wiki. + +sidebar: + # Make this always the first + order: 1 +--- + +These are a collection of resources that can be used for courses that relate to NCEA. diff --git a/src/content/docs/ncea/level-2/about.md b/src/content/docs/ncea/level-2/about.md new file mode 100644 index 00000000..6695ac30 --- /dev/null +++ b/src/content/docs/ncea/level-2/about.md @@ -0,0 +1,8 @@ +--- +title: About +description: About the guides in this wiki. + +sidebar: + # Make this always the first + order: 1 +--- \ No newline at end of file diff --git a/src/content/docs/ncea/level-3/about.md b/src/content/docs/ncea/level-3/about.md new file mode 100644 index 00000000..6695ac30 --- /dev/null +++ b/src/content/docs/ncea/level-3/about.md @@ -0,0 +1,8 @@ +--- +title: About +description: About the guides in this wiki. + +sidebar: + # Make this always the first + order: 1 +--- \ No newline at end of file diff --git a/src/content/docs/tuhura-tech/contributing.md b/src/content/docs/tuhura-tech/contributing.md new file mode 100644 index 00000000..b93ebea1 --- /dev/null +++ b/src/content/docs/tuhura-tech/contributing.md @@ -0,0 +1,8 @@ +--- +title: Contributing to this Wiki +description: Details on how to contribute to this Wiki +--- + +## Setup + +This project uses pnpm to manage dependencies. Run `pnpm install` to setup and `pnpm dev` to run a dev environment. \ No newline at end of file diff --git a/src/content/docs/tuhura-tech/infrastructure.md b/src/content/docs/tuhura-tech/infrastructure.md new file mode 100644 index 00000000..ff87f014 --- /dev/null +++ b/src/content/docs/tuhura-tech/infrastructure.md @@ -0,0 +1,6 @@ +--- +title: Our Infrastructure +description: Details on our public infrastructure +--- + +This is currently a WIP with the intention of it being fully open source and managed using GitOps. diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 23924b0f..5b561a22 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,7 +1,7 @@ const starlightPlugin = require('@astrojs/starlight-tailwind'); // Generated color palettes -const accent = { 200: '#aad7a0', 600: '#258100', 900: '#0d3e00', 950: '#072d00' }; +const accent = { 200: '#bbcfba', 600: '#427b42', 900: '#213921', 950: '#192819' }; const gray = { 100: '#f4f7f3', 200: '#eaf0e8', 300: '#bdc4bb', 400: '#82907f', 500: '#4f5c4d', 700: '#303c2d', 800: '#1f2a1c', 900: '#151a13' }; /** @type {import('tailwindcss').Config} */