specweave 0.23.16 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +93 -38
- package/CLAUDE.md +159 -11
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +57 -0
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-content.js +3 -0
- package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
- package/dist/src/cli/helpers/smart-filter.js +265 -0
- package/dist/src/cli/helpers/smart-filter.js.map +1 -0
- package/dist/src/core/progress/progress-tracker.d.ts +4 -1
- package/dist/src/core/progress/progress-tracker.d.ts.map +1 -1
- package/dist/src/core/progress/progress-tracker.js +33 -4
- package/dist/src/core/progress/progress-tracker.js.map +1 -1
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.js +2 -2
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +2 -2
- package/dist/src/core/qa/risk-calculator.js +2 -2
- package/dist/src/core/spec-content-sync.d.ts +1 -1
- package/dist/src/core/spec-content-sync.d.ts.map +1 -1
- package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
- package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
- package/dist/src/core/validators/ac-presence-validator.js +149 -0
- package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
- package/dist/src/integrations/ado/ado-dependency-loader.d.ts +1 -1
- package/dist/src/integrations/ado/ado-dependency-loader.d.ts.map +1 -1
- package/dist/src/integrations/ado/ado-dependency-loader.js +39 -7
- package/dist/src/integrations/ado/ado-dependency-loader.js.map +1 -1
- package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.js +267 -0
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
- package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
- package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
- package/dist/src/integrations/jira/filter-processor.js +207 -0
- package/dist/src/integrations/jira/filter-processor.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +13 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +33 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/utils/ac-embedder.d.ts +63 -0
- package/dist/src/utils/ac-embedder.d.ts.map +1 -0
- package/dist/src/utils/ac-embedder.js +217 -0
- package/dist/src/utils/ac-embedder.js.map +1 -0
- package/dist/src/utils/env-manager.d.ts +86 -0
- package/dist/src/utils/env-manager.d.ts.map +1 -0
- package/dist/src/utils/env-manager.js +188 -0
- package/dist/src/utils/env-manager.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
- package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
- package/plugins/specweave/commands/specweave-do.md +37 -0
- package/plugins/specweave/commands/specweave-done.md +159 -0
- package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
- package/plugins/specweave/commands/specweave-next.md +148 -3
- package/plugins/specweave/commands/specweave-qa.md +2 -2
- package/plugins/specweave/hooks/lib/migrate-increment-work.sh +1 -1
- package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +245 -0
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
- package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +149 -0
- package/plugins/specweave/hooks/lib/update-status-line.sh +34 -4
- package/plugins/specweave/hooks/lib/validate-spec-status.sh +1 -1
- package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +163 -0
- package/plugins/specweave/hooks/post-first-increment.sh +1 -1
- package/plugins/specweave/hooks/post-first-increment.sh.bak +61 -0
- package/plugins/specweave/hooks/post-spec-update.sh +1 -1
- package/plugins/specweave/hooks/post-spec-update.sh.bak +158 -0
- package/plugins/specweave/hooks/post-user-story-complete.sh +1 -1
- package/plugins/specweave/hooks/post-user-story-complete.sh.bak +179 -0
- package/plugins/specweave/hooks/pre-command-deduplication.sh +1 -1
- package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +83 -0
- package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +1 -1
- package/plugins/specweave/hooks/user-prompt-submit.sh.bak +386 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave/skills/specweave-framework/SKILL.md +1 -1
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ado/agents/ado-manager/AGENT.md +23 -0
- package/plugins/specweave-ado/agents/ado-multi-project-mapper/AGENT.md +23 -0
- package/plugins/specweave-ado/agents/ado-sync-judge/AGENT.md +23 -0
- package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
- package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
- package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
- package/plugins/specweave-backend/agents/database-optimizer/AGENT.md +23 -0
- package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
- package/plugins/specweave-backend/commands/crud-generate.md +109 -0
- package/plugins/specweave-backend/commands/migration-generate.md +139 -0
- package/plugins/specweave-confluent/agents/confluent-architect/AGENT.md +23 -0
- package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
- package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
- package/plugins/specweave-confluent/commands/schema-register.md +123 -0
- package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-core/commands/architecture-review.md +288 -0
- package/plugins/specweave-core/commands/code-review.md +213 -0
- package/plugins/specweave-core/commands/refactor-plan.md +249 -0
- package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
- package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
- package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
- package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
- package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
- package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
- package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-diagrams/agents/diagrams-architect/AGENT.md +23 -0
- package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
- package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-docs/commands/docs-generate.md +441 -0
- package/plugins/specweave-docs/commands/docs-init.md +334 -0
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
- package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-figma/commands/figma-import.md +690 -0
- package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
- package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
- package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
- package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
- package/plugins/specweave-frontend/commands/component-generate.md +510 -0
- package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
- package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
- package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/agents/github-manager/AGENT.md +23 -0
- package/plugins/specweave-github/agents/github-task-splitter/AGENT.md +25 -0
- package/plugins/specweave-github/agents/user-story-updater/AGENT.md +25 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
- package/plugins/specweave-github/lib/github-spec-content-sync.js +49 -0
- package/plugins/specweave-github/lib/github-spec-content-sync.ts +67 -0
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-infrastructure/agents/devops/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/network-engineer/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/performance-engineer/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/sre/AGENT.md +26 -0
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/agents/jira-manager/AGENT.md +26 -0
- package/plugins/specweave-jira/commands/import-projects.js +183 -0
- package/plugins/specweave-jira/commands/import-projects.md +97 -0
- package/plugins/specweave-jira/commands/import-projects.ts +288 -0
- package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +26 -0
- package/plugins/specweave-kafka/agents/kafka-devops/AGENT.md +26 -0
- package/plugins/specweave-kafka/agents/kafka-observability/AGENT.md +26 -0
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kubernetes/agents/kubernetes-architect/AGENT.md +26 -0
- package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
- package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
- package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
- package/plugins/specweave-ml/.claude-plugin/plugin.json +3 -3
- package/plugins/specweave-ml/agents/data-scientist/AGENT.md +26 -0
- package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +26 -0
- package/plugins/specweave-ml/agents/mlops-engineer/AGENT.md +26 -0
- package/plugins/specweave-mobile/agents/mobile-architect/AGENT.md +26 -0
- package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
- package/plugins/specweave-mobile/commands/build-config.md +256 -0
- package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-payments/agents/payment-integration/AGENT.md +26 -0
- package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +20 -0
- package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
- package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
- package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
- package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
- package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
- package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
- package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-release/agents/release-manager/AGENT.md +27 -0
- package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
- package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
- package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
- package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
- package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
- package/plugins/specweave-testing/commands/test-coverage.md +979 -0
- package/plugins/specweave-testing/commands/test-generate.md +1156 -0
- package/plugins/specweave-testing/commands/test-init.md +409 -0
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
- package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
- package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-ui/commands/ui-automate.md +199 -0
- package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
- package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
- package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
- package/plugins/specweave/commands/check-hooks.md +0 -257
- package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
- package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -340
- /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docusaurus
|
|
3
|
+
description: Docusaurus documentation expert. Specializes in creating, configuring, and deploying Docusaurus documentation sites, MDX authoring, plugin development, theming, versioning, and i18n. Activates for Docusaurus, documentation site, docs, MDX, markdown docs, static site generator, documentation framework, Docusaurus plugins, Docusaurus themes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Docusaurus Expert Skill
|
|
7
|
+
|
|
8
|
+
Expert in Docusaurus 3.x documentation framework - the modern static site generator for technical documentation, blogs, and landing pages.
|
|
9
|
+
|
|
10
|
+
## Core Competencies
|
|
11
|
+
|
|
12
|
+
### 1. Site Setup & Configuration
|
|
13
|
+
- **Installation**: Quick start with templates
|
|
14
|
+
- **Configuration**: `docusaurus.config.ts` best practices
|
|
15
|
+
- **Plugins**: Content, search, analytics, sitemap
|
|
16
|
+
- **Themes**: Classic, Material, custom themes
|
|
17
|
+
- **Deployment**: GitHub Pages, Netlify, Vercel, AWS
|
|
18
|
+
|
|
19
|
+
### 2. Content Authoring
|
|
20
|
+
- **Markdown**: Standard Markdown with Docusaurus extensions
|
|
21
|
+
- **MDX**: React components in Markdown
|
|
22
|
+
- **Code Blocks**: Syntax highlighting, live code editors
|
|
23
|
+
- **Admonitions**: Notes, tips, warnings, danger alerts
|
|
24
|
+
- **Tabs**: Multi-language examples, platform-specific content
|
|
25
|
+
|
|
26
|
+
### 3. Advanced Features
|
|
27
|
+
- **Versioning**: Multi-version documentation management
|
|
28
|
+
- **i18n**: Internationalization and localization
|
|
29
|
+
- **Search**: Algolia DocSearch, local search plugins
|
|
30
|
+
- **Mermaid**: Diagram support with @docusaurus/theme-mermaid
|
|
31
|
+
- **OpenAPI**: API documentation with docusaurus-plugin-openapi-docs
|
|
32
|
+
|
|
33
|
+
### 4. Customization
|
|
34
|
+
- **Custom Components**: React components for docs
|
|
35
|
+
- **Styling**: CSS modules, Tailwind CSS integration
|
|
36
|
+
- **Swizzling**: Customize theme components
|
|
37
|
+
- **Plugins**: Custom plugin development
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx create-docusaurus@latest my-website classic --typescript
|
|
45
|
+
cd my-website
|
|
46
|
+
npm start
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Project Structure
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
my-website/
|
|
53
|
+
├── docs/ # Documentation pages
|
|
54
|
+
│ ├── intro.md
|
|
55
|
+
│ └── tutorial/
|
|
56
|
+
├── blog/ # Blog posts (optional)
|
|
57
|
+
│ └── 2024-01-01-post.md
|
|
58
|
+
├── src/
|
|
59
|
+
│ ├── components/ # Custom React components
|
|
60
|
+
│ ├── css/ # Custom styles
|
|
61
|
+
│ └── pages/ # Standalone pages
|
|
62
|
+
├── static/ # Static assets
|
|
63
|
+
│ └── img/
|
|
64
|
+
├── docusaurus.config.ts # Main configuration
|
|
65
|
+
├── sidebars.ts # Sidebar configuration
|
|
66
|
+
└── package.json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
### Basic Configuration
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
// docusaurus.config.ts
|
|
75
|
+
import {Config} from '@docusaurus/types';
|
|
76
|
+
|
|
77
|
+
const config: Config = {
|
|
78
|
+
title: 'My Project',
|
|
79
|
+
tagline: 'Documentation made easy',
|
|
80
|
+
url: 'https://myproject.com',
|
|
81
|
+
baseUrl: '/',
|
|
82
|
+
|
|
83
|
+
// GitHub Pages deployment config
|
|
84
|
+
organizationName: 'facebook',
|
|
85
|
+
projectName: 'docusaurus',
|
|
86
|
+
|
|
87
|
+
// Theme config
|
|
88
|
+
themeConfig: {
|
|
89
|
+
navbar: {
|
|
90
|
+
title: 'My Project',
|
|
91
|
+
logo: {
|
|
92
|
+
alt: 'My Project Logo',
|
|
93
|
+
src: 'img/logo.svg',
|
|
94
|
+
},
|
|
95
|
+
items: [
|
|
96
|
+
{
|
|
97
|
+
type: 'doc',
|
|
98
|
+
docId: 'intro',
|
|
99
|
+
position: 'left',
|
|
100
|
+
label: 'Docs',
|
|
101
|
+
},
|
|
102
|
+
{to: '/blog', label: 'Blog', position: 'left'},
|
|
103
|
+
{
|
|
104
|
+
href: 'https://github.com/facebook/docusaurus',
|
|
105
|
+
label: 'GitHub',
|
|
106
|
+
position: 'right',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
footer: {
|
|
111
|
+
style: 'dark',
|
|
112
|
+
links: [
|
|
113
|
+
{
|
|
114
|
+
title: 'Docs',
|
|
115
|
+
items: [
|
|
116
|
+
{
|
|
117
|
+
label: 'Tutorial',
|
|
118
|
+
to: '/docs/intro',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
copyright: `Copyright © ${new Date().getFullYear()} My Project`,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
presets: [
|
|
128
|
+
[
|
|
129
|
+
'classic',
|
|
130
|
+
{
|
|
131
|
+
docs: {
|
|
132
|
+
sidebarPath: './sidebars.ts',
|
|
133
|
+
editUrl: 'https://github.com/facebook/docusaurus/tree/main/',
|
|
134
|
+
},
|
|
135
|
+
blog: {
|
|
136
|
+
showReadingTime: true,
|
|
137
|
+
editUrl: 'https://github.com/facebook/docusaurus/tree/main/',
|
|
138
|
+
},
|
|
139
|
+
theme: {
|
|
140
|
+
customCss: './src/css/custom.css',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export default config;
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## MDX Content Features
|
|
151
|
+
|
|
152
|
+
### Admonitions
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
:::note
|
|
156
|
+
This is a note
|
|
157
|
+
:::
|
|
158
|
+
|
|
159
|
+
:::tip
|
|
160
|
+
This is a tip
|
|
161
|
+
:::
|
|
162
|
+
|
|
163
|
+
:::warning
|
|
164
|
+
This is a warning
|
|
165
|
+
:::
|
|
166
|
+
|
|
167
|
+
:::danger
|
|
168
|
+
This is a danger alert
|
|
169
|
+
:::
|
|
170
|
+
|
|
171
|
+
:::info Custom Title
|
|
172
|
+
This is an info box with a custom title
|
|
173
|
+
:::
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Code Blocks with Features
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
\```typescript title="src/components/HelloWorld.tsx" showLineNumbers {1,3-5}
|
|
180
|
+
import React from 'react';
|
|
181
|
+
|
|
182
|
+
export function HelloWorld() {
|
|
183
|
+
return <h1>Hello World!</h1>;
|
|
184
|
+
}
|
|
185
|
+
\```
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Tabs
|
|
189
|
+
|
|
190
|
+
```markdown
|
|
191
|
+
import Tabs from '@theme/Tabs';
|
|
192
|
+
import TabItem from '@theme/TabItem';
|
|
193
|
+
|
|
194
|
+
<Tabs>
|
|
195
|
+
<TabItem value="js" label="JavaScript">
|
|
196
|
+
\```js
|
|
197
|
+
const greeting = 'Hello';
|
|
198
|
+
\```
|
|
199
|
+
</TabItem>
|
|
200
|
+
<TabItem value="ts" label="TypeScript">
|
|
201
|
+
\```ts
|
|
202
|
+
const greeting: string = 'Hello';
|
|
203
|
+
\```
|
|
204
|
+
</TabItem>
|
|
205
|
+
</Tabs>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Interactive Code Editors
|
|
209
|
+
|
|
210
|
+
```markdown
|
|
211
|
+
\```jsx live
|
|
212
|
+
function Clock() {
|
|
213
|
+
const [date, setDate] = useState(new Date());
|
|
214
|
+
useEffect(() => {
|
|
215
|
+
const timerID = setInterval(() => setDate(new Date()), 1000);
|
|
216
|
+
return () => clearInterval(timerID);
|
|
217
|
+
}, []);
|
|
218
|
+
return <div>{date.toLocaleTimeString()}</div>;
|
|
219
|
+
}
|
|
220
|
+
\```
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Plugins
|
|
224
|
+
|
|
225
|
+
### Essential Plugins
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
// docusaurus.config.ts
|
|
229
|
+
plugins: [
|
|
230
|
+
// Multiple docs instances
|
|
231
|
+
[
|
|
232
|
+
'@docusaurus/plugin-content-docs',
|
|
233
|
+
{
|
|
234
|
+
id: 'api',
|
|
235
|
+
path: 'api',
|
|
236
|
+
routeBasePath: 'api',
|
|
237
|
+
sidebarPath: './sidebarsApi.ts',
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
|
|
241
|
+
// Sitemap
|
|
242
|
+
[
|
|
243
|
+
'@docusaurus/plugin-sitemap',
|
|
244
|
+
{
|
|
245
|
+
changefreq: 'weekly',
|
|
246
|
+
priority: 0.5,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
|
|
250
|
+
// Google Analytics
|
|
251
|
+
[
|
|
252
|
+
'@docusaurus/plugin-google-gtag',
|
|
253
|
+
{
|
|
254
|
+
trackingID: 'G-XXXXXXXXXX',
|
|
255
|
+
anonymizeIP: true,
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
],
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Mermaid Diagrams
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
npm install @docusaurus/theme-mermaid
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
// docusaurus.config.ts
|
|
269
|
+
themes: ['@docusaurus/theme-mermaid'],
|
|
270
|
+
markdown: {
|
|
271
|
+
mermaid: true,
|
|
272
|
+
},
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
```markdown
|
|
276
|
+
\```mermaid
|
|
277
|
+
graph TD
|
|
278
|
+
A[Start] -->|Process| B[End]
|
|
279
|
+
\```
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Search
|
|
283
|
+
|
|
284
|
+
#### Algolia DocSearch
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
themeConfig: {
|
|
288
|
+
algolia: {
|
|
289
|
+
appId: 'YOUR_APP_ID',
|
|
290
|
+
apiKey: 'YOUR_SEARCH_API_KEY',
|
|
291
|
+
indexName: 'YOUR_INDEX_NAME',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### Local Search
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
npm install @easyops-cn/docusaurus-search-local
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
themes: [
|
|
304
|
+
[
|
|
305
|
+
require.resolve('@easyops-cn/docusaurus-search-local'),
|
|
306
|
+
{
|
|
307
|
+
hashed: true,
|
|
308
|
+
language: ['en', 'zh'],
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
],
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Versioning
|
|
315
|
+
|
|
316
|
+
### Enable Versioning
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
npm run docusaurus docs:version 1.0.0
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Version Structure
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
website/
|
|
326
|
+
├── docs/ # Current version (Next)
|
|
327
|
+
├── versioned_docs/
|
|
328
|
+
│ ├── version-1.0.0/ # Version 1.0.0
|
|
329
|
+
│ └── version-2.0.0/ # Version 2.0.0
|
|
330
|
+
├── versioned_sidebars/
|
|
331
|
+
│ ├── version-1.0.0-sidebars.json
|
|
332
|
+
│ └── version-2.0.0-sidebars.json
|
|
333
|
+
└── versions.json # List of versions
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Version Configuration
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
themeConfig: {
|
|
340
|
+
navbar: {
|
|
341
|
+
items: [
|
|
342
|
+
{
|
|
343
|
+
type: 'docsVersionDropdown',
|
|
344
|
+
position: 'right',
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## Internationalization (i18n)
|
|
352
|
+
|
|
353
|
+
### Configuration
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
// docusaurus.config.ts
|
|
357
|
+
i18n: {
|
|
358
|
+
defaultLocale: 'en',
|
|
359
|
+
locales: ['en', 'fr', 'es'],
|
|
360
|
+
localeConfigs: {
|
|
361
|
+
en: {
|
|
362
|
+
label: 'English',
|
|
363
|
+
},
|
|
364
|
+
fr: {
|
|
365
|
+
label: 'Français',
|
|
366
|
+
},
|
|
367
|
+
es: {
|
|
368
|
+
label: 'Español',
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Directory Structure
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
website/
|
|
378
|
+
├── i18n/
|
|
379
|
+
│ ├── en/
|
|
380
|
+
│ │ ├── docusaurus-plugin-content-docs/
|
|
381
|
+
│ │ └── docusaurus-theme-classic/
|
|
382
|
+
│ ├── fr/
|
|
383
|
+
│ └── es/
|
|
384
|
+
└── docs/ # Default locale content
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Build for Specific Locale
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
npm run build -- --locale fr
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Custom Components
|
|
394
|
+
|
|
395
|
+
### Create Component
|
|
396
|
+
|
|
397
|
+
```tsx
|
|
398
|
+
// src/components/FeatureCard.tsx
|
|
399
|
+
import React from 'react';
|
|
400
|
+
import styles from './styles.module.css';
|
|
401
|
+
|
|
402
|
+
export function FeatureCard({title, description, icon}) {
|
|
403
|
+
return (
|
|
404
|
+
<div className={styles.featureCard}>
|
|
405
|
+
<div className={styles.icon}>{icon}</div>
|
|
406
|
+
<h3>{title}</h3>
|
|
407
|
+
<p>{description}</p>
|
|
408
|
+
</div>
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Use in MDX
|
|
414
|
+
|
|
415
|
+
```markdown
|
|
416
|
+
---
|
|
417
|
+
title: Features
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
import {FeatureCard} from '@site/src/components/FeatureCard';
|
|
421
|
+
|
|
422
|
+
# Our Features
|
|
423
|
+
|
|
424
|
+
<FeatureCard
|
|
425
|
+
title="Fast"
|
|
426
|
+
description="Lightning-fast performance"
|
|
427
|
+
icon="⚡"
|
|
428
|
+
/>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## Deployment
|
|
432
|
+
|
|
433
|
+
### GitHub Pages
|
|
434
|
+
|
|
435
|
+
```yaml
|
|
436
|
+
# .github/workflows/deploy.yml
|
|
437
|
+
name: Deploy to GitHub Pages
|
|
438
|
+
|
|
439
|
+
on:
|
|
440
|
+
push:
|
|
441
|
+
branches: [main]
|
|
442
|
+
|
|
443
|
+
jobs:
|
|
444
|
+
deploy:
|
|
445
|
+
runs-on: ubuntu-latest
|
|
446
|
+
steps:
|
|
447
|
+
- uses: actions/checkout@v3
|
|
448
|
+
- uses: actions/setup-node@v3
|
|
449
|
+
with:
|
|
450
|
+
node-version: 18
|
|
451
|
+
- name: Install dependencies
|
|
452
|
+
run: npm ci
|
|
453
|
+
- name: Build website
|
|
454
|
+
run: npm run build
|
|
455
|
+
- name: Deploy to GitHub Pages
|
|
456
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
457
|
+
with:
|
|
458
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
459
|
+
publish_dir: ./build
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Netlify
|
|
463
|
+
|
|
464
|
+
```toml
|
|
465
|
+
# netlify.toml
|
|
466
|
+
[build]
|
|
467
|
+
command = "npm run build"
|
|
468
|
+
publish = "build"
|
|
469
|
+
|
|
470
|
+
[[redirects]]
|
|
471
|
+
from = "/*"
|
|
472
|
+
to = "/index.html"
|
|
473
|
+
status = 200
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Vercel
|
|
477
|
+
|
|
478
|
+
```json
|
|
479
|
+
{
|
|
480
|
+
"buildCommand": "npm run build",
|
|
481
|
+
"outputDirectory": "build"
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
## Best Practices
|
|
486
|
+
|
|
487
|
+
### 1. Organize Content Logically
|
|
488
|
+
|
|
489
|
+
```
|
|
490
|
+
docs/
|
|
491
|
+
├── getting-started/
|
|
492
|
+
│ ├── installation.md
|
|
493
|
+
│ └── quick-start.md
|
|
494
|
+
├── guides/
|
|
495
|
+
│ ├── beginner/
|
|
496
|
+
│ ├── intermediate/
|
|
497
|
+
│ └── advanced/
|
|
498
|
+
└── reference/
|
|
499
|
+
├── api/
|
|
500
|
+
└── cli/
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### 2. Use Frontmatter
|
|
504
|
+
|
|
505
|
+
```markdown
|
|
506
|
+
---
|
|
507
|
+
id: my-doc
|
|
508
|
+
title: My Document
|
|
509
|
+
sidebar_label: Short Label
|
|
510
|
+
sidebar_position: 1
|
|
511
|
+
description: Document description for SEO
|
|
512
|
+
keywords: [docusaurus, documentation, seo]
|
|
513
|
+
---
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### 3. Leverage MDX
|
|
517
|
+
|
|
518
|
+
```markdown
|
|
519
|
+
import MyComponent from '@site/src/components/MyComponent';
|
|
520
|
+
|
|
521
|
+
<MyComponent prop="value" />
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### 4. Optimize Images
|
|
525
|
+
|
|
526
|
+
```markdown
|
|
527
|
+

|
|
528
|
+
|
|
529
|
+
<!-- Or with sizing -->
|
|
530
|
+
<img src={require('./img/photo.jpg').default} width="600" />
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### 5. Add Edit Links
|
|
534
|
+
|
|
535
|
+
```typescript
|
|
536
|
+
docs: {
|
|
537
|
+
editUrl: 'https://github.com/org/repo/edit/main/',
|
|
538
|
+
},
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
## Troubleshooting
|
|
542
|
+
|
|
543
|
+
### Build Errors
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
# Clear cache
|
|
547
|
+
npm run clear
|
|
548
|
+
npm run build
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### Broken Links
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
# Check for broken links during build
|
|
555
|
+
npm run build -- --debug
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
### Port Already in Use
|
|
559
|
+
|
|
560
|
+
```bash
|
|
561
|
+
PORT=3001 npm start
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
## Resources
|
|
565
|
+
|
|
566
|
+
- [Official Docs](https://docusaurus.io/)
|
|
567
|
+
- [Showcase](https://docusaurus.io/showcase)
|
|
568
|
+
- [Discord Community](https://discord.gg/docusaurus)
|
|
569
|
+
- [GitHub](https://github.com/facebook/docusaurus)
|
|
570
|
+
|
|
571
|
+
## Activation Keywords
|
|
572
|
+
|
|
573
|
+
Ask me about:
|
|
574
|
+
- "How do I set up Docusaurus?"
|
|
575
|
+
- "Docusaurus configuration best practices"
|
|
576
|
+
- "Adding search to Docusaurus"
|
|
577
|
+
- "Docusaurus versioning"
|
|
578
|
+
- "MDX components in Docusaurus"
|
|
579
|
+
- "Deploy Docusaurus to GitHub Pages"
|
|
580
|
+
- "Internationalization in Docusaurus"
|
|
581
|
+
- "Custom Docusaurus themes"
|