Skip to content

Commit

Permalink
feat(base): Adding Astro package for testing new documentation for Ou…
Browse files Browse the repository at this point in the history
…tline proper.
  • Loading branch information
himerus committed Oct 17, 2023
1 parent b738317 commit 467e80e
Show file tree
Hide file tree
Showing 46 changed files with 4,611 additions and 4,834 deletions.
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { dirname, join } from 'path';
const outlineConfig = require('../outline.config');

const excludedStories = outlineConfig.excludedStories;
console.log(excludedStories);
function getExcluded() {
return excludedStories.join('|');
}
Expand Down
21 changes: 21 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -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
57 changes: 39 additions & 18 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
# Outline Documentation
# Starlight Starter Kit: Basics

Developing for Outline has different considerations than developing with Outline.
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

## Developing With Outline
```
npm create astro@latest -- --template starlight
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)

If you are using Outline to create a design system, you should refer to the scaffolding information in the main [../README.md](README.md) file along with the documentation in the [../packages/outline-docs](@phase2/outline-docs) package. This package should be added by default when you initialize your Outline project and its contents should show in your project's Storybook instance.
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## Developing For Outline
## 🚀 Project Structure

If you are developing to improve Outline there are two modes to consider for Outline packages:
Inside of your Astro + Starlight project, you'll see the following folders and files:

* running in the context of the Outline project
* running in the context of a project using Outline.
```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Running in the context of the Outline project is relatively straightforward as it simply involves running commands in this repo. For example, `yarn run start` will start Storybook in dev mode. Running in the context of a project, however, is more complicated. There are two techniques you should be aware of.
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.

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

If you want to test your work within the context of a project and your change doesn't involve the installation of a package or initialization of a project, [linking techniques](https://classic.yarnpkg.com/lang/en/docs/cli/link/) may be sufficient for your needs.
Static assets, like favicons, can be placed in the `public/` directory.

### Outline CLI and project template development
## 🧞 Commands

When adjusting the project initialization process it can be executed via direct reference instead of using the `@phase2/outline-cli` package. There is also a flag to the `init` command, `-l`, that will cause the templates used to come from the `../packages/outline-templates` and `../packages/outline-storybook` directories instead of the published `@phase2/outline-templates` and `@phase2/outline-storybook` packages. It will also cause the initial `yarnpkg` command in the generated project to be skipped.
All commands are run from the root of the project, from a terminal:

For example, to spin up a project directory as a sibling to this repo run:
| 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 |

```bash
npx ./outline/packages/outline-cli init -l
```
## 👀 Want to learn more?

> Note: Do not forget to execute a build before testing the project initialization process. Use of the -l flag does not currently cause any initially installed packages to use linking technique above.
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).
28 changes: 28 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: 'Outline Documentation',
social: {
github: 'https://github.com/phase2/outline',
},
sidebar: [
{
label: 'Developer Guides',
autogenerate: { directory: 'guides' },
},
{
label: 'Product Reference',
autogenerate: { directory: 'reference' },
},
{
label: 'Components',
autogenerate: { directory: 'components' },
},
],
}),
],
});
18 changes: 18 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@phase2/outline-docs",
"type": "module",
"private": true,
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.11.1",
"astro": "^3.2.3",
"sharp": "^0.32.5"
}
}
1 change: 1 addition & 0 deletions docs/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/houston.webp
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/src/assets/outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
};
Loading

0 comments on commit 467e80e

Please sign in to comment.