Migration Guide
Switch to CodeContext from other documentation tools
Moving to CodeContext is straightforward. This guide helps you migrate from popular documentation tools while preserving your existing content and improving your documentation workflow.
Why Teams Switch to CodeContext
Automation
Stop writing docs manually
Always Current
Docs stay in sync with code
Zero Lock-in
Keep your existing files
Migration Process Overview
Analyze Current Documentation
CodeContext scans your existing documentation to understand structure and content
Preserve Custom Content
Your manually written content is preserved and enhanced, not replaced
Generate Missing Documentation
CodeContext fills gaps by analyzing your code and generating what's missing
Set Up Automation
Configure automatic updates to keep documentation current going forward
Migrating from JSDoc/TSDoc
CodeContext understands and enhances your existing JSDoc/TSDoc comments:
Before (JSDoc only)
/** * Calculate the total price * @param {number} price - Item price * @param {number} quantity - Number of items * @returns {number} Total price */ function calculateTotal(price, quantity) { return price * quantity; }
After (CodeContext enhanced)
## calculateTotal Calculate the total price including tax and discounts. ### Parameters - `price` (number): Item price in USD - `quantity` (number): Number of items (min: 1) ### Returns - `number`: Total price with 2 decimal precision ### Example ```javascript const total = calculateTotal(29.99, 3); console.log(total); // 89.97 ``` ### Notes - Prices are in USD - No validation for negative values
Migration command:
codecontext migrate --from jsdoc
Migrating from Docusaurus
Keep your Docusaurus site while automating content generation:
1. Install CodeContext
npm install -g codecontext
2. Configure for Docusaurus
{ "output": { "readme": "./docs/api-reference.md", "changelog": "./docs/changelog.md", "api": "./docs/api/", "format": "docusaurus" } }
3. Generate Documentation
codecontext update --format docusaurus
CodeContext generates Docusaurus-compatible markdown with proper frontmatter
Migrating from Sphinx (Python)
CodeContext works great with Python projects using Sphinx:
Sphinx Structure
docs/ ├── conf.py ├── index.rst ├── api/ │ └── modules.rst └── _build/
With CodeContext
docs/ ├── conf.py # Keep existing ├── index.rst # Keep existing ├── api/ # Auto-generated │ └── *.md # By CodeContext ├── README.md # Auto-generated └── CHANGELOG.md # Auto-generated
Migration Steps:
- 1. Keep your existing Sphinx configuration
- 2. Configure CodeContext to output to your docs directory
- 3. Use MyST parser to include Markdown in Sphinx
- 4. Set up CI/CD to run both tools
Migrating from Manual README
If you only have a basic README, CodeContext can expand it dramatically:
What CodeContext Adds
Enhanced README
- • Detailed installation steps
- • Usage examples from code
- • API documentation
- • Configuration options
New Documentation
- • CHANGELOG.md
- • CONTRIBUTING.md
- • API.md
- • Custom docs (Pro)
Quick Start:
# 1. Initialize CodeContext codecontext init # 2. Generate comprehensive docs codecontext generate all # 3. Review and customize # Your original README content is preserved!
Preserving Your Content
CodeContext Never Deletes Your Content
Your existing documentation is sacred. CodeContext preserves and enhances:
Preserved Sections
- Custom examples
- Manual explanations
- Special sections
- Custom formatting
Protection Markers
<!-- CUSTOM-SECTION-START --> Your custom content here is always preserved <!-- CUSTOM-SECTION-END -->
Migration Checklist
Follow this checklist for a smooth migration:
Common Migration Concerns
Will I lose my custom documentation?
No! CodeContext preserves all your existing content and only adds to it. Use protection markers for absolute safety.
Can I use my existing documentation site?
Yes! CodeContext outputs standard Markdown that works with any static site generator (Docusaurus, MkDocs, Jekyll, etc.).
What if I don't like the generated content?
You have full control! Edit templates, customize output, or exclude sections. CodeContext is a tool, not a replacement for human judgment.
Migration Success Story
“We migrated from manual README files to CodeContext in one afternoon. Our documentation went from 50 lines to 500+ lines of useful, accurate content. The best part? It updates automatically now!”
Ready to Migrate?
Start Your Migration
npm install -g codecontext && codecontext init