Skip to content

Commit dc0d77d

Browse files
authored
Merge pull request #12 from EFNext/feat/docs
Added docs site
2 parents d98aab2 + 6a2a282 commit dc0d77d

43 files changed

Lines changed: 10144 additions & 555 deletions

Some content is hidden

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

.github/workflows/docs.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
deploy:
16+
name: Build & Deploy
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout main
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
28+
- name: Install dependencies
29+
working-directory: docs
30+
run: npm ci
31+
32+
- name: Build VitePress site
33+
working-directory: docs
34+
env:
35+
GITHUB_ACTIONS: "true"
36+
run: npm run build
37+
38+
- name: Checkout gh-pages
39+
uses: actions/checkout@v4
40+
with:
41+
ref: gh-pages
42+
path: gh-pages
43+
44+
- name: Deploy to gh-pages
45+
run: |
46+
cd gh-pages
47+
48+
# Remove old docs files but preserve dev/bench (benchmark data)
49+
find . -maxdepth 1 \
50+
! -name '.' \
51+
! -name '.git' \
52+
! -name 'dev' \
53+
-exec rm -rf {} +
54+
55+
# Copy new VitePress build output
56+
cp -r ../docs/.vitepress/dist/* .
57+
58+
# Configure git
59+
git config user.name "github-actions[bot]"
60+
git config user.email "github-actions[bot]@users.noreply.github.com"
61+
62+
# Commit and push if there are changes
63+
git add -A
64+
if git diff --cached --quiet; then
65+
echo "No changes to deploy"
66+
else
67+
git commit -m "docs: deploy VitePress site from ${GITHUB_SHA::7}"
68+
git push
69+
fi

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,4 +367,9 @@ FodyWeavers.xsd
367367

368368
.idea
369369
ReadmeSample.db
370-
.remember/
370+
.remember/
371+
372+
# VitePress docs
373+
docs/node_modules/
374+
docs/.vitepress/cache/
375+
docs/.vitepress/dist/

docs/.vitepress/config.mts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import {defineConfig, type HeadConfig} from 'vitepress'
2+
3+
const base = '/ExpressiveSharp/'
4+
5+
const umamiScript: HeadConfig = ["script", {
6+
defer: "true",
7+
src: "https://cloud.umami.is/script.js",
8+
"data-website-id": "TBD",
9+
}]
10+
11+
const baseHeaders: HeadConfig[] = [
12+
['link', { rel: 'icon', type: 'image/png', href: `${base}logo.png` }],
13+
['meta', { property: 'og:type', content: 'website' }],
14+
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
15+
];
16+
17+
const headers = process.env.GITHUB_ACTIONS === "true" ?
18+
[...baseHeaders, umamiScript] :
19+
baseHeaders;
20+
21+
export default defineConfig({
22+
title: "ExpressiveSharp",
23+
description: "Modern C# syntax in LINQ expression trees — source-generated at compile time",
24+
base,
25+
head: headers,
26+
themeConfig: {
27+
logo: '/logo.png',
28+
nav: [
29+
{ text: 'Home', link: '/' },
30+
{ text: 'Guide', link: '/guide/introduction' },
31+
{ text: 'Reference', link: '/reference/expressive-attribute' },
32+
{ text: 'Advanced', link: '/advanced/how-it-works' },
33+
{ text: 'Recipes', link: '/recipes/computed-properties' },
34+
{ text: 'Benchmarks', link: '/dev/bench/' },
35+
],
36+
37+
sidebar: {
38+
'/guide/': [
39+
{
40+
text: 'Getting Started',
41+
items: [
42+
{ text: 'Introduction', link: '/guide/introduction' },
43+
{ text: 'Quick Start', link: '/guide/quickstart' },
44+
]
45+
},
46+
{
47+
text: 'Core APIs',
48+
items: [
49+
{ text: '[Expressive] Properties', link: '/guide/expressive-properties' },
50+
{ text: '[Expressive] Methods', link: '/guide/expressive-methods' },
51+
{ text: 'Extension Members', link: '/guide/extension-members' },
52+
{ text: 'Constructor Projections', link: '/guide/expressive-constructors' },
53+
{ text: 'ExpressionPolyfill.Create', link: '/guide/expression-polyfill' },
54+
{ text: 'IRewritableQueryable<T>', link: '/guide/rewritable-queryable' },
55+
{ text: 'EF Core Integration', link: '/guide/ef-core-integration' },
56+
]
57+
},
58+
{
59+
text: 'Extensions',
60+
items: [
61+
{ text: 'Window Functions (SQL)', link: '/guide/window-functions' },
62+
]
63+
},
64+
{
65+
text: 'Migration',
66+
items: [
67+
{ text: 'Migrating from Projectables', link: '/guide/migration-from-projectables' },
68+
]
69+
}
70+
],
71+
'/reference/': [
72+
{
73+
text: 'Reference',
74+
items: [
75+
{ text: '[Expressive] Attribute', link: '/reference/expressive-attribute' },
76+
{ text: '[ExpressiveFor] Mapping', link: '/reference/expressive-for' },
77+
{ text: 'Null-Conditional Rewrite', link: '/reference/null-conditional-rewrite' },
78+
{ text: 'Pattern Matching', link: '/reference/pattern-matching' },
79+
{ text: 'Switch Expressions', link: '/reference/switch-expressions' },
80+
{ text: 'Expression Transformers', link: '/reference/expression-transformers' },
81+
{ text: 'Diagnostics & Code Fixes', link: '/reference/diagnostics' },
82+
]
83+
}
84+
],
85+
'/advanced/': [
86+
{
87+
text: 'Advanced',
88+
items: [
89+
{ text: 'How It Works', link: '/advanced/how-it-works' },
90+
{ text: 'IOperation to Expression Mapping', link: '/advanced/ioperation-mapping' },
91+
{ text: 'Block-Bodied Members', link: '/advanced/block-bodied-members' },
92+
{ text: 'Custom Transformers', link: '/advanced/custom-transformers' },
93+
{ text: 'Testing Strategy', link: '/advanced/testing-strategy' },
94+
{ text: 'Limitations', link: '/advanced/limitations' },
95+
]
96+
}
97+
],
98+
'/recipes/': [
99+
{
100+
text: 'Recipes',
101+
items: [
102+
{ text: 'Computed Entity Properties', link: '/recipes/computed-properties' },
103+
{ text: 'DTO Projections with Constructors', link: '/recipes/dto-projections' },
104+
{ text: 'Scoring & Classification', link: '/recipes/scoring-classification' },
105+
{ text: 'Nullable Navigation Properties', link: '/recipes/nullable-navigation' },
106+
{ text: 'Reusable Query Filters', link: '/recipes/reusable-query-filters' },
107+
{ text: 'External Member Mapping', link: '/recipes/external-member-mapping' },
108+
{ text: 'Modern Syntax in LINQ Chains', link: '/recipes/modern-syntax-in-linq' },
109+
{ text: 'Window Functions & Ranking', link: '/recipes/window-functions-ranking' },
110+
]
111+
}
112+
],
113+
},
114+
115+
socialLinks: [
116+
{ icon: 'github', link: 'https://github.com/EFNext/ExpressiveSharp' }
117+
],
118+
119+
search: {
120+
provider: 'local'
121+
},
122+
123+
footer: {
124+
message: 'Released under the MIT License.',
125+
copyright: 'Copyright &copy; ExpressiveSharp Contributors'
126+
}
127+
}
128+
})

docs/.vitepress/theme/custom.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* ExpressiveSharp — purple/violet brand palette
3+
* Visually distinct from the default VitePress blue theme
4+
*/
5+
6+
:root {
7+
--vp-c-brand-1: #7c3aed;
8+
--vp-c-brand-2: #6d28d9;
9+
--vp-c-brand-3: #5b21b6;
10+
--vp-c-brand-soft: rgba(124, 58, 237, 0.14);
11+
12+
--vp-button-brand-border: transparent;
13+
--vp-button-brand-text: #fff;
14+
--vp-button-brand-bg: var(--vp-c-brand-1);
15+
--vp-button-brand-hover-border: transparent;
16+
--vp-button-brand-hover-text: #fff;
17+
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
18+
--vp-button-brand-active-border: transparent;
19+
--vp-button-brand-active-text: #fff;
20+
--vp-button-brand-active-bg: var(--vp-c-brand-3);
21+
22+
--vp-home-hero-name-color: transparent;
23+
--vp-home-hero-name-background: -webkit-linear-gradient(
24+
120deg,
25+
#7c3aed 30%,
26+
#4f46e5
27+
);
28+
29+
--vp-home-hero-image-background-image: linear-gradient(
30+
-45deg,
31+
#7c3aed50 50%,
32+
#4f46e550 50%
33+
);
34+
--vp-home-hero-image-filter: blur(44px);
35+
}
36+
37+
.dark {
38+
--vp-c-brand-1: #a78bfa;
39+
--vp-c-brand-2: #8b5cf6;
40+
--vp-c-brand-3: #7c3aed;
41+
--vp-c-brand-soft: rgba(167, 139, 250, 0.14);
42+
43+
--vp-button-brand-bg: var(--vp-c-brand-2);
44+
--vp-button-brand-hover-bg: var(--vp-c-brand-1);
45+
--vp-button-brand-active-bg: var(--vp-c-brand-3);
46+
}

docs/.vitepress/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import './custom.css'
3+
4+
export default DefaultTheme

0 commit comments

Comments
 (0)