-
Notifications
You must be signed in to change notification settings - Fork 40
chore: upgrade tailwind & add shadcn/ui, implement multi-level docs config (closes #6)Feat/add multilevel directory #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: upgrade tailwind & add shadcn/ui, implement multi-level docs config (closes #6)Feat/add multilevel directory #7
Conversation
…ing for improved theming
…uted fields for ordering and nesting level
…d bilingual support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades Tailwind CSS to v4 and implements a multi-level directory structure for documentation content, enabling a "Folder as a Book" organization system. It also prepares the project for future UI development by adding shadcn/ui components.
- Upgraded Tailwind CSS from v3 to v4 with new PostCSS configuration
- Implemented hierarchical documentation structure with automated URL generation and navigation
- Enhanced Contentlayer configuration to support multi-level folder organization with computed fields for routing
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 49 comments.
Show a summary per file
| File | Description |
|---|---|
| tailwind.config.ts | Completely removed to use Tailwind v4's new configuration approach |
| postcss.config.mjs | Updated to use new Tailwind v4 PostCSS plugin |
| package.json | Added shadcn/ui dependencies and upgraded Tailwind to v4 |
| lib/utils.ts | Added utility function for class name merging (shadcn/ui pattern) |
| contentlayer.config.ts | Enhanced with multi-level directory support and computed fields |
| components.json | Added shadcn/ui configuration |
| app/globals.css | Migrated to Tailwind v4 syntax with extensive theme variables |
| app/docs/computer-science/ | Added example documentation structure demonstrating nested organization |
| README.md | Completely rewritten with comprehensive project documentation |
| CONTRIBUTING.md | Significantly expanded with detailed contribution guidelines |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| disableImportAliasWarning: true, | ||
| }) | ||
| import { defineDocumentType, makeSource } from 'contentlayer/source-files' | ||
| // import remarkGfm from 'remark-gfm' |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is in Chinese but should be in English to maintain consistency. Consider: '// Temporarily removed remarkGfm to resolve compatibility issues'
| contentDirPath: 'app/docs', | ||
| documentTypes: [Doc], | ||
| mdx: { | ||
| remarkPlugins: [], // 暂时移除 remarkGfm 以解决兼容性问题 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is in Chinese. For consistency with the codebase, use English: '// Temporarily removed remarkGfm to resolve compatibility issues'
| remarkPlugins: [], // 暂时移除 remarkGfm 以解决兼容性问题 | |
| remarkPlugins: [], // Temporarily removed remarkGfm to resolve compatibility issues |
| return removedData; | ||
| } | ||
|
|
||
| // 删除指定值的第一个节点 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed language comments detected. The comment should be in English: '// Remove the first node with specified value'
| // 删除指定值的第一个节点 | |
| // Remove the first node with specified value |
| return false; | ||
| } | ||
|
|
||
| // 如果头节点就是要删除的节点 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment should be in English: '// If the head node is the one to be deleted'
| // 如果头节点就是要删除的节点 | |
| // If the head node is the one to be deleted |
| current = current.next; | ||
| } | ||
|
|
||
| // 找到了要删除的节点 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment should be in English: '// Found the node to be deleted'
| // 找到了要删除的节点 | |
| // Found the node to be deleted |
| // 不同的增长策略 | ||
| const GROWTH_STRATEGIES = { | ||
| DOUBLE: (capacity) => capacity * 2, // 快速增长,可能浪费内存 | ||
| GOLDEN_RATIO: (capacity) => Math.floor(capacity * 1.5), // 平衡增长 | ||
| FIBONACCI: (capacity) => capacity + previousCapacity, // 渐进增长 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments should be in English: '// Different growth strategies', '// Fast growth, may waste memory', '// Balanced growth', '// Progressive growth'
| // 不同的增长策略 | |
| const GROWTH_STRATEGIES = { | |
| DOUBLE: (capacity) => capacity * 2, // 快速增长,可能浪费内存 | |
| GOLDEN_RATIO: (capacity) => Math.floor(capacity * 1.5), // 平衡增长 | |
| FIBONACCI: (capacity) => capacity + previousCapacity, // 渐进增长 | |
| // Different growth strategies | |
| const GROWTH_STRATEGIES = { | |
| DOUBLE: (capacity) => capacity * 2, // Fast growth, may waste memory | |
| GOLDEN_RATIO: (capacity) => Math.floor(capacity * 1.5), // Balanced growth | |
| FIBONACCI: (capacity) => capacity + previousCapacity, // Progressive growth |
| ### 2. 预分配容量 | ||
|
|
||
| ```javascript | ||
| // 如果知道大概的数据量,可以预分配容量 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section heading and comment should be in English: '### 2. Pre-allocate Capacity' and '// If you know the approximate data size, you can pre-allocate capacity'
| ### 2. 预分配容量 | |
| ```javascript | |
| // 如果知道大概的数据量,可以预分配容量 | |
| ### 2. Pre-allocate Capacity | |
| ```javascript | |
| // If you know the approximate data size, you can pre-allocate capacity |
| this.data = new Array(this.capacity); | ||
| } | ||
|
|
||
| // 预留容量 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment should be in English: '// Reserve capacity'
| // 预留容量 | |
| // Reserve capacity |
| ### 3. 内存对齐优化 | ||
|
|
||
| ```cpp | ||
| // C++ 中考虑内存对齐 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section heading and comment should be in English: '### 3. Memory Alignment Optimization' and '// Consider memory alignment in C++'
| ### 3. 内存对齐优化 | |
| ```cpp | |
| // C++ 中考虑内存对齐 | |
| ### 3. Memory Alignment Optimization | |
| ```cpp | |
| // Consider memory alignment in C++ |
| size_t size; | ||
| size_t capacity; | ||
|
|
||
| // 确保容量是 2 的幂次,有利于内存对齐 |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment should be in English: '// Ensure capacity is a power of 2, beneficial for memory alignment'
| // 确保容量是 2 的幂次,有利于内存对齐 | |
| // Ensure capacity is a power of 2, beneficial for memory alignment |
Changes
Dependencies
tailwindcssto the latest versionshadcn/uifor future component developmentDocs System
Implementing "Folder as a Book" Content Structure:
contentlayer.config.tsto support a hierarchical "Folder as a Book" structure. This automatically generates clean URLs, manages content order, and determines content nesting levels based on the file system.slug,slugAsParams,order, andlevelas computed fields in Contentlayer for dynamic routing and navigation.Verification
pnpm installafter pulling this branchpnpm dev/docs/...