Skip to content

Commit cee2e24

Browse files
authored
docs: setup astro starlight website (#35)
* fix: Change EngineConfig default model to phi-3-mini - Change default from phi-3-mini-4k-instruct to phi-3-mini - Ensures consistency with LlamaCppEngine and LocalInferenceEngine defaults - Prevents silent fallback when using default EngineConfig * test: Update tests to expect phi-3-mini as default model - Update EngineConfig default value assertions - Update factory test to verify no fallback occurs - Ensure tests reflect unified default model name * refactor: Replace LocalInferenceEngine import with LlamaCppEngine - Change import from manager to local.llama_cpp - Update _ENGINE_INSTANCE type hint - Update get_engine() return type and docstring - Remove warnings.catch_warnings() block (no deprecation warning needed) * refactor: Replace LocalInferenceEngine with LlamaCppEngine in clean, scrub, extract - Update clean() to use LlamaCppEngine - Update scrub() to use LlamaCppEngine - Update extract() to use LlamaCppEngine - Update docstring references * refactor: Update NarwhalsEngine type hints to use LlamaCppEngine - Change TYPE_CHECKING import from LocalInferenceEngine to LlamaCppEngine - Update _process_chunks_parallel type hint - Update process_column type hint * refactor: Remove unused warnings import from __init__.py * fix: Handle Optional parameters when creating LlamaCppEngine - Only pass parameters to LlamaCppEngine if they are not None - Fixes mypy type errors for Optional parameters - Maintains backward compatibility with public API * docs: configure Astro Starlight for GitHub Pages - Set site URL to https://nxank4.github.io - Set base path to /loclean - Configure sidebar with autogenerate for all sections - Add custom CSS path * docs: add splash page with hero section and feature cards - Add index.mdx with splash template - Include hero section with tagline and actions - Add CardGrid with 4 feature cards (Privacy First, Structured Extraction, Local & Fast, Backend Agnostic) * docs: add getting started documentation - Add installation.md with requirements and installation instructions - Add quick-start.md with structured extraction examples - Include sidebar order for proper navigation * docs: add user guide documentation - Add privacy.md for PII scrubbing features - Add extraction.md for structured extraction with Pydantic - Add models.md for model management CLI * docs: add custom CSS file for theme customization * ci: add GitHub Actions workflow for docs deployment - Auto-deploy to GitHub Pages on push to main - Build Astro site and upload artifacts - Deploy using actions/deploy-pages@v4 * chore: update .gitignore for website directory - Ignore website/node_modules/ - Ignore website/dist/ - Ignore website/.astro/ * docs: add Astro Starlight template files - Add package.json and TypeScript config - Add public assets (favicon) - Add content config and reference example - Add VS Code settings
1 parent 3bd6306 commit cee2e24

21 files changed

Lines changed: 560 additions & 1 deletion

File tree

.github/workflows/deploy_docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 🚀 Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'website/**'
9+
- '.github/workflows/deploy_docs.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: 'pages'
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
name: Build Documentation
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
cache: 'npm'
34+
cache-dependency-path: website/package-lock.json
35+
36+
- name: Install dependencies
37+
working-directory: website
38+
run: npm ci
39+
40+
- name: Build
41+
working-directory: website
42+
run: npm run build
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: website/dist
48+
49+
deploy:
50+
name: Deploy to GitHub Pages
51+
runs-on: ubuntu-latest
52+
needs: build
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,9 @@ cython_debug/
146146
uv.lock
147147

148148
# Ignore Cursor files
149-
.cursor/
149+
.cursor/
150+
151+
# Astro/Starlight website
152+
website/node_modules/
153+
website/dist/
154+
website/.astro/

website/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

website/.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+
}

website/.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+
}

website/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).

website/astro.config.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
// QUAN TRỌNG: Cấu hình cho GitHub Pages
8+
site: 'https://nxank4.github.io',
9+
base: '/loclean',
10+
integrations: [
11+
starlight({
12+
title: 'Loclean',
13+
social: {
14+
github: 'https://github.com/nxank4/loclean',
15+
},
16+
sidebar: [
17+
{
18+
label: '🚀 Getting Started',
19+
autogenerate: { directory: 'getting-started' },
20+
},
21+
{
22+
label: '📘 User Guide',
23+
autogenerate: { directory: 'guides' },
24+
},
25+
{
26+
label: '🔬 API Reference',
27+
autogenerate: { directory: 'reference' },
28+
},
29+
],
30+
customCss: ['./src/styles/custom.css'],
31+
}),
32+
],
33+
});

website/package.json

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

website/public/favicon.svg

Lines changed: 1 addition & 0 deletions
Loading

website/src/assets/houston.webp

96.2 KB
Loading

0 commit comments

Comments
 (0)