glamour icon indicating copy to clipboard operation
glamour copied to clipboard

feat: Adds RenderBytesTo for rendering markdown to a externally provided writer

Open maciej-sz opened this issue 7 months ago • 0 comments

Added a new RenderBytesTo function that allows rendering markdown directly to an externally provided writer. This gives users more control over the output destination, enabling various use cases such as:

  • Writing directly to files without intermediate buffers
  • Streaming output to network connections
  • Using custom writers with additional processing logic
  • Integration with existing I/O pipelines

Key changes:

  • Added a new package-level RenderBytesTo function that accepts a writer
  • Added a RenderBytesTo method to the TermRenderer type
  • Refactored RenderBytes to use the new RenderBytesTo method
  • Added comprehensive tests for the new functionality

Related issue/discussion: N/A

Checklist before requesting a review

  • [x] I have read CONTRIBUTING.md
  • [x] I have performed a self-review of my code

If this is a feature

  • [ ] I have created a discussion
  • [ ] A project maintainer has approved this feature request. Link to comment:

maciej-sz avatar May 31 '25 12:05 maciej-sz