Conversation
- Add _apply_ansi helper to check get(io, :color, false) before applying ANSI codes - Update all ANSI helpers (_dim, _bold, _red, _yellow, _green) to accept io parameter - Propagate io to all call sites in display functions - Add IOContext(stdout, :color => false) in @repl block to avoid raw ANSI codes in VitePress - Add color-aware tests to verify both branches (color=true/false) - Document ANSI color handling in MIGRATION.md with workaround for issue #321 - Fix URI malformed error in coverage.md (heading with % literal) - Add DocumenterVitepress migration guide with remote assets configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes exception display color-aware to work correctly with DocumenterVitepress, and adds the full DocumenterVitepress migration setup.
Changes
Exception display color-aware
_apply_ansi(s, code, io)helper that checksget(io, :color, false)before applying ANSI codes_dim,_bold,_red,_yellow,_green) to acceptioparameterioto all call sites in display functions (_print_colored,_print_pipe_field,_format_user_friendly_error)IOContext(stdout, :color => false)in@replblock to avoid raw ANSI codes in VitePress outputDocumentation
URI malformederror incoverage.md(heading with%literal)MIGRATION.mdwith complete DocumenterVitepress migration guide@replblocks (issue [General] New release #321)Rationale
DocumenterVitepress does not automatically convert ANSI escape codes to HTML in
@replblocks (unlike@exampleblocks). This causes raw ANSI codes to appear in the generated markdown. The workaround is to useIOContext(stdout, :color => false)in@replblocks, and make custom display functions color-aware by checkingget(io, :color, false).This ensures:
:color => trueby default)IOContext(stdout, :color => false)Tests