Skip to content

Commit

Permalink
feat: initiate actual content
Browse files Browse the repository at this point in the history
  • Loading branch information
its-darsh committed Sep 22, 2024
1 parent e354fe9 commit 6bf9f46
Show file tree
Hide file tree
Showing 22 changed files with 836 additions and 57 deletions.
55 changes: 6 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,13 @@
# Starlight Starter Kit: Tailwind

[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
npm create astro@latest -- --template starlight/tailwind
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/tailwind)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/tailwind)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/tailwind)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Ftailwind&project-name=my-starlight-docs&repository-name=my-starlight-docs)

> 🧑‍🚀 **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
├── tailwind.config.mjs
└── 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.
# Fabric Wiki

## 🧞 Commands
This is the source code for the new (WIP) wiki website for [Fabric](https://github.com/Fabric-Development/fabric)

All commands are run from the root of the project, from a terminal:
# Why?

| 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 |
While I think is that mdBook is **really** awesome when it comes to it as a markdown SSG, that's good and all but the issue with it is that I've found it too hard to do little to know customization.

## 👀 Want to learn more?
What pushed me to use Starlight is that its ability to use MDX and custom componenets which's an awesome feature and I see how it can improve how Fabric's wiki can look and feel.

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
So, I'm now committed to port the [existing wiki](https://github.com/Fabric-Development/fabric-wiki) (made using mdBook) over to Starlight and Astro!
10 changes: 8 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// @ts-check
import { prefixLinks } from "./src/plugins/CorrectURL";
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import tailwind from "@astrojs/tailwind";

import react from "@astrojs/react";


const BASE_URL = "fabric-wiki";

// https://astro.build/config
export default defineConfig({
base: "/fabric-wiki",
base: "/" + BASE_URL,
trailingSlash: "always",
markdown: {
remarkPlugins: [prefixLinks({ base: "/" + BASE_URL + "/" })],
},
integrations: [
starlight({
title: "Fabric",
Expand Down
11 changes: 10 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
"@types/react": "^18.3.6",
"@types/react-dom": "^18.3.0",
"astro": "^4.15.3",
"mdast": "^3.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-parallax-tilt": "^1.7.239",
"sharp": "^0.32.5",
"tailwindcss": "^3.4.4",
"typescript": "^5.6.2"
"typescript": "^5.6.2",
"unist-util-visit": "^5.0.0"
}
}
Binary file added public/assets/first-widget-box-help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/first-widget-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/first-widget-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/first-widget-label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions src/content/docs/guide/code-style-guide.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Code Style
sidebar:
order: 99999
---

This is the style guide of our project; here, we'll walk you through how can you write silk-looking code that will integrate nicely into our codebase.

## Code Formatting
All code should be formatted using [the ruff python formatter](https://github.com/astral-sh/ruff).

Indentation must be 4 **spaces**. Please do not use tabs or any number other than 4 spaces.

## Definitions and Naming
We employ different naming conventions based on use cases:
- `snake_case`: Functions or variables
- `SCREAMING_SNAKE_CASE`: Constants
- `PascalCase`: Classes
- `kebab-case`: GObject signals/properties

## Comments
Follow the [PEP 8](https://peps.python.org/pep-0008/) guidelines when adding comments. In a nutshell, comments should look:
```python
# Like this.

##not like this..##
#nor like this..
#--/ nor whatever else. /--#
```

## Logging
Logging functionality should use [loguru](https://github.com/Delgan/loguru). Adhere to these rules:
- Be concise; avoid verbosity.
- Refrain from committing files with `debug`-level log statements.
- Reserve the log level `error` for critical cases, such as severe component failures or dependencies crucial to the entire program.
- Avoid unnecessary `info` statements in low-level classes/modules, unless it's a service subclass.

If uncertain about where to log, feel free to inquire in the pull request!

## Conditionals
We use inline if-statements in our codebase if the condition will change the value of only one object:

```python
x = "the x object" if unexpected_feature is not True else "the x man"
```

And we use regular if statements if a block of code will be executed instead of one object being changed:
```python
if unexpected_feature is True:
x = "the unknown guy"
y = "idk"
z = 4002
...

# This is much more concise and clear than
x = "the unknown guy" if unexcpected_feature is True else None
y = "idk" if unexcpected_feature is True else None
z = 4002 if unexcpected_feature is True else None
```

## Commit Messages
Commits in Fabric should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. In a nutshell, structure commits like this:
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
For example:
```
feat: Add `balloons` argument to `Universe.celebrating_koalas`
```
```
fix: Check for fradulent koalas before allocating balloons
```

Types can be `feat`, `fix`, or others. For more examples and information on things like breaking changes, visit the specification.

## Logging The Changes

When you're finally done working on your commits and everything is ready, just add information about the commit(s) you made to the `CHANGELOG.md` file describing the changes made in a simple language and a small amount of characters. For example:

```
-- Format --
<Change-Number>. <#Pull-Request-Number> <Commit-Message>
-- Examples --
1. <#Pull-Request-Number> feat: something awesome!
2. <#Pull-Request-Number> feat: new method to do magic!
3. <#Pull-Request-Number> fix: fabricated, this fixes/closes <issue number if exists>!
4. refactor: i dunno how to fabricate XD
```
55 changes: 55 additions & 0 deletions src/content/docs/guide/development-environment.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: 'Setting up a hacking Environment'
sidebar:
order: 9999
---

import { Aside } from '@astrojs/starlight/components';

This page will walk you through setting up your development environment for Fabric.

# Fabric Source
To start developing, you should grab the latest commit of Fabric so that you're up-to-date.

To do this, run this command:
```bash
git clone https://github.com/Fabric-Development/fabric
```

<Aside>
Cloning the source repository this way will create a new folder in your current working directory.

You can then change your directory into this newly created clone.
```bash
cd fabric
```
</Aside>

# Virtual Environment
<Aside>
You can continue inside an integrated terminal now if you prefer. For this example, we use VSCode:

```bash
code .
```
</Aside>

Create a Python virtual environment:
```bash
python -m venv venv
```

Source your new virtual environment:
```bash
source venv/bin/activate
```

We now have a separate environment for packages.

Finally, install the current Fabric source in place as a package:
```bash
pip install -r requirements.txt
pip install -e .
```

And you're ready! Continue on [this page](./hacking-guide.mdx) to start hacking.
3 changes: 0 additions & 3 deletions src/content/docs/guide/example.mdx

This file was deleted.

Loading

0 comments on commit 6bf9f46

Please sign in to comment.