Skip to content

Format final story outline for better readability using textwrap #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mshsheikh
Copy link
Contributor

Problem:
The final story outline was printed as a single unformatted block, making it hard to read for multi-line or lengthy content.

Changes:

  • Added textwrap import to enable line-based formatting.
  • Replaced print(f"Final story outline: {latest_outline}") with:
   print("Final story outline:")
   print(textwrap.indent(latest_outline, "  "))
  • Ensures each line of the outline is indented by 2 spaces for visual clarity.

Benefits:

  • Improves readability of multi-line outputs.
  • Keeps the outline distinct from surrounding console logs.
  • Safe to use since latest_outline is guaranteed to be a string before printing (set in the loop).

Problem:
The final story outline was printed as a single unformatted block, making it hard to read for multi-line or lengthy content.

Changes:
- Added `textwrap` import to enable line-based formatting.
- Replaced `print(f"Final story outline: {latest_outline}")` with:
```python
   print("Final story outline:")
   print(textwrap.indent(latest_outline, "  "))
```
- Ensures each line of the outline is indented by 2 spaces for visual clarity.

Benefits:
- Improves readability of multi-line outputs.
- Keeps the outline distinct from surrounding console logs.
- Safe to use since `latest_outline` is guaranteed to be a string before printing (set in the loop).
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.

1 participant