Skip to content

Commit 46349f7

Browse files
committed
Move docs to Starlight
1 parent 91ee9a4 commit 46349f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4561
-160
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout your repository using git
18+
uses: actions/checkout@v4
19+
- name: Install, build, and upload your site
20+
uses: withastro/action@v3
21+
with:
22+
path: docs
23+
24+
deploy:
25+
needs: build
26+
runs-on: ubuntu-latest
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
steps:
31+
- name: Deploy to GitHub Pages
32+
id: deployment
33+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.astro/
12
node_modules/
23
dist/
34
*.tsbuildinfo

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
package.json
22
pnpm-lock.yaml
3+
starlight/

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

README.md

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Slippy
22

3+
[Docs](https://fvictorio.github.io/slippy)
4+
35
Slippy is a linter for Solidity that's simple, powerful, and thoughtfully built.
46

57
## Installation
@@ -24,11 +26,11 @@ npx slippy "contracts/**/*.sol"
2426

2527
# Why Slippy?
2628

27-
You can read a more detailed [comparison between Slippy and Solhint](/docs/slippy-vs-solhint.md), but here's a summary:
29+
You can read a more detailed [comparison between Slippy and Solhint](https://fvictorio.github.io/slippy/guides/slippy-vs-solhint), but here's a summary:
2830

2931
- A single, flexible configuration that lets you easily enable or disable rules for specific parts of your codebase
30-
- A unified [`naming-convention`](/docs/rules/naming-convention.md) rule
31-
- A more accurate [`no-unused-vars`](/docs/rules/no-unused-vars.md) rule
32+
- A unified [`naming-convention`](https://fvictorio.github.io/slippy/rules/naming-convention) rule
33+
- A more accurate [`no-unused-vars`](https://fvictorio.github.io/slippy/rules/no-unused-vars) rule
3234
- Unused comment directives like `// slippy-disable-line` are reported
3335
- No formatting rules
3436
- Semantic versioning
@@ -46,40 +48,8 @@ module.exports = {
4648
};
4749
```
4850

49-
For more details on configuring Slippy, including advanced features like cascading configurations, file ignores, and comment directives, see the [configuration documentation](/docs/config.md).
51+
For more details on configuring Slippy, including advanced features like cascading configurations, file ignores, and comment directives, see the [configuration documentation](https://fvictorio.github.io/guides/configuration).
5052

5153
# Rules
5254

53-
_Rules that have a 🔧 next to them can be automatically fixed by running Slippy with the `--fix` flag._
54-
55-
- [`compatible-pragma`](/docs/rules/compatible-pragma.md): checks that the minimum supported pragma version is compatible with the features used in the file.
56-
- [`curly`](/docs/rules/curly.md): enforces the use of curly braces for all control structures.
57-
- [`explicit-types`](/docs/rules/explicit-types.md): enforces or forbids the use of aliases like `uint` instead of `uint256`. 🔧
58-
- [`id-denylist`](/docs/rules/id-denylist.md): allows you to specify a list of forbidden identifiers.
59-
- [`imports-on-top`](/docs/rules/imports-on-top.md): enforces that all import statements are at the top of the file.
60-
- [`max-state-vars`](/docs/rules/max-state-vars.md): limits the number of state variables in a contract.
61-
- [`named-return-params`](/docs/rules/named-return-params.md): enforces that functions with multiple return parameters use named return parameters.
62-
- [`naming-convention`](/docs/rules/naming-convention.md): enforces a naming convention across the codebase.
63-
- [`no-console`](/docs/rules/no-console.md): forbids the use of `console.log` and the import of `console.sol`.
64-
- [`no-default-visibility`](/docs/rules/no-default-visibility.md): forbids the use of default visibility for state variables. 🔧
65-
- [`no-duplicate-imports`](/docs/rules/no-duplicate-imports.md): forbids importing the same file multiple times.
66-
- [`no-empty-blocks`](/docs/rules/no-empty-blocks.md): forbids blocks without statements.
67-
- [`no-global-imports`](/docs/rules/no-global-imports.md): forbids global imports like `import "./foo.sol"`.
68-
- [`no-hardcoded-gas`](/docs/rules/no-hardcoded-gas.md): disallows hardcoded gas values in call options.
69-
- [`no-restricted-syntax`](/docs/rules/no-restricted-syntax.md): disallows syntax patterns specified with [Slang queries](https://nomicfoundation.github.io/slang/latest/user-guide/06-query-language/01-query-syntax/).
70-
- [`no-send`](/docs/rules/no-send.md): forbids the use of `send` and `transfer` for sending value, in favor of using `call` with value.
71-
- [`no-tx-origin`](/docs/rules/no-tx-origin.md): forbids the use of `tx.origin`.
72-
- [`no-unchecked-calls`](/docs/rules/no-unchecked-calls.md): disallows low-level calls like `call`, `staticcall`, and `delegatecall` that don't use their return values.
73-
- [`no-uninitialized-immutable-references`](/docs/rules/no-uninitialized-immutable-references.md): forbids using immutable references before they are initialized.
74-
- [`no-unnecessary-boolean-compare`](/docs/rules/no-unnecessary-boolean-compare.md): forbids unnecessary comparisons to boolean literals.
75-
- [`no-unnecessary-else](/docs/rules/no-unnecessary-else.md): disallows `else` blocks following `if` statements that end with a control-flow-terminating statement (`return`, `break`, etc.)
76-
- [`no-unused-vars`](/docs/rules/no-unused-vars.md): detects unused variables, imports and functions.
77-
- [`one-contract-per-file`](/docs/rules/one-contract-per-file.md): enforces that a file contains at most one contract/interface/library definition.
78-
- [`private-vars`](/docs/rules/private-vars.md): enforces that all state variables are private.
79-
- [`require-revert-reason`](/docs/rules/require-revert-reason.md): enforces that all reverts have a reason.
80-
- [`sort-imports`](/docs/rules/sort-imports.md): enforces a specific order for import statements.
81-
- [`sort-members`](/docs/rules/sort-members.md): enforces a specific order for top-level elements and contract/interface/library members.
82-
- [`sort-modifiers`](/docs/rules/sort-modifiers.md): enforces a specific order for modifiers. 🔧
83-
- [`yul-prefer-iszero`](/docs/rules/yul-prefer-iszero.md): recommends using `iszero` instead of `eq` when comparing to the `0` literal in Yul code.
84-
85-
Don't see a rule you need? [Open an issue](https://github.com/fvictorio/slippy/issues/new).
55+
You can find the full list of available rules in the [rules reference documentation](https://fvictorio.github.io/slippy/reference/rules).

docs/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight
7+
```
8+
9+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
10+
11+
## 🚀 Project Structure
12+
13+
Inside of your Astro + Starlight project, you'll see the following folders and files:
14+
15+
```
16+
.
17+
├── public/
18+
├── src/
19+
│ ├── assets/
20+
│ ├── content/
21+
│ │ └── docs/
22+
│ └── content.config.ts
23+
├── astro.config.mjs
24+
├── package.json
25+
└── tsconfig.json
26+
```
27+
28+
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.
29+
30+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
31+
32+
Static assets, like favicons, can be placed in the `public/` directory.
33+
34+
## 🧞 Commands
35+
36+
All commands are run from the root of the project, from a terminal:
37+
38+
| Command | Action |
39+
| :------------------------ | :----------------------------------------------- |
40+
| `npm install` | Installs dependencies |
41+
| `npm run dev` | Starts local dev server at `localhost:4321` |
42+
| `npm run build` | Build your production site to `./dist/` |
43+
| `npm run preview` | Preview your build locally, before deploying |
44+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
45+
| `npm run astro -- --help` | Get help using the Astro CLI |
46+
47+
## 👀 Want to learn more?
48+
49+
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).

docs/astro.config.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// @ts-check
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
5+
export default defineConfig({
6+
site: "https://fvictorio.github.io",
7+
base: "/slippy",
8+
integrations: [
9+
starlight({
10+
title: "Slippy",
11+
social: [
12+
{
13+
icon: "github",
14+
label: "GitHub",
15+
href: "https://github.com/fvictorio/slippy",
16+
},
17+
],
18+
sidebar: [
19+
{
20+
label: "Guides",
21+
items: [
22+
{ label: "Getting started", slug: "guides/getting-started" },
23+
{ label: "Configuring Slippy", slug: "guides/configuration" },
24+
{ label: "Slippy vs Solhint", slug: "guides/slippy-vs-solhint" },
25+
],
26+
},
27+
{
28+
label: "Reference",
29+
items: [{ label: "List of rules", slug: "reference/rules" }],
30+
},
31+
32+
{
33+
label: "Rules",
34+
collapsed: true,
35+
autogenerate: { directory: "rules" },
36+
},
37+
],
38+
}),
39+
],
40+
});

docs/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "learning-starlight",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev --host",
7+
"start": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview",
10+
"astro": "astro"
11+
},
12+
"dependencies": {
13+
"@astrojs/starlight": "^0.36.2",
14+
"astro": "^5.6.1",
15+
"sharp": "^0.34.2"
16+
},
17+
"packageManager": "pnpm@10.5.2"
18+
}

0 commit comments

Comments
 (0)