-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
836 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,13 @@ | ||
# Starlight Starter Kit: Tailwind | ||
|
||
[](https://starlight.astro.build) | ||
|
||
``` | ||
npm create astro@latest -- --template starlight/tailwind | ||
``` | ||
|
||
[](https://stackblitz.com/github/withastro/starlight/tree/main/examples/tailwind) | ||
[](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/tailwind) | ||
[](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/tailwind) | ||
[](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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.