Contributing to Interactive Documentation
This guide covers how to contribute to Ring Platform's interactive documentation system using Jupyter notebooks alongside our existing Docusaurus documentation.
π― Overviewβ
Ring Platform uses a dual documentation approach:
- π Static Documentation (Docusaurus) - Comprehensive guides, references, and architecture
- π Interactive Documentation (Jupyter) - Live code, API testing, visualizations, tutorials
π
Interactive Notebook: Interactive Documentation Hub
Central index of all Jupyter notebooks with live directory scanning, visualization tools, and integration examples.
π Notebook Organizationβ
Directory Structureβ
my-docs/notebooks/
βββ index.ipynb # π Main index and overview
βββ api-testing/ # π§ API Testing & Integration
β βββ ring-notification-system.ipynb
βββ analytics/ # π Analytics & Monitoring
βββ tutorials/ # π Tutorials & Guides
βββ architecture/ # ποΈ System Architecture
βββ templates/ # π Notebook templates
β βββ notebook-template.ipynb
βββ completed/ # β
Completed notebooks
βββ archive/ # π¦ Archived versions
Naming Conventionsβ
- Lowercase with hyphens:
my-notebook.ipynb
- Descriptive names:
user-authentication-testing.ipynb
- Category prefixes: For cross-category notebooks, use prefixes like
arch-microservices-design.ipynb
π§ Creating New Notebooksβ
1. Choose Categoryβ
Category | Purpose | Examples |
---|---|---|
api-testing | API integration, testing, validation | user-management-api.ipynb |
analytics | Data analysis, monitoring, insights | platform-analytics.ipynb |
tutorials | Learning materials, step-by-step guides | getting-started-guide.ipynb |
architecture | System design, patterns, deep dives | event-driven-architecture.ipynb |
2. Use the Templateβ
Start with the standard template:
# Copy the template
cp notebooks/templates/notebook-template.ipynb notebooks/[category]/[your-notebook].ipynb
# Customize the template placeholders:
# - [Notebook Title]
# - [CATEGORY]
# - [STATUS]
# - Configuration section
3. Follow the Structureβ
# Standard notebook structure:
# 1. Title and overview (markdown)
# 2. Setup and imports (code)
# 3. Configuration (code)
# 4. Interactive examples (code + markdown)
# 5. Visualizations (code)
# 6. Integration examples (code + markdown)
# 7. Best practices (markdown)
# 8. Next steps and links (markdown)
4. Development Guidelinesβ
Content Standardsβ
- Clear objectives - State what the notebook accomplishes
- Working examples - All code should run successfully
- Error handling - Handle API failures gracefully
- Documentation - Explain complex concepts and code
- Visualizations - Include charts and graphs where helpful
Code Standardsβ
# Use the standard API helper function
def make_api_call(endpoint: str, method: str = "GET", data: Dict = None):
# Standard implementation from template
# Document all functions
def analyze_data(data: pd.DataFrame) -> Dict:
"""
Analyze notification data and return insights
Args:
data: DataFrame with notification records
Returns:
dict: Analysis results with metrics and trends
"""
pass
# Handle errors gracefully
try:
result = make_api_call("/notifications")
if result.get('success'):
# Process successful response
pass
else:
print(f"β API Error: {result.get('error')}")
except Exception as e:
print(f"β Unexpected error: {e}")
π Integration with Static Docsβ
Linking from Docusaurus to Notebooksβ
Use the NotebookLink
component in your .md
files:
import NotebookLink from '@site/src/components/NotebookLink';
<NotebookLink
notebook="your-notebook.ipynb"
title="Your Notebook Title"
description="Brief description of what the notebook covers"
category="api-testing"
/>
Cross-Referencesβ
- From notebooks to docs: Link to relevant static documentation
- From docs to notebooks: Include interactive examples
- Shared examples: Keep code examples consistent between both systems
Example Integrationβ
In a service documentation page:
# User Management Service
Static documentation content here...
<NotebookLink
notebook="user-management-api.ipynb"
title="User Management API Testing"
description="Interactive testing of authentication, profile management, and role-based access control."
category="api-testing"
/>
More static documentation...
π§ͺ Testing and Validationβ
Pre-Submission Checklistβ
- Notebook runs completely - All cells execute without errors
- API calls work - Test with both development and production environments
- Documentation is clear - Explanations are comprehensive
- Visualizations render - Charts and graphs display correctly
- Template compliance - Follows the standard structure and naming
- Index updated - Added to the main
index.ipynb
if needed
Environment Testingβ
Test your notebook in multiple environments:
# Test configuration
ENVIRONMENTS = {
"development": "http://localhost:3000/api",
"staging": "https://staging.ring.ck.ua/api",
"production": "https://ring.ck.ua/api"
}
# Test API connectivity
for env, url in ENVIRONMENTS.items():
try:
response = requests.get(f"{url}/health")
print(f"β
{env}: {response.status_code}")
except:
print(f"β {env}: Connection failed")
π Notebook Lifecycleβ
Development Stagesβ
- π Draft - Initial development, may have incomplete sections
- π In Progress - Active development, core functionality working
- β Complete - Fully functional, documented, and tested
- π¦ Archived - Older versions or deprecated content
Version Managementβ
- Use semantic versioning in notebook metadata
- Archive old versions in the
archive/
directory - Document changes in a changelog section
- Tag stable releases for reference
Maintenanceβ
- Regular updates - Keep notebooks current with API changes
- Dependency updates - Update Python packages and imports
- Link validation - Ensure external links remain valid
- Performance optimization - Optimize slow-running cells
π€ Contributing Workflowβ
1. Planningβ
- Review existing notebooks to avoid duplication
- Discuss complex notebooks in GitHub issues
- Check the roadmap in
index.ipynb
2. Developmentβ
# Create feature branch
git checkout -b feature/notebook-name
# Create notebook from template
cp notebooks/templates/notebook-template.ipynb notebooks/category/your-notebook.ipynb
# Develop and test
jupyter lab notebooks/category/your-notebook.ipynb
# Update index if needed
jupyter lab notebooks/index.ipynb
3. Integrationβ
- Add
NotebookLink
components to relevant documentation pages - Test integration with static documentation
- Ensure cross-references work correctly
4. Submissionβ
# Commit changes
git add notebooks/
git commit -m "Add: Interactive notebook for [feature]"
# Push and create PR
git push origin feature/notebook-name
# Create pull request with description
π Analytics and Feedbackβ
Usage Trackingβ
- Monitor notebook usage through GitHub analytics
- Track which notebooks are most accessed
- Gather feedback through GitHub issues and discussions
Continuous Improvementβ
- Regular review of notebook effectiveness
- Update based on user feedback
- Expand popular topics with additional notebooks
π Resourcesβ
- π Notebook Index: notebooks/index.ipynb
- π Template: notebooks/templates/notebook-template.ipynb
- π Ring Platform: ring.ck.ua
- π Static Documentation: docs.ring.ck.ua
- π Jupyter Documentation: jupyter.org
Ready to contribute to Ring Platform's interactive documentation? Start with the notebook template and follow this guide!