Documentation System
Documentation System
Standards and workflows for maintaining Fusion Framework markdown documentation.
Quick Reference
| Task | When | Command/Location |
|---|---|---|
| Update READMEs | API/functionality changes | packages/*/README.md |
| Add feature docs | New capabilities | packages/*/docs/ |
| Test locally | Before PR | cd vue-press && pnpm dev |
| Validate build | Before merge | pnpm build:docs |
| Create changeset | Consumer-affecting changes | .changeset/[name].md |
| Check links | PR review | CI + manual verification |
Key Rules:
- Documentation lives with code in
packages/*/docs/andREADME.md - VuePress structure must mirror package structure exactly
- Use
<!-- @include: -->directives to import package docs - All docs use pure GitHub-flavored Markdown
- Follow conventional commits for documentation updates
Architecture
The documentation system uses a colocated architecture where docs live alongside code and are imported into VuePress for publishing.
File Structure
packages/
βββ cli/
β βββ docs/ # Feature-specific documentation
β β βββ application.md
β β βββ auth.md
β βββ README.md # Main package documentation
βββ modules/http/
βββ docs/ # Optional module docs
βββ README.md # Main module documentation
vue-press/src/ # Mirrors packages/ structure exactly
βββ cli/
β βββ docs/
β β βββ application.md # <-- @include: ../../../../packages/cli/docs/application.md
β βββ README.md # <-- @include: ../../../packages/cli/README.md
βββ modules/http/
βββ README.md # <-- @include: ../../../../packages/modules/http/README.mdVuePress Integration
VuePress imports package documentation using <!-- @include: --> directives:
<!-- @include: ../../../packages/cli/README.md -->Critical: VuePress structure in vue-press/src/ must exactly mirror packages/ structure for imports to work.
Markdown Standards
- Pure GitHub-flavored Markdown for maximum compatibility
- No VuePress-specific syntax in source files
- Standard formatting for code blocks, tables, and links
- Frontmatter added by VuePress wrapper files only
See GitHub's basic writing and formatting syntax for reference.
Changesets for Documentation
All documentation changes require a changeset for @equinor/fusion-framework-docs to publish updated docs.
Changeset Format
---
"@equinor/fusion-framework-docs": patch
---
Improve documentation for framework configuration options with additional code examples and troubleshooting guide.See changeset.md for complete guidelines and examples.
Package Documentation Structure
Keep documentation with code using this standardized structure:
Directory Layout
packages/
βββ cli/
β βββ docs/ # Feature-specific documentation
β β βββ application.md # App development guide
β β βββ auth.md # Authentication setup
β β βββ migration-v10-to-v11.md # Migration guides
β βββ README.md # CLI overview, installation, quick start
βββ modules/http/
β βββ docs/ # Advanced usage docs (optional)
β β βββ interceptors.md
β βββ README.md # Module overview, basic usage
βββ react/
βββ docs/ # Framework-specific docs
β βββ hooks.md
β βββ components.md
βββ README.md # React integration guideContent Guidelines
README.md (Required for all packages):
- Package overview and purpose
- Installation instructions
- Basic usage examples
- API reference or links to detailed docs
- Migration guides for breaking changes
docs/*.md (Optional, for complex packages):
- Feature-specific guides
- Advanced usage patterns
- API references
- Troubleshooting
- Migration documentation
Critical: VuePress structure in vue-press/src/ must exactly mirror packages/ structure for imports to work.
Development Workflow
Local Development
# Install all dependencies (from project root)
pnpm install
# Start documentation development server
cd vue-press && pnpm dev
# Build documentation for production
cd vue-press && pnpm buildValidation & Testing
# Build all packages and docs (from project root)
pnpm build:all
# Build docs only
pnpm build:docs
# Validate documentation build
pnpm build:docs && echo "β
Docs build successful"Making Documentation Changes
- Locate the source: Find docs in
packages/*/README.mdorpackages/*/docs/ - Make changes: Edit markdown files directly
- Test locally: Run
cd vue-press && pnpm devand verify changes - Validate build: Run
pnpm build:docsbefore committing - Create changeset: If consumer-affecting, add
.changeset/[name].md - Commit: Use conventional commit format (e.g.,
docs: update cli installation guide)
Adding New Documentation
- Create files: Add
README.mdand/ordocs/directory to package - Update VuePress: Add corresponding files in
vue-press/src/with include directives - Test imports: Verify
<!-- @include: -->paths are correct - Create changeset: Required for new consumer-facing documentation
Contributing Guidelines
Documentation Quality Standards
Content Requirements:
- Accuracy: Technical information must be correct and current
- Completeness: Cover all public APIs and important use cases
- Clarity: Use simple language, avoid jargon unless explained
- Examples: Include practical code examples for key features
- Structure: Use consistent headings, lists, and formatting
Technical Standards:
- GitHub-flavored Markdown: No VuePress-specific syntax
- Relative links: Use relative paths within packages
- Code blocks: Include language identifiers (```typescript)
- Cross-references: Link to related documentation sections
Writing Documentation
README.md Template
# Package Name
Brief description of what this package does.
## Installation
```bash
pnpm add @equinor/package-nameQuick Start
import { Something } from '@equinor/package-name';
// Basic usage exampleAPI Reference
Migration Guide
See migration guide for breaking changes.
#### Feature Documentation
- Start with problem/solution
- Include code examples
- Document edge cases
- Link to related features
### PR Review Checklist
#### Content Quality
- [ ] Documentation accurately reflects implementation
- [ ] Code examples are correct and runnable
- [ ] All public APIs are documented
- [ ] Breaking changes include migration guides
#### Technical Requirements
- [ ] README.md exists for new packages
- [ ] Files follow directory structure (`packages/*/docs/`)
- [ ] VuePress structure mirrors packages exactly
- [ ] `<!-- @include: -->` paths are correct
- [ ] `pnpm build:docs` passes without errors
- [ ] All internal links resolve correctly
- [ ] External links are valid and accessible
- [ ] Documentation builds successfully in CI
#### Changeset Requirements
- [ ] Changeset created for `@equinor/fusion-framework-docs`
- [ ] Changeset follows proper format (see [changeset.md](changeset.md))
- [ ] Changeset description is clear and descriptive
## Maintainer Workflows
### Maintenance Schedule
- **Daily**: Monitor CI for documentation build failures
- **Weekly**: Review open documentation PRs and issues
- **Monthly**: Run comprehensive validation and freshness checks
- **Quarterly**: Audit documentation coverage and update templates
### Issue Triage & Priority
- **π΄ Critical**: Build failures, broken imports, incorrect docs β Fix within 1 day
- **π‘ High**: Missing documentation, broken links, outdated examples β Fix within 1 week
- **π’ Medium**: Content improvements, style issues, additional examples β Next sprint
- **π΅ Low**: Typos, formatting inconsistencies, minor improvements β Backlog
### Standards Enforcement
**Automated:**
- Link validation in CI
- Import path verification
- Build success confirmation
**Manual:**
- Technical accuracy review
- Completeness assessment
- Clarity and consistency checks
## Common Issues & Solutions
### Build Failures
**"Cannot find module" or "File not found"**
- **Cause**: VuePress structure doesn't mirror `packages/` exactly
- **Solution**: Ensure `vue-press/src/` has identical directory structure to `packages/`
- **Example**: If you have `packages/cli/docs/app.md`, you need `vue-press/src/cli/docs/app.md`
**Import errors with `<!-- @include: -->`**
- **Cause**: Incorrect relative paths in include directives
- **Solution**: Count `../` carefully from VuePress file to package file
- **Example**: From `vue-press/src/cli/README.md` to `packages/cli/README.md`:
```md
<!-- @include: ../../../packages/cli/README.md -->Path separator issues
- Cause: Using backslashes instead of forward slashes
- Solution: Always use forward slashes
/in include paths - Command: Run
pnpm build:docsto validate all paths
Content Issues
Documentation doesn't appear in VuePress
- Cause: Missing or incorrect frontmatter in VuePress wrapper files
- Solution: Ensure VuePress files have proper YAML frontmatter with title, description, etc.
- Example:
--- title: CLI Application Development description: Guide for developing applications with the CLI ---
Broken internal links
- Cause: Links work in GitHub but not in VuePress context
- Solution: Test links in VuePress dev server, use relative paths within packages
- Tip: Use
vue-press/src/as root for internal navigation
External links failing
- Cause: URLs changed, redirects broken, or HTTPS requirements
- Solution: Manually verify URLs work, prefer HTTPS, update to new URLs
- Prevention: Check links before committing
Structure Issues
VuePress structure out of sync
- Cause: Package structure changed without updating VuePress
- Solution: Keep
vue-press/src/structure identical topackages/ - Command: Compare directory structures manually or with scripts
Missing package documentation
- Cause: New packages added without README.md
- Solution: All packages must have
README.mdin their root - Template: Use the README.md template in Contributing Guidelines
Slow documentation builds
- Cause: Large imports or inefficient VuePress configuration
- Solution: Check for unnecessarily large includes, optimize config
- Monitoring: Watch build times and optimize as needed
Content Quality Issues
Outdated documentation
- Cause: Code changes without documentation updates
- Solution: Update docs when APIs change, include migration guides
- Prevention: Review docs during code reviews
Inconsistent formatting
- Cause: Different authors using different styles
- Solution: Follow established patterns, use linters for consistency
- Standards: Pure GitHub-flavored Markdown, consistent heading levels
Getting Help
For Documentation Issues:
- Check existing issues: Search GitHub issues for similar problems
- Validate locally: Run
cd vue-press && pnpm devto test changes - Check build: Run
pnpm build:docsto catch import/build issues - Create detailed reports: Include error messages, file paths, and reproduction steps
Escalation:
- Build failures: Tag
@equinor/fusion-coreimmediately - Content issues: Create issues with "documentation" label
- General help: Use
#fusion-frameworkSlack channel
Success Criteria
Technical Quality:
- β Zero build failures in CI
- β
All
<!-- @include: -->directives resolve correctly - β
VuePress structure perfectly mirrors
packages/structure - β All internal and external links functional
Content Quality:
- β Complete documentation coverage for all public APIs
- β Accurate, current technical information
- β Clear, well-structured content with examples
- β Consistent formatting and style across packages
Process Quality:
- β All documentation PRs include proper changesets
- β Regular maintenance and freshness checks
- β Comprehensive PR reviews with checklists
- β Fast resolution of critical issues