|
1 | | -# Website |
| 1 | +# EDS Documentation Website |
2 | 2 |
|
3 | | -This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. |
| 3 | +This documentation website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. It provides comprehensive documentation, guidelines, and resources for the Equinor Design System. |
4 | 4 |
|
5 | | -## Installation |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Before you begin, ensure you have the following installed: |
| 8 | + |
| 9 | +* **Node.js** -- Version 16.15 or compatible |
| 10 | +* **pnpm** -- Version 10.15.0 or higher (install globally with `npm install -g pnpm`) |
| 11 | + |
| 12 | +## Important Note |
| 13 | + |
| 14 | +This documentation site is part of the EDS monorepo. All commands should be run from the **root directory** of the monorepo, not from this directory. |
| 15 | + |
| 16 | +If you haven't already, start by setting up the monorepo: |
| 17 | +- First navigate to the root directory |
| 18 | +- Then install dependencies and build packages by running `pnpm run init` |
| 19 | + |
| 20 | +## Available Commands |
| 21 | + |
| 22 | +Run these commands from the **root directory** of the monorepo: |
| 23 | + |
| 24 | +### Local Development |
| 25 | + |
| 26 | +```bash |
| 27 | +pnpm docu:start |
| 28 | +``` |
| 29 | + |
| 30 | +This command starts a local development server at `http://localhost:3000` and opens your browser. Most changes are reflected live without needing to restart the server. |
| 31 | + |
| 32 | +### Build |
| 33 | + |
| 34 | +```bash |
| 35 | +pnpm docu:build |
| 36 | +``` |
| 37 | + |
| 38 | +This command extracts prerequisites and generates static content into the `build` directory. You can serve this content using any static hosting service. |
| 39 | + |
| 40 | +### Serve Built Site |
| 41 | + |
| 42 | +```bash |
| 43 | +pnpm docu:serve |
| 44 | +``` |
| 45 | + |
| 46 | +Use this command to preview the production build locally before deploying. |
| 47 | + |
| 48 | +### Clear Cache |
6 | 49 |
|
7 | 50 | ```bash |
8 | | -yarn |
| 51 | +pnpm docu:clear |
9 | 52 | ``` |
10 | 53 |
|
11 | | -## Local Development |
| 54 | +If you encounter issues, clear the Docusaurus cache with this command. |
| 55 | + |
| 56 | +### Extract Prerequisites |
12 | 57 |
|
13 | 58 | ```bash |
14 | | -yarn start |
| 59 | +pnpm docu:prerequisites |
15 | 60 | ``` |
16 | 61 |
|
17 | | -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
| 62 | +This command extracts prerequisite information from package files. It runs automatically during the build process. |
18 | 63 |
|
19 | | -## Build |
| 64 | +### Lint |
20 | 65 |
|
21 | 66 | ```bash |
22 | | -yarn build |
| 67 | +pnpm lint:docs |
23 | 68 | ``` |
24 | 69 |
|
25 | | -This command generates static content into the `build` directory and can be served using any static contents hosting service. |
| 70 | +Run ESLint to check for code quality issues in the documentation site. |
| 71 | + |
| 72 | +## Project Structure |
| 73 | + |
| 74 | +The documentation site includes: |
| 75 | + |
| 76 | +* **docs/** -- Documentation content in Markdown and MDX format |
| 77 | +* **src/** -- Custom React components and pages |
| 78 | +* **static/** -- Static assets like images and files |
| 79 | +* **docusaurus.config.ts** -- Docusaurus configuration |
| 80 | + |
| 81 | +## Writing Documentation |
| 82 | + |
| 83 | +When adding or updating documentation: |
| 84 | + |
| 85 | +1. Create or edit Markdown/MDX files in the `docs/` directory |
| 86 | +2. Use clear headings and structure for easy navigation |
| 87 | +3. Test your changes locally with `pnpm docu:start` |
| 88 | +4. Ensure all links work correctly |
| 89 | + |
| 90 | +## Writing Tone Guides |
| 91 | + |
| 92 | +When creating content for the documentation site, choose the appropriate tone guide: |
| 93 | + |
| 94 | +* [Friendly Professional](./docs/tone-guide/friendly-professional.md) -- Default for most documentation |
| 95 | +* [Friendly Minimalist Blend](./docs/tone-guide/friendly-minimalist-blend.md) -- Concise but approachable |
| 96 | +* [Minimalist](./docs/tone-guide/minimalist.md) -- Essential information only |
26 | 97 |
|
27 | | -## Deployment |
| 98 | +## Technology Stack |
28 | 99 |
|
29 | | -Using SSH: |
| 100 | +The documentation site uses: |
| 101 | + |
| 102 | +* **Docusaurus** -- Static site generator |
| 103 | +* **React** -- UI framework |
| 104 | +* **TypeScript** -- Type-safe JavaScript |
| 105 | +* **MDX** -- Markdown with React components |
| 106 | +* **EDS Tokens & Components** -- Equinor Design System packages |
| 107 | + |
| 108 | +## Troubleshooting |
| 109 | + |
| 110 | +### Port Already in Use |
| 111 | + |
| 112 | +If port 3000 is already in use, either stop the conflicting process or Docusaurus will automatically use the next available port. |
| 113 | + |
| 114 | +### Build Fails |
| 115 | + |
| 116 | +Try clearing the cache, rebuilding and then restarting: |
30 | 117 |
|
31 | 118 | ```bash |
32 | | -USE_SSH=true yarn deploy |
| 119 | +pnpm docu:clear |
| 120 | +pnpm docu:build |
| 121 | +pnpm docu:start |
33 | 122 | ``` |
34 | 123 |
|
35 | | -Not using SSH: |
| 124 | +### Module Not Found Errors |
| 125 | + |
| 126 | +Ensure all dependencies are installed by running from the root: |
36 | 127 |
|
37 | 128 | ```bash |
38 | | -GIT_USER=<Your GitHub username> yarn deploy |
| 129 | +pnpm install |
39 | 130 | ``` |
40 | 131 |
|
41 | | -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
| 132 | +## Contributing |
| 133 | + |
| 134 | +When contributing to the documentation: |
| 135 | + |
| 136 | +1. Follow the [contribution guidelines](../../README.md#contributions) |
| 137 | +2. Use the appropriate [tone guide](#writing-tone-guides) for your content |
| 138 | +3. Test locally before submitting a pull request |
| 139 | +4. Ensure all links and images work correctly |
| 140 | + |
| 141 | +## Need Help? |
| 142 | + |
| 143 | +* Check the main [project README](../../README.md) for more information about the monorepo |
| 144 | +* Visit the [Docusaurus documentation](https://docusaurus.io/docs) for site-specific questions |
| 145 | +* Join the conversation on Slack: [#eds-design-system](https://equinor.slack.com/archives/CJT20H1B9) |
0 commit comments