Skip to content

Conversation

@hardbyte
Copy link
Owner

@hardbyte hardbyte commented Aug 7, 2025

Updates to docs ahead of 0.5.0 release

📚 Documentation UX Improvements

Problem: Documentation was technically complete but difficult to scan and use effectively. Users struggled with:

  • Dense text blocks without clear value proposition
  • Missing output examples making it hard to verify results
  • Inconsistent formatting and navigation patterns
  • Separate developer vs. maintainer concerns mixed together

Solution: Applied systematic UX improvements across 16 documentation files:

🎯 Core Landing Page (docs/index.md)

  • Added positioning sentence before H1: "A safe, embeddable expression language for Python..."
  • Changed opening from technical description to problem-focused messaging
  • Added scannable feature bullets and separated large code blocks
  • Applied consistent # → output annotations

🧠 Philosophy Guide (docs/tutorials/thinking-in-cel.md)

  • Restructured for quick decision-making: Moved "When to Use CEL" to top as quick decision guide with ✅/❌ indicators
  • Enhanced scannability: Added bold takeaway lines after each principle
  • Improved code examples: Compacted repetitive code into table formats, added cross-links
  • Visual comparison: Created before/after table for "Design for Humans" principle

📖 Cookbook (docs/cookbook.md)

  • Enhanced practical value: Added output examples showing what expressions produce
  • Improved safety: Highlighted security warnings with proper formatting
  • Consistent structure: Made recipe intros uniform with problem → solution pattern
  • Better navigation: Added cross-links back to API reference

🔧 Advanced Tutorial (docs/tutorials/extending-cel.md)

  • Improved copy-paste experience: Broke up 40+ line code sections with step-by-step headers
  • Maintained functionality: Ensured all code examples remain working and testable
  • Better structure: Organized complex PolicyContext example with clear progression

📋 Compliance Reference (docs/reference/cel-compliance.md)

  • Reader segmentation: Created separate sections for developers vs. maintainers/contributors
  • Quick scanning: Added severity overview table with color-coded impact levels
  • Practical focus: Provided workarounds and safe patterns for missing features

🌐 Global Consistency

  • Applied # → output pattern across all 16 documentation files using parallel agents
  • Enhanced educational value: Maintained context and learning objectives while improving readability
  • Comprehensive testing: All documentation changes pass mktestdocs validation

🛠️ CLI Functionality Enhancement

Problem: CLI was missing --version and -h functionality that was already documented in getting-started guide.

Solution: Added complete version support to match documentation:

✨ Version Support

  • Added get_version() function using importlib.metadata
  • Handles development installs gracefully with fallback
  • Integrated with Typer's callback system for clean exit

🔄 Help Alias Support

  • Added -h as alias for --help via Typer's context_settings
  • Both -h and --help now work identically
cel --version  # → cel 0.4.2
cel -h         # → Full help output (identical to --help)

🧪 Quality Assurance

  • All documentation changes tested: Every file passes comprehensive mktestdocs validation
  • CLI functionality verified: Both version and help flags work correctly
  • No breaking changes: All improvements are additive and backward-compatible
  • Educational value preserved: Enhanced readability while maintaining technical accuracy

@hardbyte hardbyte requested a review from Copilot August 8, 2025 08:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR prepares the documentation and CLI functionality for the 0.5.0 release. The changes enhance documentation UX with systematic improvements across 16 files and add missing CLI functionality to match existing documentation.

  • Documentation UX improvements with consistent output examples, better scannability, and reader segmentation
  • CLI enhancement with --version and -h flags to match documented functionality
  • Global application of # → output pattern for enhanced educational value

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/cel/cli.py Added version support and help alias functionality to CLI
docs/tutorials/your-first-integration.md Enhanced with output examples and consistent # → pattern
docs/tutorials/thinking-in-cel.md Restructured with quick decision guide and improved scannability
docs/tutorials/extending-cel.md Improved copy-paste experience with step-by-step organization
docs/reference/python-api.md Added output examples for all API demonstrations
docs/reference/cel-compliance.md Reader segmentation and severity overview for missing features
docs/index.md Enhanced positioning and feature highlights with output examples
docs/how-to-guides/production-patterns-best-practices.md Added comprehensive output annotations for production examples
docs/how-to-guides/error-handling.md Enhanced error examples with expected output patterns
docs/how-to-guides/dynamic-query-filters.md Added query result examples and filter demonstrations
docs/how-to-guides/business-logic-data-transformation.md Comprehensive output examples for transformation scenarios
docs/how-to-guides/access-control-policies.md Enhanced policy examples with access decision outputs
docs/getting-started/quick-start.md Improved onboarding with clear output expectations
docs/getting-started/installation.md Added installation progress output examples
docs/cookbook.md Enhanced recipes with working code examples and outputs
docs/contributing.md Added development workflow output examples
Cargo.toml Version bump to 0.5.0
CHANGELOG.md Updated changelog format for release

"""Print version and exit."""
if value:
console.print(f"cel {get_version()}")
raise typer.Exit()
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version_callback function should handle the case where value is False to avoid unnecessary execution. Consider adding an early return if not value.

Suggested change
raise typer.Exit()
if not value:
return
console.print(f"cel {get_version()}")
raise typer.Exit()

Copilot uses AI. Check for mistakes.
def version_callback(value: bool):
"""Print version and exit."""
if value:
console.print(f"cel {get_version()}")
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using consistent formatting across the codebase. The version output format should match any existing version display patterns in the application.

Suggested change
console.print(f"cel {get_version()}")
console.print(
Panel(
f"[bold cyan]Common Expression Language (CEL)[/bold cyan]\n[white]Version:[/white] [bold]{get_version()}[/bold]",
title="[green]CEL CLI Version[/green]",
expand=False,
)
)

Copilot uses AI. Check for mistakes.
@hardbyte hardbyte merged commit 5f9b38d into main Aug 8, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants