feat: init project

This commit is contained in:
CoderLambert
2025-12-22 14:55:57 +08:00
commit 78d44c3bdf
5 changed files with 1677 additions and 0 deletions
+157
View File
@@ -0,0 +1,157 @@
# Dependencies
node_modules/
.pnpm-store/
# Build outputs
dist/
out/
.output/
# VitePress cache
config/.vitepress/cache/
.cache/
.temp/
# Lock files (keep package-lock.json but ignore pnpm-lock if using pnpm)
# pnpm-lock.yaml
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Coverage directory used by tools like istanbul
coverage/
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env.local
.env.production
.env.development
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# IDE files
.vscode/
.idea/
*.swp
*.swo
*~
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Temporary files
*.tmp
*.temp
+71
View File
@@ -0,0 +1,71 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a VitePress-based documentation site for Docker learning materials. The site contains educational content about Docker concepts, commands, and practices.
## Architecture
- **Documentation Framework**: VitePress 2.0.0-alpha.15
- **Content Structure**: Markdown files located in `/md/` directory
- **Configuration**: VitePress config in `/config/.vitepress/config.mts`
- **Additional Components**: Python API client example in `/lcal-api-client/`
### Directory Structure
```
/home/lambert/docs/
├── config/ # VitePress configuration
│ └── .vitepress/
│ ├── config.mts # Main VitePress configuration
│ └── cache/ # VitePress build cache
├── md/ # Markdown content files
│ ├── index.md # Homepage
│ ├── markdown-examples.md
│ ├── api-examples.md
│ └── 0*-docker-*.md # Docker tutorial content (numbered order)
├── lcal-api-client/ # Python API client example
│ ├── app.py # Main client script
│ ├── dockerfile # Docker configuration
│ └── requirements.txt # Python dependencies
├── package.json # Project dependencies and scripts
└── pnpm-lock.yaml # Package lock file
```
## Development Commands
### Documentation Development
- `pnpm run docs:dev` - Start VitePress development server in hot-reload mode
- `pnpm run docs:build` - Build the static documentation site
- `pnpm run docs:preview` - Preview the built documentation locally
### Package Management
- Uses `pnpm` as the package manager
- Install dependencies: `pnpm install`
## Key Files
### VitePress Configuration
- `/config/.vitepress/config.mts` - Main configuration file with site metadata, navigation, and theme settings
### Content Organization
- Source directory is configured as `../md` relative to the config file
- Navigation includes Home and Examples sections
- Sidebar contains Examples and API documentation sections
- Docker tutorial content follows numbered naming convention (01-why-docker.md, 02-why-mental-model.md, etc.)
### Python API Client
- Simple FastAPI client demonstration
- Uses environment variables for API host/port configuration
- Implements retry logic and error handling
- Includes Docker configuration for containerization
## Development Notes
- The site uses VitePress alpha version (2.0.0-alpha.15)
- Content is written in Markdown with VitePress frontmatter
- The homepage uses VitePress home layout with hero section and features
- Sidebar configuration groups related documentation together
- Python client demonstrates Docker container communication patterns
+34
View File
@@ -0,0 +1,34 @@
import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
srcDir: "../md",
title: "Docker 教程",
description: "从零开始学习 Docker,理解核心概念,掌握实用技能",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: '首页', link: '/' },
{ text: '教程', link: '/01-why-docker' }
],
sidebar: [
{
text: 'Docker 教程',
items: [
{ text: '第 1 章:为什么需要 Docker', link: '/01-why-docker' },
{ text: '第 2 章:Docker 是什么(从模型开始)', link: '/02-why-mental-model' },
{ text: '第 3 章:第一次真正使用 Docker', link: '/03-docker-run-basics' },
{ text: '第 4 章:Volume - 数据持久化', link: '/04-volume' },
{ text: '第 5 章:Network - 容器网络', link: '/05-network' },
{ text: '第 6 章:Dockerfile - 镜像构建', link: '/06-dockerfile' }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
}
})
+10
View File
@@ -0,0 +1,10 @@
{
"devDependencies": {
"vitepress": "2.0.0-alpha.15"
},
"scripts": {
"docs:dev": "vitepress dev config",
"docs:build": "vitepress build config",
"docs:preview": "vitepress preview config"
}
}
+1405
View File
File diff suppressed because it is too large Load Diff