Skip to content

Commit e9e4817

Browse files
committed
added formatting and linting to docs
1 parent dd6c669 commit e9e4817

Some content is hidden

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

45 files changed

+1761
-499
lines changed

.github/workflows/docs.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525

26-
- name: Wait for required checks
27-
uses: actions/github-script@v7
28-
with:
29-
script: |
30-
const script = require('./.github/wait-for-checks.js');
31-
await script({ github, context, core });
32-
3326
- name: Setup pnpm
3427
uses: pnpm/action-setup@v4
3528
with:
@@ -43,6 +36,19 @@ jobs:
4336
- name: Install dependencies
4437
run: cd docs && pnpm install
4538

39+
- name: Check formatting
40+
run: cd docs && pnpm format:check
41+
42+
- name: Lint code
43+
run: cd docs && pnpm lint
44+
45+
- name: Wait for required checks
46+
uses: actions/github-script@v7
47+
with:
48+
script: |
49+
const script = require('./.github/wait-for-checks.js');
50+
await script({ github, context, core });
51+
4652
- name: Build with Astro
4753
run: cd docs && pnpm build
4854

docs/.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dist/
2+
node_modules/
3+
.astro/
4+
pnpm-lock.yaml
5+
package-lock.json
6+
*.min.js
7+
*.min.css

docs/.prettierrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"trailingComma": "all",
7+
"printWidth": 100,
8+
"proseWrap": "preserve",
9+
"plugins": ["prettier-plugin-astro"],
10+
"overrides": [
11+
{
12+
"files": "*.astro",
13+
"options": {
14+
"parser": "astro"
15+
}
16+
},
17+
{
18+
"files": ["*.md", "*.mdx"],
19+
"options": {
20+
"proseWrap": "always",
21+
"printWidth": 80
22+
}
23+
}
24+
]
25+
}

docs/CLAUDE.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
### Never Use H1 Headers in Content
66

7-
**NEVER** start MDX pages with an H1 (`# Header`) - Starlight automatically generates the H1 from the frontmatter `title`.
7+
**NEVER** start MDX pages with an H1 (`# Header`) - Starlight automatically
8+
generates the H1 from the frontmatter `title`.
89

910
**Wrong:**
11+
1012
```mdx
1113
---
1214
title: MCP Server Configuration
@@ -18,6 +20,7 @@ Content here...
1820
```
1921

2022
**Correct:**
23+
2124
```mdx
2225
---
2326
title: MCP Server Configuration
@@ -31,16 +34,31 @@ Content here starts immediately, or with H2 (## Section)
3134
Always import Starlight components at the top:
3235

3336
```mdx
34-
import { Card, CardGrid, LinkCard, Tabs, TabItem, Steps, Code, Aside } from '@astrojs/starlight/components';
37+
import {
38+
Card,
39+
CardGrid,
40+
LinkCard,
41+
Tabs,
42+
TabItem,
43+
Steps,
44+
Code,
45+
Aside,
46+
} from '@astrojs/starlight/components';
47+
48+
;
3549
```
3650

3751
### Best Practices
3852

39-
1. **Structure**: Start content immediately after frontmatter, use H2 for main sections
40-
2. **Components**: Use `<Steps>` for numbered procedures, `<Tabs>` for platform-specific content
41-
3. **Cards**: Don't overuse CardGrid - simple lists are often better for readability
53+
1. **Structure**: Start content immediately after frontmatter, use H2 for main
54+
sections
55+
2. **Components**: Use `<Steps>` for numbered procedures, `<Tabs>` for
56+
platform-specific content
57+
3. **Cards**: Don't overuse CardGrid - simple lists are often better for
58+
readability
4259
4. **Code blocks**: Use proper language tags for syntax highlighting
43-
5. **Links**: Use LinkCard for prominent external links, regular markdown links for inline references
60+
5. **Links**: Use LinkCard for prominent external links, regular markdown links
61+
for inline references
4462

4563
### Common Components
4664

@@ -70,6 +88,7 @@ description: Brief description for SEO and navigation
7088
### Preview Formats
7189

7290
When showing renamify CLI output, use the appropriate format:
91+
7392
- `summary` - For AI agents (structured, minimal)
7493
- `table` - For human-readable overviews
7594
- `diff` - For detailed change previews
@@ -78,12 +97,14 @@ When showing renamify CLI output, use the appropriate format:
7897
### Testing Guidelines
7998

8099
- Always use `--dry-run` flag when testing renamify commands in docs
81-
- Use "renamed_renaming_tool" as replacement target in examples (not the alternative protected string)
100+
- Use "renamed_renaming_tool" as replacement target in examples (not the
101+
alternative protected string)
82102
- Test all links and ensure they work in the local dev server
83103

84104
### Sidebar Configuration
85105

86106
- Keep sidebar items concise and well-organized
87-
- Use autogenerate for large directories: `autogenerate: { directory: "commands" }`
107+
- Use autogenerate for large directories:
108+
`autogenerate: { directory: "commands" }`
88109
- Group related items under clear labels
89110
- Put most important sections (like MCP Server) near the top

docs/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Renamify Documentation Site
22

3-
This directory contains the Renamify documentation website built with [Starlight](https://starlight.astro.build).
3+
This directory contains the Renamify documentation website built with
4+
[Starlight](https://starlight.astro.build).
45

56
## 📖 Documentation Structure
67

@@ -28,12 +29,14 @@ The documentation is automatically built and deployed from the `main` branch.
2829

2930
## 📝 Content
3031

31-
Documentation content is written in Markdown/MDX and located in `src/content/docs/`. The site includes:
32+
Documentation content is written in Markdown/MDX and located in
33+
`src/content/docs/`. The site includes:
3234

3335
- Getting started guides
3436
- CLI command reference
3537
- Configuration examples
3638
- Live demo with self-hosting testing
3739
- Real-world case studies
3840

39-
Visit the live documentation at https://docspring.github.io/renamify/ to learn more about Renamify.
41+
Visit the live documentation at https://docspring.github.io/renamify/ to learn
42+
more about Renamify.

docs/astro.config.mjs

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,114 @@
11
// @ts-check
2-
import { defineConfig } from "astro/config";
3-
import starlight from "@astrojs/starlight";
4-
import starlightImageZoom from "starlight-image-zoom";
2+
3+
import starlight from '@astrojs/starlight';
4+
import { defineConfig } from 'astro/config';
5+
import starlightImageZoom from 'starlight-image-zoom';
56

67
// https://astro.build/config
78
export default defineConfig({
8-
site: "https://docspring.github.io",
9-
base: "/renamify",
9+
site: 'https://docspring.github.io',
10+
base: '/renamify',
1011

1112
integrations: [
1213
starlight({
13-
title: "Renamify",
14+
title: 'Renamify',
1415
description:
15-
"Smart search & replace for code and files with case-aware transformations",
16+
'Smart search & replace for code and files with case-aware transformations',
1617
logo: {
17-
src: "./src/assets/logo.svg",
18+
src: './src/assets/logo.svg',
1819
},
19-
customCss: [
20-
"./src/styles/custom.css",
21-
],
20+
customCss: ['./src/styles/custom.css'],
2221
editLink: {
23-
baseUrl: "https://github.com/DocSpring/renamify/edit/main/docs",
22+
baseUrl: 'https://github.com/DocSpring/renamify/edit/main/docs',
2423
},
2524
plugins: [starlightImageZoom()],
2625
components: {
27-
Footer: "./src/components/Footer.astro",
26+
Footer: './src/components/Footer.astro',
2827
},
2928
social: [
3029
{
31-
icon: "github",
32-
label: "GitHub",
33-
href: "https://github.com/DocSpring/renamify",
30+
icon: 'github',
31+
label: 'GitHub',
32+
href: 'https://github.com/DocSpring/renamify',
3433
},
3534
],
3635
sidebar: [
3736
{
38-
label: "Getting Started",
37+
label: 'Getting Started',
3938
items: [
40-
{ label: "Installation", slug: "installation" },
41-
{ label: "Self-Hosting Demo", slug: "self-hosting-demo" },
42-
{ label: "Quick Start", slug: "quick-start" },
39+
{ label: 'Installation', slug: 'installation' },
40+
{ label: 'Self-Hosting Demo', slug: 'self-hosting-demo' },
41+
{ label: 'Quick Start', slug: 'quick-start' },
4342
{
44-
label: "Rename vs. Replace",
45-
slug: "rename-vs-replace",
43+
label: 'Rename vs. Replace',
44+
slug: 'rename-vs-replace',
4645
},
47-
{ label: "FAQ", link: "/#frequently-asked-questions" },
46+
{ label: 'FAQ', link: '/#frequently-asked-questions' },
4847
],
4948
},
5049
{
51-
label: "Features",
50+
label: 'Features',
5251
items: [
5352
{
54-
label: "Case-Aware Transformations",
55-
slug: "features/case-transformations",
53+
label: 'Case-Aware Transformations',
54+
slug: 'features/case-transformations',
55+
},
56+
{
57+
label: 'File and Directory Renaming',
58+
slug: 'features/file-renaming',
5659
},
60+
{ label: 'Safety Features', slug: 'features/safety' },
61+
{ label: 'Filtering and Ignore Rules', slug: 'features/filtering' },
5762
{
58-
label: "File and Directory Renaming",
59-
slug: "features/file-renaming",
63+
label: 'Resolving Case Ambiguity',
64+
slug: 'features/ambiguity-resolution',
6065
},
61-
{ label: "Safety Features", slug: "features/safety" },
62-
{ label: "Filtering and Ignore Rules", slug: "features/filtering" },
63-
{ label: "Resolving Case Ambiguity", slug: "features/ambiguity-resolution" },
6466
],
6567
},
6668
{
67-
label: "MCP Server",
69+
label: 'MCP Server',
6870
items: [
69-
{ label: "Overview", slug: "mcp/overview" },
70-
{ label: "Installation", slug: "mcp/installation" },
71-
{ label: "Configuration", slug: "mcp/configuration" },
72-
{ label: "Tools Reference", slug: "mcp/tools" },
73-
{ label: "Usage Examples", slug: "mcp/examples" },
74-
{ label: "AI Agent Guide", slug: "mcp/ai-guide" },
71+
{ label: 'Overview', slug: 'mcp/overview' },
72+
{ label: 'Installation', slug: 'mcp/installation' },
73+
{ label: 'Configuration', slug: 'mcp/configuration' },
74+
{ label: 'Tools Reference', slug: 'mcp/tools' },
75+
{ label: 'Usage Examples', slug: 'mcp/examples' },
76+
{ label: 'AI Agent Guide', slug: 'mcp/ai-guide' },
7577
],
7678
},
7779
{
78-
label: "VS Code Extension",
79-
items: [{ label: "Overview", slug: "vscode/overview" }],
80+
label: 'VS Code Extension',
81+
items: [{ label: 'Overview', slug: 'vscode/overview' }],
8082
},
8183
{
82-
label: "Commands",
84+
label: 'Commands',
8385
items: [
84-
{ label: "init", slug: "commands/init" },
85-
{ label: "search", slug: "commands/search" },
86-
{ label: "rename", slug: "commands/rename" },
87-
{ label: "replace", slug: "commands/replace" },
88-
{ label: "plan", slug: "commands/plan" },
89-
{ label: "apply", slug: "commands/apply" },
90-
{ label: "dry-run", slug: "commands/dry-run" },
91-
{ label: "status", slug: "commands/status" },
92-
{ label: "history", slug: "commands/history" },
93-
{ label: "undo", slug: "commands/undo" },
94-
{ label: "redo", slug: "commands/redo" },
86+
{ label: 'init', slug: 'commands/init' },
87+
{ label: 'search', slug: 'commands/search' },
88+
{ label: 'rename', slug: 'commands/rename' },
89+
{ label: 'replace', slug: 'commands/replace' },
90+
{ label: 'plan', slug: 'commands/plan' },
91+
{ label: 'apply', slug: 'commands/apply' },
92+
{ label: 'dry-run', slug: 'commands/dry-run' },
93+
{ label: 'status', slug: 'commands/status' },
94+
{ label: 'history', slug: 'commands/history' },
95+
{ label: 'undo', slug: 'commands/undo' },
96+
{ label: 'redo', slug: 'commands/redo' },
9597
],
9698
},
9799
{
98-
label: "Examples",
99-
autogenerate: { directory: "examples" },
100+
label: 'Examples',
101+
autogenerate: { directory: 'examples' },
100102
},
101103
{
102-
label: "Case Studies",
103-
autogenerate: { directory: "case-studies" },
104+
label: 'Case Studies',
105+
autogenerate: { directory: 'case-studies' },
104106
},
105107
{
106-
label: "Reference",
108+
label: 'Reference',
107109
items: [
108-
{ label: "Configuration", slug: "reference/configuration" },
109-
{ label: "Platform Support", slug: "reference/platform-support" },
110+
{ label: 'Configuration', slug: 'reference/configuration' },
111+
{ label: 'Platform Support', slug: 'reference/platform-support' },
110112
],
111113
},
112114
],

docs/biome.jsonc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
3+
"extends": ["ultracite"],
4+
"files": {
5+
"includes": [
6+
"src/**/*.{js,jsx,ts,tsx,mjs}",
7+
"*.{js,mjs,ts}",
8+
"src/**/*.astro"
9+
]
10+
},
11+
"linter": {
12+
"rules": {
13+
"style": {
14+
"noMagicNumbers": "off",
15+
"useFilenamingConvention": "off"
16+
},
17+
"suspicious": {
18+
"noConsole": "off"
19+
}
20+
}
21+
},
22+
"overrides": [
23+
{
24+
"includes": ["*.astro"],
25+
"linter": {
26+
"rules": {
27+
"correctness": {
28+
"noUnusedVariables": "off",
29+
"noUnusedImports": "off"
30+
}
31+
}
32+
}
33+
}
34+
]
35+
}

0 commit comments

Comments
 (0)