Skip to content

Commit

Permalink
fixed styling on the docs, changed location of the install instructio…
Browse files Browse the repository at this point in the history
…ns, added detailed instructions for Windows.
  • Loading branch information
onrirr committed Jan 26, 2024
1 parent 92e14b5 commit 5f92a69
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 36 deletions.
46 changes: 30 additions & 16 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
"guide/my-first-project/index.mdx": {
id: "guide/my-first-project/index.mdx";
slug: "guide/my-first-project";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
"references/build-system/commands.md": {
id: "references/build-system/commands.md";
slug: "references/build-system/commands";
Expand Down Expand Up @@ -479,41 +486,48 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"references/index.mdx": {
id: "references/index.mdx";
slug: "references";
"references/getting-started/allfeatures.md": {
id: "references/getting-started/allfeatures.md";
slug: "references/getting-started/allfeatures";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
"references/installing/allfeatures.md": {
id: "references/installing/allfeatures.md";
slug: "references/installing/allfeatures";
} & { render(): Render[".md"] };
"references/getting-started/firstproject.md": {
id: "references/getting-started/firstproject.md";
slug: "references/getting-started/firstproject";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"references/installing/firstproject.md": {
id: "references/installing/firstproject.md";
slug: "references/installing/firstproject";
"references/getting-started/prebuilt-binaries.md": {
id: "references/getting-started/prebuilt-binaries.md";
slug: "references/getting-started/prebuilt-binaries";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"references/installing/primer.md": {
id: "references/installing/primer.md";
slug: "references/installing/primer";
"references/getting-started/primer.md": {
id: "references/getting-started/primer.md";
slug: "references/getting-started/primer";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"references/installing/setup.md": {
id: "references/installing/setup.md";
slug: "references/installing/setup";
"references/getting-started/setup.md": {
id: "references/getting-started/setup.md";
slug: "references/getting-started/setup";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"references/index.mdx": {
id: "references/index.mdx";
slug: "references";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".mdx"] };
};

};
Expand Down
21 changes: 13 additions & 8 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { defineConfig } from 'astro/config';
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import starlight from '@astrojs/starlight';
import starlight from "@astrojs/starlight";

// https://astro.build/config
export default defineConfig({
site: 'https://c3-web.github.io',
base: '/c3-web',
integrations: [tailwind(), starlight({
title: "The C3 Handbook"
})],
});
site: "https://c3-web.github.io",
base: "/c3-web",
integrations: [
tailwind({
applyBaseStyles: false,
}),
starlight({
title: "The C3 Handbook",
}),
],
});
3 changes: 3 additions & 0 deletions src/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
22 changes: 20 additions & 2 deletions src/content/docs/guide/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,23 @@ sidebar:
order: 1
---

Hello traveler, welcome to the C3 Guide. This is a guide to the C3 Programming Language,
its syntax, and its features and much more.
Hello, the C3 Guide is a guide to the C3 Programming Language. It is a work in progress, and will be continually updated.

## What is C3?

C3 is a system programming language based on C. It is an evolution of C enabling the same paradigms and
retaining the same syntax as far as possible.

## Features

- Full C ABI compatibility
- Module system
- Generic modules
- Zero overhead errors
- Struct subtyping
- Semantic macro system
- Safe array access using sub arrays
- Zero cost simple gradual & opt-in pre/post conditions
- High level containers and string handling
- LLVM backend

14 changes: 14 additions & 0 deletions src/content/docs/guide/my-first-project/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: My first C3 Project
description: Learn to create your first c3 project
sidebar:
order: 2
---

Let's create our first C3 project. We will create a simple calculator app that will add two numbers.

But before that we need to install C3C, the compiler for C3.

:::note[Haven't installed C3C yet?]

You can follow [this link]() for a more in-depth guide on installing the compiler.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions src/content/docs/references/getting-started/prebuilt-binaries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: Installing C3C
description: How to set up the C3 compiler
sidebar:
order: 3
---

You can use one of the precompiled binaries or [Build the compiler from source](/c3-web/references/getting-started/setup).

# Prebuilt binaries
- Windows x64 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-windows.zip), [install instructions](https://github.com/c3lang/c3c#installing-on-windows-with-precompiled-binaries).
- Debian x64 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-linux.tar.gz), [install instructions](https://github.com/c3lang/c3c#installing-on-debian-with-precompiled-binaries).
- MacOS x64 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-macos.zip), [install instructions](https://github.com/c3lang/c3c#installing-on-mac-with-precompiled-binaries).

## Installing on Windows
1. Download the zip file: [stable](https://github.com/c3lang/c3c/releases/download/latest/c3-windows.zip) [debug](https://github.com/c3lang/c3c/releases/download/latest/c3-windows-debug.zip)
2. Unzip it into a folder
3. If you don't have Visual Studio 17 installed you can either install it or follow the next two steps.

4. Run the `install_win_reqs.bat` file.

5. Run the `msvc_build_libraries.py` Python script which will download the necessary files to compile on Windows.

:::note[Running the Python script]

If you don't have Python installed, you can download it from [the Python Website](https://www.python.org/downloads/).
or get it from the [the Microsoft Store](https://www.microsoft.com/en-us/p/python-39/9p7qfqmjrfp7)

afterwards you can double click the python file and pick "python" from the list.
![Python](./image.png)

:::


6. copy the folder
7. navigate to `C:\Program Files`
8. paste the folder here
9. navigate inside the folder you've pasted
10. copy the path of the folder
11. search for "edit the system environment variables" on your computer
12. click on the "environment variables" button on the bottom right
13. under "user variables" double click on "path"
14. click on "new" and paste the path to the folder
15. run `c3c` on anywhere in your computer!

## Installing on Debian
1. Download tar file: [https://github.com/c3lang/c3c/releases/download/latest/c3-linux.tar.gz](https://github.com/c3lang/c3c/releases/download/latest/c3-linux.tar.gz)
(debug version [here](https://github.com/c3lang/c3c/releases/download/latest/c3-linux-debug.tar.gz))
2. Unpack executable and standard lib.
3. Run `./c3c`.

## Installing on Mac
1. Make sure you have XCode with command line tools installed.
2. Download the zip file: [https://github.com/c3lang/c3c/releases/download/latest/c3-macos.zip](https://github.com/c3lang/c3c/releases/download/latest/c3-macos.zip)
(debug version [here](https://github.com/c3lang/c3c/releases/download/latest/c3-macos-debug.zip))
3. Unzip executable and standard lib.
4. Run `./c3c`.

## Installing on Arch Linux
There is an AUR package for the c3c compiler : [c3c-git](https://aur.archlinux.org/packages/c3c-git).

Due to some issues with the LLVM packaged for Arch Linux, the AUR package will download and use LLVM 16 for Ubuntu-23.04 to compile the c3c compiler.

You can use your AUR package manager:
```sh
paru -S c3c-git
# or yay -S c3c-git
# or aura -A c3c-git
```

Or clone it manually:
```sh
git clone https://aur.archlinux.org/c3c-git.git
cd c3c-git
makepkg -si
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Setup
title: Building C3
description: How to set up the C3 compiler
sidebar:
order: 3
Expand Down Expand Up @@ -50,3 +50,30 @@ MyMachine:c3c/build$ make
MyMachine:c3c/build$ ./c3c compile-run ../resources/testfragments/helloworld.c3
```

# Building via Docker

You can build `c3c` using either an Ubuntu 18.04 or 20.04 container:

```
./build-with-docker.sh 18
```

Replace `18` with `20` to build through Ubuntu 20.04.

For a release build specify:
```
./build-with-docker.sh 20 Release
```

A `c3c` executable will be found under `bin/`.

# Building on OS X using Homebrew

2. Install CMake: `brew install cmake`
3. Install LLVM 15: `brew install llvm`
4. Clone the C3C github repository: `git clone https://github.com/c3lang/c3c.git`
5. Enter the C3C directory `cd c3c`.
6. Create a build directory `mkdir build`
7. Change directory to the build directory `cd build`
8. Set up CMake build for debug: `cmake ..`
9. Build: `cmake --build .`
1 change: 1 addition & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Community from "../components/community.astro";
import "boxicons";
import "../../public/preline.min.js";
import "../../public/overlay.min.js";
import "../base.css";
</script>
</head>

Expand Down
13 changes: 4 additions & 9 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
module.exports = {
content: [
"./index.html",
"./src/**/*.{astro,js,ts,jsx,tsx}",
],
darkMode : 'class',
plugins: [
require('preline/plugin'),
]
}
content: ["./index.html", "./src/**/*.{astro,js,ts,jsx,tsx}"],
darkMode: "class",
plugins: [require("preline/plugin")],
};

0 comments on commit 5f92a69

Please sign in to comment.