Skip to content

Commit 4bdf015

Browse files
committed
feat(docs): add editor recipes and update guides
This commit introduces a new "recipes" section to the documentation, providing guides for integrating Mago with popular code editors and CI/CD pipelines. Updated Installation Guide: The installation documentation has been rewritten for clarity and now includes instructions for all supported methods (Shell, Homebrew, Composer, Cargo, Manual). Simplified README: The main README.md has been updated to be more concise, directing users to the official documentation for detailed installation instructions. Signed-off-by: azjezz <[email protected]>
1 parent 3ba3bab commit 4bdf015

File tree

22 files changed

+337
-72
lines changed

22 files changed

+337
-72
lines changed

README.md

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
## README.md
2+
13
<p align="center">
2-
<img src="assets/banner.svg" alt="Mago Banner" width="600" />
4+
<img src="docs/public/assets/banner.svg" alt="Mago Banner" width="600" />
35
</p>
46

57
<div align="center">
@@ -31,59 +33,27 @@
3133
- [Inspiration & Acknowledgements](#inspiration--acknowledgements)
3234
- [License](#license)
3335

34-
## How to Install
35-
36-
### Shell (Linux, macOS)
37-
38-
```sh
39-
# with curl
40-
curl --proto '=https' --tlsv1.2 -sSf https://carthage.software/mago.sh | bash
41-
42-
# with wget
43-
wget -qO- https://carthage.software/mago.sh | bash
44-
```
45-
46-
### Package Managers
47-
48-
#### Homebrew (macOS)
49-
50-
```sh
51-
brew install mago
52-
53-
mago self-update
54-
```
55-
56-
#### Composer (PHP Project)
57-
58-
```sh
59-
composer require --dev carthage-software/mago
60-
```
61-
62-
#### Cargo (Rust Toolchain)
63-
64-
```sh
65-
cargo install mago
66-
```
36+
## Installation
6737

68-
### Manual Download
38+
For detailed instructions on how to install Mago, please refer to our official **[Installation Guide](https://mago.carthage.software/guide/installation)**.
6939

70-
You can download pre-compiled binaries for your system from the [GitHub Releases](https://github.com/carthage-software/mago/releases) page.
40+
We support various installation methods, including shell scripts, Homebrew, Composer, and Cargo.
7141

7242
## Getting Started
7343

7444
Once installed, you can start using Mago immediately.
7545

7646
1. Lint your project:
7747

78-
```sh
79-
mago lint src/
80-
```
48+
```sh
49+
mago lint src/
50+
```
8151

8252
2. Format your code:
8353

84-
```sh
85-
mago format src/
86-
```
54+
```sh
55+
mago format src/
56+
```
8757

8858
For detailed usage, configuration options, and available rules, please visit the [Mago Documentation](https://mago.carthage.software/).
8959

@@ -111,7 +81,7 @@ Mago stands on the shoulders of giants. Our design and functionality are heavily
11181
### Inspirations:
11282

11383
- [Clippy](https://github.com/rust-lang/rust-clippy): For its comprehensive linting approach.
114-
- [OXC](https://github.com/oxc-project/oxc/): A major inspiration for building a high-performancetoolchain in Rust.
84+
- [OXC](https://github.com/oxc-project/oxc/): A major inspiration for building a high-performance toolchain in Rust.
11585
- [Hakana](https://github.com/slackhq/hakana/): For its deep static analysis capabilities.
11686

11787
### Acknowledgements:

docs/.vitepress/config.mts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { defineConfig } from "vitepress";
22

3+
// A placeholder for your site's domain
4+
const site = "https://mago.carthage.software";
5+
36
export default defineConfig({
47
srcDir: ".",
58

@@ -18,6 +21,30 @@ export default defineConfig({
1821
{ rel: "icon", href: "/assets/favicon-16x16.png", sizes: "16x16" },
1922
],
2023
["link", { rel: "icon", href: "/assets/favicon.ico" }],
24+
// Open Graph
25+
["meta", { property: "og:type", content: "website" }],
26+
["meta", { property: "og:title", content: "Mago" }],
27+
[
28+
"meta",
29+
{
30+
property: "og:description",
31+
content:
32+
"The Oxidized PHP Toolchain: Blazing fast linter, formatter, and static analyzer for PHP, written in Rust.",
33+
},
34+
],
35+
["meta", { property: "og:image", content: `${site}/assets/banner.svg` }],
36+
["meta", { property: "og:url", content: site }],
37+
["meta", { name: "twitter:card", content: "summary_large_image" }],
38+
["meta", { name: "twitter:title", content: "Mago" }],
39+
[
40+
"meta",
41+
{
42+
name: "twitter:description",
43+
content:
44+
"The Oxidized PHP Toolchain: Blazing fast linter, formatter, and static analyzer for PHP, written in Rust.",
45+
},
46+
],
47+
["meta", { name: "twitter:image", content: `${site}/assets/banner.svg` }],
2148
],
2249
lastUpdated: true,
2350
cleanUrls: true,
@@ -149,6 +176,16 @@ export default defineConfig({
149176
},
150177
],
151178
},
179+
{
180+
text: "🧩 Recipes",
181+
collapsed: false,
182+
items: [
183+
{ text: "GitHub Actions", link: "/recipes/github-actions" },
184+
{ text: "Zed", link: "/recipes/zed" },
185+
{ text: "Helix", link: "/recipes/helix" },
186+
{ text: "Visual Studio Code", link: "/recipes/vscode" },
187+
],
188+
},
152189
{ text: "🤝 Contributing", link: "/contributing" },
153190
{ text: "⚡️ Benchmarks", link: "/benchmarks" },
154191
{ text: "⭐ Projects Using Mago", link: "/projects-using-mago" },

docs/.vitepress/theme/custom.css

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
--vp-c-brand-2: #47a467;
2323
--vp-c-brand-3: #32784a;
2424

25-
/* --- Typography Variables --- */
2625
--heading-text-color: #32784a;
2726
--heading-underline-color: #0b5a76;
2827
}
@@ -41,18 +40,12 @@
4140
.VPDoc h1 {
4241
font-size: 2.25em;
4342
padding-bottom: 0.5rem;
44-
text-decoration: underline;
45-
text-decoration-thickness: 4px;
46-
text-decoration-color: var(--heading-underline-color);
4743
margin-bottom: 2rem;
4844
}
4945

5046
.VPDoc h2 {
5147
font-size: 1.5em;
5248
padding-bottom: 0.4rem;
53-
text-decoration: underline;
54-
text-decoration-thickness: 3px;
55-
text-decoration-color: var(--heading-underline-color);
5649
margin-top: 3rem;
5750
margin-bottom: 1.5rem;
5851
}
@@ -90,20 +83,20 @@
9083

9184
@keyframes float {
9285
0% {
93-
transform: translateY(0px) rotate(0deg);
86+
transform: translateY(0px);
9487
}
9588
50% {
96-
transform: translateY(-8px) rotate(0.5deg);
89+
transform: translateY(-8px);
9790
}
9891
100% {
99-
transform: translateY(0px) rotate(0deg);
92+
transform: translateY(0px);
10093
}
10194
}
10295

10396
#mago-logo {
10497
position: relative;
105-
top: 0;
106-
left: 0;
98+
top: 50px;
99+
left: 50px;
107100
animation: float 6s ease-in-out infinite;
108101
transition: transform 0.3s ease-out;
109102
}

docs/.vitepress/theme/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ export default {
88
onMounted(() => {
99
const target = document.querySelector("img#mago-logo");
1010
if (!target) {
11-
console.warn("3D hover effect: target element not found");
1211
return;
1312
}
1413

15-
const intensity = 20;
14+
const intensity = 10;
1615

1716
target.addEventListener("mouseenter", () => {
1817
target.classList.add("is-interactive");
@@ -25,14 +24,15 @@ export default {
2524

2625
target.style.transform = `
2726
perspective(1000px)
27+
translateY(0px)
2828
rotateY(${x * intensity}deg)
2929
rotateX(${-y * intensity}deg)
3030
scale3d(1, 1, 1)
3131
`;
3232
});
3333

3434
target.addEventListener("mouseleave", () => {
35-
target.style.transform = "perspective(1000px) rotateY(0) rotateX(0) scale3d(1, 1, 1)";
35+
target.style.transform = "";
3636
target.classList.remove("is-interactive");
3737
});
3838
});

docs/guide/installation.md

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,71 @@ title: Installation
44

55
# Installation
66

7-
Installing **Mago** is designed to be a quick and simple process.
7+
Installing **Mago** is a quick process with several options to suit your environment and preferences.
88

9-
## Automatic Installation (macOS & Linux)
9+
## Shell Installer (macOS & Linux)
1010

11-
The easiest way to install Mago is by using our installer script. Open your terminal and run the following command:
11+
This is the recommended method for most macOS and Linux users. Our script automatically downloads the correct binary for your system and adds it to your path.
1212

13-
```bash
14-
curl -sSL https://install.carthage.software/mago | bash
13+
#### Using `curl`
14+
15+
```sh
16+
curl --proto '=https' --tlsv1.2 -sSf [https://carthage.software/mago.sh](https://carthage.software/mago.sh) | bash
17+
```
18+
19+
#### Using `wget`
20+
21+
```sh
22+
wget -qO- [https://carthage.software/mago.sh](https://carthage.software/mago.sh) | bash
23+
```
24+
25+
---
26+
27+
## Package Managers
28+
29+
### Homebrew (macOS)
30+
31+
If you're using Homebrew on macOS, you can install Mago with a single command:
32+
33+
```sh
34+
brew install mago
35+
```
36+
37+
You can later update Mago by running `mago self-update`.
38+
39+
### Composer (PHP Project)
40+
41+
To add Mago as a development dependency to your PHP project via Composer:
42+
43+
```sh
44+
composer require --dev carthage-software/mago
45+
```
46+
47+
### Cargo (Rust)
48+
49+
If you have the Rust toolchain installed, you can install Mago directly from Crates.io:
50+
51+
```sh
52+
cargo install mago
1553
```
1654

17-
This script will download the latest pre-compiled binary for your system, make it executable, and move it to a standard location (`/usr/local/bin`) so you can run `mago` from anywhere.
55+
---
1856

19-
## Manual Installation (Windows & Other Systems)
57+
## Manual Download
2058

21-
If you're on Windows or prefer to install manually, you can download the latest release from our GitHub page.
59+
You can always download a pre-compiled binary directly from our GitHub Releases page. This is the recommended method for **Windows** and other systems not covered above.
2260

23-
1. Go to the **[Mago Releases Page](https://github.com/carthage-software/mago/releases)**.
24-
2. Download the appropriate binary for your operating system (e.g., `mago-x86_64-pc-windows-msvc.zip` for Windows).
61+
1. Navigate to the **[Mago Releases Page](https://github.com/carthage-software/mago/releases)**.
62+
2. Download the appropriate archive for your operating system (e.g., `mago-x86_64-pc-windows-msvc.zip` for Windows).
2563
3. Unzip the archive.
26-
4. Place the `mago.exe` (or `mago`) binary in a directory that is included in your system's `PATH`.
64+
4. Place the `mago.exe` (or `mago`) executable in a directory that is part of your system's `PATH` environment variable.
65+
66+
---
67+
68+
## Verify Installation
2769

28-
Once installed, you can verify it's working by running:
70+
Once installed, you can verify that Mago is working correctly by checking its version:
2971

30-
```bash
72+
```sh
3173
mago --version
3274
```

docs/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
# https://vitepress.dev/reference/default-theme-home-page
32
layout: home
43

54
hero:

docs/recipes/github-actions.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: GitHub Actions Recipe
3+
---
4+
5+
# 🧩 GitHub Actions Recipe
6+
7+
Automate your code quality checks by running **Mago** directly in your GitHub workflow. This setup will check for formatting and linting errors on every push and pull request, providing direct feedback within GitHub.
8+
9+
## Quick Setup
10+
11+
Create a new file at `.github/workflows/mago.yml` and add the following content:
12+
13+
```yaml
14+
name: Mago Code Quality
15+
16+
on:
17+
push:
18+
pull_request:
19+
20+
jobs:
21+
mago:
22+
name: Run Mago Checks
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout Code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup PHP with Composer cache
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: "8.4" # Or your project's version
32+
coverage: none
33+
tools: composer
34+
env:
35+
COMPOSER_ALLOW_SUPERUSER: 1
36+
37+
- name: Install Composer Dependencies
38+
run: composer install --prefer-dist --no-progress
39+
40+
- name: Setup Mago
41+
uses: nhedger/setup-mago@v1
42+
43+
- name: Run Mago
44+
run: |
45+
mago format --dry-run
46+
mago lint --reporting-format=github
47+
mago analyze --reporting-format=github
48+
```

0 commit comments

Comments
 (0)