Skip to content

Commit

Permalink
Merge pull request #1920 from rosahbruno/gleanjs-docs
Browse files Browse the repository at this point in the history
Bug 1894945 - new Glean.js docs platform MVP
  • Loading branch information
rosahbruno committed May 3, 2024
2 parents 111cab5 + b9d9157 commit 38b60ca
Show file tree
Hide file tree
Showing 28 changed files with 10,048 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .dictionary
@@ -1,6 +1,7 @@
personal_ws-1.1 en 82
API's
APIs
Astro
BUGFIX
BrowserStack
CLI
Expand All @@ -17,14 +18,18 @@ JSDoc
JWK
LocalStorage
MPL
Nodejs
Nextjs
PingType
PlatformInfo
Programmatically
QML
QuantityMetricType
README
SDK
SDK's
SDKs
SPAs
TODO
TimespanMetricType
TypeScript
Expand All @@ -45,10 +50,13 @@ config
datetime
deserialize
deserializing
dev
dexter
enqueued
enum
dashboarding
falsy
favicons
firefox
getters
gzip
Expand All @@ -61,20 +69,26 @@ js
json
linter
linters
localStorage
md
mdroettboom
mozilla
npm
pre
prerelease
queueing
runtime
schemas
sendbeacon
sendBeacon
sessionStorage
setRawNanos
setUploadEnabled
ssr
timespan
travis
unminified
uploadEnabled
uploader
uploaders
url
Expand Down
21 changes: 21 additions & 0 deletions documentation/.gitignore
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
4 changes: 4 additions & 0 deletions documentation/.vscode/extensions.json
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions documentation/.vscode/launch.json
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
41 changes: 41 additions & 0 deletions documentation/README.md
@@ -0,0 +1,41 @@
# Glean.js docs

Built with [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/).

This project houses all Glean.js documentation. All custom UI components are built using Svelte.

## 🚀 Project Structure

```
.
├── public/
├── src/
│ ├── assets/
│ ├── components/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

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.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Static assets, like favicons, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
81 changes: 81 additions & 0 deletions documentation/astro.config.mjs
@@ -0,0 +1,81 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

import svelte from "@astrojs/svelte";

// https://astro.build/config
export default defineConfig({
integrations: [starlight({
title: 'Glean.js',
components: {
// Override the default `SocialIcons` component.
PageTitle: './src/components/CustomPageTitle.astro'
},
social: {
github: 'https://github.com/mozilla/glean.js'
},
sidebar: [{
label: 'Introduction',
items: [
// Each item here is one entry in the navigation menu.
{
label: 'Overview',
link: '/'
}, {
label: 'Interactive playground',
link: '/playground'
}, {
label: 'Roadmap 🔒',
link: 'https://docs.google.com/document/d/1vqu9O9VRGRiuptQbGPY5UX-cH2gkUSVj4EoZizQtHGM/edit#heading=h.m18zbbjlaigo',
attrs: {
target: '_blank',
style: 'font-style: italic'
}
}]
}, {
label: 'Getting Started',
items: [{
label: 'Platforms',
link: '/getting_started/platforms'
}, {
label: 'Installation',
link: '/getting_started/installation'
}, {
label: 'Setting up Glean',
link: '/getting_started/setup'
}, {
label: 'Integration guide',
link: 'https://mozilla.github.io/glean/book/user/adding-glean-to-your-project/index.html',
attrs: {
target: '_blank',
style: 'font-style: italic'
}
}]
}, {
label: 'Automatic Events',
items: [{
label: 'Page load events',
link: '/automatic_instrumentation/page_load_events'
}, {
label: 'Click events',
link: '/automatic_instrumentation/click_events'
}]
}, {
label: 'Debugging',
items: [{
label: 'Options',
link: '/debugging/options'
}, {
label: 'Browser debugging',
link: '/debugging/browser'
}]
}, {
// This auto generates a list for all md files in the
// `/documentation/src/content/docs/reference` directory.
label: 'Reference',
autogenerate: {
directory: 'reference'
}
}]
}), svelte()]
});

0 comments on commit 38b60ca

Please sign in to comment.