Skip to content

feat: add format_text helper for unified styling#8

Merged
razbuild merged 1 commit into
razbuild:masterfrom
githubuser16384:feat/format-text
May 13, 2026
Merged

feat: add format_text helper for unified styling#8
razbuild merged 1 commit into
razbuild:masterfrom
githubuser16384:feat/format-text

Conversation

@githubuser16384
Copy link
Copy Markdown
Contributor

Description

Added a new format_text() helper for unified application of foreground colors, background colors, and text styles in a single API call.

This improves usability by eliminating deeply nested styling calls such as bold(underline(red("text"))) and provides a cleaner, more intuitive interface while preserving compatibility with the existing API.

Implemented support for:

  • Named foreground and background colors
  • ANSI integer color codes
  • Single or multiple text styles
  • Configurable reset behavior
  • Validation for invalid colors/styles
  • Respect for existing color environment detection (NO_COLOR / forced color behavior)

Also added tests for the new functionality and updated documentation with usage examples.

Fixes #7

Checklist

Before submitting your pull request, please ensure the following:

  • I have read the CONTRIBUTING.md guidelines.
  • My code follows the project's style guidelines (passed linting).
  • I have added tests to cover my changes.
  • All existing tests pass.
  • Documentation has been updated (for API changes).
  • This PR does not introduce any breaking changes to the public API.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Code quality/refactoring (no change in functionality)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@razbuild razbuild merged commit dc1feaa into razbuild:master May 13, 2026
17 checks passed
@razbuild
Copy link
Copy Markdown
Owner

@githubuser16384, nice work. Tested locally, tests pass. Merging. Thanks!

@githubuser16384 githubuser16384 deleted the feat/format-text branch May 13, 2026 18:09
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.

Add format_text() method for unified color, background, and style application

2 participants