lwgray / think

MIT License
0 stars 1 forks source link

Improve print formatting in explain mode Fix #9 #10

Closed lwgray closed 1 week ago

lwgray commented 1 week ago

Fixes #9

Description

This PR improves the formatting of print statements in explain mode by adding proper indentation and style-specific visual indicators. The changes ensure that program output maintains consistency with debug messages while being visually distinct.

Changes Made

  1. Modified print_wrapper method in ThinkPyInterpreter to:

    • Add context-based indentation
    • Include style-specific output markers
    • Support all formatting styles
    • Maintain visual hierarchy
  2. Added style-specific formatting for print output:

    Default:    [OUTPUT] Hello, World!
    Minimal:    OUTPUT: Hello, World!
    Detailed:   ──── OUTPUT: Hello, World! ────
    Color:      [OUTPUT] Hello, World! (in green)
    Markdown:   > Hello, World!
    Educational: 📤 Output: Hello, World!

Testing

Tested with:

Example Output

Before:

[TASK] Executing Greeting
  [STEP] Executing Set message
    [VARIABLE] Assigned Hello, World! to message
Hello, World!

After:

[TASK] Executing Greeting
  [STEP] Executing Set message
    [VARIABLE] Assigned Hello, World! to message
    [OUTPUT] Hello, World!

Documentation

Related Issues

Resolves #42

Checklist

Screenshots

image