|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +ut.code(); Learn is a web technology learning platform built with Docusaurus. It provides educational materials for web development, covering HTML, CSS, JavaScript, Node.js, React, and more advanced topics. The content is written in MDX format and automatically generates a documentation website. |
| 8 | + |
| 9 | +## Common Commands |
| 10 | + |
| 11 | +### Development |
| 12 | + |
| 13 | +```bash |
| 14 | +npm ci # Install dependencies (preferred over npm install) |
| 15 | +npm start # Start development server with hot reload |
| 16 | +npm run build # Build production site |
| 17 | +npm run serve # Serve built site locally |
| 18 | +``` |
| 19 | + |
| 20 | +### Code Quality |
| 21 | + |
| 22 | +```bash |
| 23 | +npm run format # Format code with Prettier |
| 24 | +npm run format:check # Check code formatting |
| 25 | +``` |
| 26 | + |
| 27 | +### Before Committing |
| 28 | + |
| 29 | +Always run these commands before committing: |
| 30 | + |
| 31 | +```bash |
| 32 | +npm run format |
| 33 | +npm run build |
| 34 | +``` |
| 35 | + |
| 36 | +## Architecture |
| 37 | + |
| 38 | +### Directory Structure |
| 39 | + |
| 40 | +- `docs/` - Main content directory with MDX files |
| 41 | + - `1-trial-session/` - Beginner tutorials |
| 42 | + - `2-browser-apps/` - Browser-based applications |
| 43 | + - `3-web-servers/` - Server-side development |
| 44 | + - `4-advanced/` - Advanced topics (TypeScript, React, bundlers) |
| 45 | + - `5-team-development/` - Team development practices |
| 46 | + - `_samples/` - Code examples within each section |
| 47 | +- `src/` - Docusaurus customizations |
| 48 | + - `components/` - Custom React components for MDX |
| 49 | + - `css/` - Custom styling |
| 50 | + - `pages/` - Static pages |
| 51 | + - `theme/` - Theme customizations |
| 52 | +- `static/` - Static assets (images, etc.) |
| 53 | + |
| 54 | +### Content Structure |
| 55 | + |
| 56 | +- All content files are `index.mdx` within their respective directories |
| 57 | +- Sidebar navigation is auto-generated based on directory structure |
| 58 | +- Each section contains practical code samples in `_samples/` subdirectories |
| 59 | + |
| 60 | +### Custom Components |
| 61 | + |
| 62 | +The following custom components are available for use in MDX files: |
| 63 | + |
| 64 | +- `<Term>` - Add popup explanations for technical terms |
| 65 | +- `<Answer>` - Collapsible answer sections for exercises |
| 66 | +- `<ViewSource>` - Buttons to view code on GitHub and CodeSandbox |
| 67 | +- `<ExternalVideoPlayer>` - Embed external videos |
| 68 | +- `<SlideShow>` - Create image slideshows |
| 69 | + |
| 70 | +### Sample Code Organization |
| 71 | + |
| 72 | +Code examples are organized in `_samples/` directories within each topic: |
| 73 | + |
| 74 | +- Each sample has its own `package.json` with dependencies |
| 75 | +- Samples are referenced from main content using `<ViewSource>` component |
| 76 | +- Many samples are runnable Node.js or browser applications |
| 77 | + |
| 78 | +## Development Notes |
| 79 | + |
| 80 | +### Content Editing |
| 81 | + |
| 82 | +- Edit `index.mdx` files in the appropriate `docs/` subdirectory |
| 83 | +- Use MDX syntax (Markdown + JSX components) |
| 84 | +- Math expressions supported via KaTeX (use `$$` for block math, `$` for inline) |
| 85 | +- Mermaid diagrams supported |
| 86 | +- Code highlighting with Prism.js |
| 87 | + |
| 88 | +### Node Version |
| 89 | + |
| 90 | +- Requires Node.js >= 18.0 (specified in `package.json`) |
| 91 | +- Uses `.nvmrc` file for version management |
| 92 | + |
| 93 | +### Formatting |
| 94 | + |
| 95 | +- Uses Prettier for code formatting |
| 96 | +- VSCode configured to use Prettier as default formatter |
| 97 | +- Empty `.prettierrc.json` uses default Prettier settings |
0 commit comments