Skip to main content

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

πŸ“ 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​

CategoryPurposeExamples
api-testingAPI integration, testing, validationuser-management-api.ipynb
analyticsData analysis, monitoring, insightsplatform-analytics.ipynb
tutorialsLearning materials, step-by-step guidesgetting-started-guide.ipynb
architectureSystem design, patterns, deep divesevent-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​

  1. πŸ“ Draft - Initial development, may have incomplete sections
  2. πŸ”„ In Progress - Active development, core functionality working
  3. βœ… Complete - Fully functional, documented, and tested
  4. πŸ“¦ 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​


Ready to contribute to Ring Platform's interactive documentation? Start with the notebook template and follow this guide!