|
1 |
| -# @graphprotocol/guides |
| 1 | +# @graphprotocol/guides Demo |
2 | 2 |
|
3 |
| -A collection of guides and utilities for The Graph documentation site. |
| 3 | +This package contains a standalone Next.js application to demonstrate a filterable and searchable "Guides" page, inspired by Vercel's guides section. It is intended for internal demo purposes and can later be integrated into the main The Graph documentation site. |
4 | 4 |
|
5 |
| -## Development |
| 5 | +## Features |
6 | 6 |
|
7 |
| -``` |
8 |
| -# Install dependencies (from project root) |
9 |
| -pnpm install |
| 7 | +- Filter guides by Products, Guide Types, and Difficulty. |
| 8 | +- Fuzzy search across guide titles, descriptions, products, and types. |
| 9 | +- Guide detail pages displaying content (currently stubs). |
| 10 | +- Styled with Tailwind CSS. |
10 | 11 |
|
11 |
| -# In watch mode (inside this package) |
12 |
| -pnpm --filter @graphprotocol/guides dev |
13 |
| -``` |
| 12 | +## Running the Demo |
14 | 13 |
|
15 |
| -## Build |
| 14 | +1. **Install dependencies (from the project root):** |
| 15 | + ```bash |
| 16 | + pnpm install |
| 17 | + ``` |
16 | 18 |
|
| 19 | +2. **Start the development server for this package only:** |
| 20 | + ```bash |
| 21 | + pnpm --filter @graphprotocol/guides dev |
| 22 | + ``` |
| 23 | + |
| 24 | +3. **Open your browser to:** [http://localhost:3100/guides](http://localhost:3100/guides) |
| 25 | + |
| 26 | +## Structure |
| 27 | + |
| 28 | +- `pages/guides/index.tsx`: The main browse/filter page. |
| 29 | +- `pages/guides/[slug].tsx`: Individual guide detail page. |
| 30 | +- `data/guides.json`: Sample guide data (includes titles, descriptions, categories, content stubs, etc.). |
| 31 | +- `components/`: (Currently minimal, but can house reusable UI parts). |
| 32 | +- `styles/`: Global CSS and Tailwind setup. |
| 33 | +- `public/`: Static assets (if any). |
17 | 34 | ```
|
18 |
| -# Build the TypeScript sources |
19 |
| -pnpm --filter @graphprotocol/guides build |
20 |
| -``` |
21 | 35 |
|
22 |
| -The compiled JavaScript files and type declarations will be output to `dist/`. |
| 36 | +## Integration into Main Docs |
| 37 | + |
| 38 | +To integrate this into the main `@graphprotocol/docs` Nextra website: |
| 39 | + |
| 40 | +1. Copy the relevant page components (primarily `pages/guides/index.tsx` and `pages/guides/[slug].tsx`) into the `website/pages/` directory of the main documentation site. |
| 41 | +2. Adapt the data loading (`guides.json`) and styling (Tailwind/global CSS) to fit the existing Nextra structure. |
| 42 | +3. Ensure any shared components or utilities are correctly imported or moved. |
| 43 | +4. The filtering logic and Fuse.js setup can be largely reused. |
| 44 | + |
| 45 | +This package (`@graphprotocol/guides`) itself would then likely not be directly imported as a library, but its code would serve as the basis for the new section within the main documentation app. |
0 commit comments