|
| 1 | +--- |
| 2 | +title: Documentation Versioning |
| 3 | +description: |
| 4 | + Guide to managing and using versioned documentation in the Mina Rust project |
| 5 | +sidebar_position: 3 |
| 6 | +--- |
| 7 | + |
| 8 | +# Documentation Versioning |
| 9 | + |
| 10 | +The Mina Rust documentation uses |
| 11 | +[Docusaurus versioning](https://docusaurus.io/docs/versioning) to maintain |
| 12 | +documentation for multiple releases. This allows users to access documentation |
| 13 | +for specific versions of the software. |
| 14 | + |
| 15 | +## How Versioning Works |
| 16 | + |
| 17 | +### Version Structure |
| 18 | + |
| 19 | +- **Current Version (`develop`)**: The latest development documentation, |
| 20 | + available at the root path (`/docs/`) |
| 21 | +- **Released Versions**: Specific release versions (e.g., `1.0.0`), available at |
| 22 | + versioned paths (`/docs/1.0.0/`) |
| 23 | + |
| 24 | +### Accessing Different Versions |
| 25 | + |
| 26 | +Users can switch between documentation versions using the version dropdown in |
| 27 | +the navigation bar. Each version maintains its own complete documentation tree. |
| 28 | + |
| 29 | +## Managing Documentation Versions |
| 30 | + |
| 31 | +### Creating a New Version |
| 32 | + |
| 33 | +Create a new documentation version during the release process: |
| 34 | + |
| 35 | +```bash |
| 36 | +# Create version for release 1.2.3 |
| 37 | +make docs-version-create VERSION=1.2.3 |
| 38 | + |
| 39 | +# Or as part of the release workflow |
| 40 | +make release-docs-version VERSION=1.2.3 |
| 41 | +``` |
| 42 | + |
| 43 | +This command: |
| 44 | + |
| 45 | +- Takes a snapshot of the current `docs/` directory |
| 46 | +- Creates versioned copies in `website/versioned_docs/version-1.2.3/` |
| 47 | +- Updates `website/versions.json` to include the new version |
| 48 | +- Makes the version available in the dropdown menu |
| 49 | + |
| 50 | +### Listing Available Versions |
| 51 | + |
| 52 | +```bash |
| 53 | +# List all available documentation versions |
| 54 | +make docs-version-list |
| 55 | +``` |
| 56 | + |
| 57 | +### Cleaning Up Versions |
| 58 | + |
| 59 | +:::warning Destructive Operation This command permanently removes all versioned |
| 60 | +documentation. Use with caution. ::: |
| 61 | + |
| 62 | +```bash |
| 63 | +# Remove all versioned documentation (interactive confirmation) |
| 64 | +make docs-version-clean |
| 65 | +``` |
| 66 | + |
| 67 | +## Version Behavior |
| 68 | + |
| 69 | +### Current Version (develop) |
| 70 | + |
| 71 | +- Always shows the latest documentation from the `docs/` directory |
| 72 | +- Available at the root documentation path |
| 73 | +- Labeled as "develop" in the version dropdown |
| 74 | +- No version banners or warnings |
| 75 | + |
| 76 | +### Released Versions |
| 77 | + |
| 78 | +- Snapshot of documentation at the time of release |
| 79 | +- Available at `/docs/{version}/` paths |
| 80 | +- Shows a banner indicating the version is no longer actively maintained |
| 81 | +- Provides a link back to the current (develop) version |
| 82 | + |
| 83 | +### Version Dropdown |
| 84 | + |
| 85 | +The version dropdown in the navigation bar: |
| 86 | + |
| 87 | +- Lists all available versions |
| 88 | +- Shows the current selection |
| 89 | +- Allows quick switching between versions |
| 90 | +- Maintains the current page context when switching (if the page exists in the |
| 91 | + target version) |
| 92 | + |
| 93 | +## Best Practices |
| 94 | + |
| 95 | +### When to Create Versions |
| 96 | + |
| 97 | +- **Always** create a documentation version as part of the release process |
| 98 | +- Create versions for major and minor releases |
| 99 | +- Consider creating versions for significant patch releases with documentation |
| 100 | + changes |
| 101 | +- Do not create versions for minor documentation updates between releases |
| 102 | + |
| 103 | +### Maintaining Version Quality |
| 104 | + |
| 105 | +- Ensure documentation is complete and accurate before creating a version |
| 106 | +- Test all links and examples in the documentation before versioning |
| 107 | +- Update any version-specific information (installation instructions, |
| 108 | + compatibility notes) |
| 109 | + |
| 110 | +### Documentation Updates |
| 111 | + |
| 112 | +- **Current documentation**: Edit files in `website/docs/` |
| 113 | +- **Versioned documentation**: Edit files in |
| 114 | + `website/versioned_docs/version-{version}/` |
| 115 | +- **Sidebar configuration**: Versioned sidebars are stored in |
| 116 | + `website/versioned_sidebars/` |
| 117 | + |
| 118 | +## File Structure |
| 119 | + |
| 120 | +``` |
| 121 | +website/ |
| 122 | +├── docs/ # Current (develop) documentation |
| 123 | +├── versioned_docs/ |
| 124 | +│ └── version-1.0.0/ # Versioned documentation |
| 125 | +├── versioned_sidebars/ |
| 126 | +│ └── version-1.0.0-sidebars.json # Versioned sidebars |
| 127 | +└── versions.json # List of available versions |
| 128 | +``` |
| 129 | + |
| 130 | +## Integration with Release Process |
| 131 | + |
| 132 | +Documentation versioning is integrated into the release workflow: |
| 133 | + |
| 134 | +1. **Version Creation**: Part of the release process after tag creation |
| 135 | +2. **Automated**: Uses the same version number as the software release |
| 136 | +3. **Consistent**: Ensures documentation versions match software versions |
| 137 | +4. **Preserved**: Maintains historical documentation for all releases |
| 138 | + |
| 139 | +For complete release process details, see the |
| 140 | +[Release Process](./release-process.mdx) guide. |
| 141 | + |
| 142 | +## Troubleshooting |
| 143 | + |
| 144 | +### Version Not Appearing in Dropdown |
| 145 | + |
| 146 | +1. Check that `website/versions.json` includes the version |
| 147 | +2. Verify files exist in `website/versioned_docs/version-{version}/` |
| 148 | +3. Rebuild the documentation site |
| 149 | + |
| 150 | +### Broken Links in Versioned Docs |
| 151 | + |
| 152 | +- Versioned documentation uses absolute paths within the version |
| 153 | +- Links between versions are not automatically updated |
| 154 | +- Test documentation thoroughly before creating versions |
| 155 | + |
| 156 | +### Large Repository Size |
| 157 | + |
| 158 | +- Versioned documentation duplicates content |
| 159 | +- Consider the trade-off between version history and repository size |
| 160 | +- Remove very old versions if repository size becomes problematic |
| 161 | + |
| 162 | +## Related Commands |
| 163 | + |
| 164 | +```bash |
| 165 | +# Documentation building and serving |
| 166 | +make docs-build # Build with API docs |
| 167 | +make docs-serve # Serve locally with hot reload |
| 168 | +make docs-clean # Clean build artifacts |
| 169 | + |
| 170 | +# Release integration |
| 171 | +make release-help # Show all release commands |
| 172 | +make release-docs-version VERSION=x.y.z # Create docs version for release |
| 173 | +``` |
0 commit comments