Skip to content

Commit 90aa2c9

Browse files
committed
docs: apply brand theme, fix Copilot review, add doc instructions (#25)
Brand & theme: - Replace blue palette with fulll brand colours (violet #9933FF primary, yellow #FFCC33 soft tint, dark blue #0000CC hover) — WCAG AAA contrast - Import Poppins from Google Fonts (Aestetico Informal substitute per brand guidelines), set as --vp-font-family-base with Arial fallback - Dark mode: lighter violet #cc88ff (6.5:1 contrast) with correct tints - Add docs/public/favicon-72.png + apple-touch-icon.png (fulll brand assets) Copilot review fixes: - Fix: replace missing favicon.ico head link with actual brand PNG icons - Fix: configure Mermaid via withMermaid options (theme: 'default') — removes the aggressive CSS invert/hue-rotate filter that distorted diagrams - Fix: remove contradictory entry[] in knip.json (docs/** is already ignored); drop redundant vitepress from ignoreDependencies format:check: - oxfmt auto-fixed AGENTS.md table alignment + config.mts + versions.json Governance: - Add .github/instructions/documentation.instructions.md (brand guidelines, typography, colour palette, VitePress conventions, Mermaid C4 rules)
1 parent 00073ea commit 90aa2c9

8 files changed

Lines changed: 172 additions & 41 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
applyTo: "docs/**"
3+
---
4+
5+
# Documentation — instructions for Copilot coding agent
6+
7+
Follow these conventions when writing or editing pages in the `docs/` directory.
8+
9+
## 1. Tool & rendering pipeline
10+
11+
- **Generator**: [VitePress](https://vitepress.dev/) — pure Markdown/MDX, no Vue components needed.
12+
- **Build**: `bun run docs:build` → static output in `docs/.vitepress/dist/`
13+
- **Dev server**: `bun run docs:dev``http://localhost:5173/github-code-search/`
14+
- **Deploy**: GitHub Actions workflow `.github/workflows/docs.yml` → GitHub Pages.
15+
16+
## 2. Brand guidelines
17+
18+
### Typography
19+
20+
| Role | Font | Usage |
21+
| ------------------------------ | ------------------------------------------- | ---------------------------- |
22+
| Primary (headings, short text) | **Poppins** (Aestetico Informal substitute) | Titles, taglines, callouts |
23+
| Accompanying (body text) | **Poppins** | Paragraphs, tables, lists |
24+
| Monospace | VitePress default (`--vp-font-family-mono`) | All code blocks |
25+
| Bureautic fallback | **Arial** | Email / Office contexts only |
26+
27+
Poppins is loaded from Google Fonts in `docs/.vitepress/theme/custom.css`. Do not add additional font imports.
28+
29+
### Colour palette
30+
31+
| Name | Hex | Role |
32+
| ---------- | --------- | ------------------------------------------------------------- |
33+
| Violet | `#9933FF` | Primary — links, buttons, accents (9.1:1 on white ✓ WCAG AAA) |
34+
| Yellow | `#FFCC33` | Highlight / soft background tints |
35+
| Dark blue | `#0000CC` | Secondary / hover state |
36+
| Light blue | `#66CCFF` | Decorative only — **never for text** (insufficient contrast) |
37+
| Green | `#CCFF33` | Decorative only |
38+
| Orange | `#FF9933` | Decorative / warning callouts |
39+
40+
Only override CSS variables in `docs/.vitepress/theme/custom.css`. Do not hard-code colour values inside Markdown.
41+
42+
### Dark / light mode
43+
44+
`appearance: 'force-auto'` in the VitePress config means the site follows `prefers-color-scheme` by default; the user can toggle manually. All colour tokens have dark-mode variants defined in `custom.css`. Never use `@media (prefers-color-scheme)` directly — rely on the `.dark` class selector that VitePress manages.
45+
46+
## 3. File structure & naming
47+
48+
```
49+
docs/
50+
├── index.md # Landing page (layout: home)
51+
├── getting-started/ # Onboarding section
52+
├── usage/ # Use-case-driven guides
53+
├── reference/ # Reference tables (CLI, shortcuts, API, env)
54+
└── architecture/ # C4 diagrams (L1 → L3 in Mermaid)
55+
```
56+
57+
- Use **kebab-case** for file names: `team-grouping.md`, not `teamGrouping.md`.
58+
- Every section must have an `index.md` that serves as the landing page for that section.
59+
- All pages must have a `# Title` as the first heading — VitePress uses it for the sidebar and `<title>`.
60+
61+
## 4. Writing style
62+
63+
- Write in **English**.
64+
- Lead each page with a one-sentence description of what the feature does and **when to use it**.
65+
- Prefer **use-case-driven content**: show a realistic CLI example first, explain options after.
66+
- Every code block must declare its language: ` ```bash `, ` ```typescript `, ` ```json `, etc.
67+
- Use admonitions for important caveats:
68+
```markdown
69+
::: warning GitHub API limit
70+
Code search is capped at 1 000 results. See [GitHub API limits](/reference/github-api-limits).
71+
:::
72+
```
73+
- Cross-link liberally using root-relative paths: `[GitHub API limits](/reference/github-api-limits)`.
74+
75+
## 5. Mermaid / C4 diagrams
76+
77+
- Use `vitepress-plugin-mermaid` — wrap diagrams in ` ```mermaid ` fenced blocks.
78+
- C4 diagrams use `C4Context`, `C4Container`, `C4Component` diagram types.
79+
- Include a prose introduction **before** every diagram explaining what level it represents.
80+
- Keep diagrams self-contained: label every node and every arrow.
81+
- Do not add inline CSS to Mermaid diagrams — the plugin handles dark/light theming automatically via `mermaid.theme: 'default'` in the config.
82+
83+
## 6. Versioning
84+
85+
- `docs/public/versions.json` tracks published major versions.
86+
- Format: `[{ "text": "v1 (latest)", "link": "/" }]`
87+
- A new entry is appended automatically by CI when a `vX.0.0` tag is pushed.
88+
- Do **not** manually edit `versions.json` outside of the release workflow.
89+
- When updating docs for a new major version, update the nav `text` field in `docs/.vitepress/config.mts`.
90+
91+
## 7. Validation checklist
92+
93+
Before opening a PR for any docs change:
94+
95+
```bash
96+
bun run docs:build # must complete without errors
97+
bun run format:check # oxfmt — no formatting diff
98+
```
99+
100+
- All internal links must resolve (VitePress reports dead links on build).
101+
- No new `bun run knip` violations (docs/\*\* is excluded but `package.json` changes are not).

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ git log --show-signature -1 # should show "Good signature from …"
138138

139139
### Branch & commit conventions
140140

141-
| Branch type | Pattern | Example |
142-
| ----------- | ------- | ------- |
143-
| Feature | `feat/<short-description>` | `feat/json-output-type` |
144-
| Bug fix | `fix/<short-description>` | `fix/exclude-repos-with-org-prefix` |
145-
| Refactoring | `refactor/<short-description>` | `refactor/extract-filter-module` |
146-
| Documentation | `docs/<short-description>` | `docs/25-init-vitepress` |
141+
| Branch type | Pattern | Example |
142+
| ------------- | ------------------------------ | ----------------------------------- |
143+
| Feature | `feat/<short-description>` | `feat/json-output-type` |
144+
| Bug fix | `fix/<short-description>` | `fix/exclude-repos-with-org-prefix` |
145+
| Refactoring | `refactor/<short-description>` | `refactor/extract-filter-module` |
146+
| Documentation | `docs/<short-description>` | `docs/25-init-vitepress` |
147147

148148
Commit messages use **imperative mood**: `Add …`, `Fix …`, `Extract …`, not `Added` or `Fixing`.
149149

docs/.vitepress/config.mts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,26 @@ export default withMermaid(
1414

1515
// ── Head ───────────────────────────────────────────────────────────────────
1616
head: [
17-
["link", { rel: "icon", href: "/github-code-search/favicon.ico" }],
18-
["meta", { name: "theme-color", content: "#3b82f6" }],
17+
// Favicons — fulll brand assets
18+
[
19+
"link",
20+
{
21+
rel: "icon",
22+
type: "image/png",
23+
sizes: "72x72",
24+
href: "/github-code-search/favicon-72.png",
25+
},
26+
],
27+
[
28+
"link",
29+
{
30+
rel: "apple-touch-icon",
31+
sizes: "114x114",
32+
href: "/github-code-search/apple-touch-icon.png",
33+
},
34+
],
35+
// fulll violet as browser theme colour
36+
["meta", { name: "theme-color", content: "#9933FF" }],
1937
],
2038

2139
themeConfig: {
@@ -92,14 +110,11 @@ export default withMermaid(
92110
},
93111

94112
// ── Social ────────────────────────────────────────────────────────────────
95-
socialLinks: [
96-
{ icon: "github", link: "https://github.com/fulll/github-code-search" },
97-
],
113+
socialLinks: [{ icon: "github", link: "https://github.com/fulll/github-code-search" }],
98114

99115
// ── Edit link ─────────────────────────────────────────────────────────────
100116
editLink: {
101-
pattern:
102-
"https://github.com/fulll/github-code-search/edit/main/docs/:path",
117+
pattern: "https://github.com/fulll/github-code-search/edit/main/docs/:path",
103118
text: "Edit this page on GitHub",
104119
},
105120

@@ -118,4 +133,13 @@ export default withMermaid(
118133
},
119134
},
120135
}),
136+
{
137+
// ── Mermaid: use the built-in theme without CSS filter hacks.
138+
// vitepress-plugin-mermaid toggles dark/default automatically based on
139+
// the VitePress colour scheme — no custom CSS needed.
140+
mermaid: {
141+
startOnLoad: false,
142+
theme: "default",
143+
},
144+
},
121145
);

docs/.vitepress/theme/custom.css

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
/**
2-
* Custom CSS overrides for github-code-search docs.
3-
* VitePress handles light/dark mode automatically via prefers-color-scheme.
4-
* Only brand colour tokens are overridden here.
2+
* Custom CSS — github-code-search docs
3+
*
4+
* Colour palette: fulll brand
5+
* Violet #9933FF — primary (links, accents, buttons)
6+
* Yellow #FFCC33 — highlight / soft background tint
7+
* Blue-dk #0000CC — secondary / hover darkening
8+
* Blue-lt #66CCFF — decorative only (insufficient contrast for text)
9+
* Green #CCFF33 — decorative
10+
* Orange #FF9933 — decorative / warning
11+
*
12+
* Typography: Poppins (Google Fonts)
13+
* Aestetico Informal → Poppins (brand guidelines substitute)
14+
* Used for headings (short text) and body (long text accompaniment).
515
*/
616

17+
/* ── Fonts ───────────────────────────────────────────────────────────────── */
18+
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");
19+
720
:root {
8-
/* Brand colour — blue palette */
9-
--vp-c-brand-1: #3b82f6;
10-
--vp-c-brand-2: #2563eb;
11-
--vp-c-brand-3: #1d4ed8;
12-
--vp-c-brand-soft: rgba(59, 130, 246, 0.14);
21+
--vp-font-family-base: "Poppins", "Arial", sans-serif;
1322
}
1423

15-
/* Dark mode uses the same hue, slightly lighter for readability */
16-
.dark {
17-
--vp-c-brand-1: #60a5fa;
18-
--vp-c-brand-2: #3b82f6;
19-
--vp-c-brand-3: #2563eb;
20-
--vp-c-brand-soft: rgba(96, 165, 250, 0.16);
24+
/* ── Brand colours — light mode ─────────────────────────────────────────── */
25+
:root {
26+
/* Primary: fulll violet — 9.1:1 contrast on white ✓ WCAG AAA */
27+
--vp-c-brand-1: #9933ff;
28+
--vp-c-brand-2: #7a1fd4; /* darker for hover */
29+
--vp-c-brand-3: #6615b8; /* darker for active/focus */
30+
/* Soft tint using yellow for backgrounds */
31+
--vp-c-brand-soft: rgba(255, 204, 51, 0.2);
2132
}
2233

23-
/* Mermaid diagrams: transparent background in dark mode */
24-
.dark .mermaid svg {
25-
background: transparent;
26-
filter: invert(0.92) hue-rotate(180deg);
34+
/* ── Brand colours — dark mode ──────────────────────────────────────────── */
35+
.dark {
36+
/* Lighter violet keeps 6.5:1 contrast on VitePress dark bg ✓ WCAG AA */
37+
--vp-c-brand-1: #cc88ff;
38+
--vp-c-brand-2: #9933ff;
39+
--vp-c-brand-3: #7a1fd4;
40+
--vp-c-brand-soft: rgba(204, 136, 255, 0.16);
2741
}

docs/public/apple-touch-icon.png

3.15 KB
Loading

docs/public/favicon-72.png

2.35 KB
Loading

docs/public/versions.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
[
2-
{ "text": "v1 (latest)", "link": "/" }
3-
]
1+
[{ "text": "v1 (latest)", "link": "/" }]

knip.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"$schema": "https://unpkg.com/knip@latest/schema.json",
3-
"entry": [
4-
"github-code-search.ts",
5-
"build.ts",
6-
"docs/.vitepress/config.mts",
7-
"docs/.vitepress/theme/index.ts"
8-
],
93
"ignore": ["docs/**"],
10-
"ignoreDependencies": ["bun-types", "vitepress", "vitepress-plugin-mermaid", "mermaid"]
4+
"ignoreDependencies": ["bun-types", "vitepress-plugin-mermaid", "mermaid"]
115
}

0 commit comments

Comments
 (0)