-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ANSI colors in output
- Adds `ansicolor::Bool=false` option to `Documenter.HTML` for enabling/disabling mapping of ANSI escape codes to HTML. - Adds option to locally disable/enable color using the `ansicolor` keyword argument in the `@example`/`@repl` block. - Add styles for ANSI colors to the default themes Co-authored-by: kimikage <kimikage.ceo@gmail.com> Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
- Loading branch information
1 parent
6c8679b
commit 7d79d3b
Showing
15 changed files
with
646 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
$ansi-black: $black-ter !default; | ||
$ansi-red: null !default; | ||
$ansi-green: null !default; | ||
$ansi-yellow: null !default; | ||
$ansi-blue: null !default; | ||
$ansi-magenta: null !default; | ||
$ansi-cyan: null !default; | ||
$ansi-white: $grey-lighter !default; | ||
|
||
$ansi-light-black: null !default; | ||
$ansi-light-red: null !default; | ||
$ansi-light-green: null !default; | ||
$ansi-light-yellow: null !default; | ||
$ansi-light-blue: null !default; | ||
$ansi-light-magenta: null !default; | ||
$ansi-light-cyan: null !default; | ||
$ansi-light-white: $white-ter !default; | ||
|
||
@if $documenter-is-dark-theme { | ||
$ansi-red: $red !default; | ||
$ansi-green: $green !default; | ||
$ansi-yellow: $yellow !default; | ||
$ansi-blue: $blue !default; | ||
$ansi-magenta: $purple !default; | ||
$ansi-cyan: $turquoise !default; | ||
|
||
$ansi-light-black: $grey-light !default; | ||
|
||
$ansi-light-red: lighten($ansi-red, 15) !default; | ||
$ansi-light-green: lighten($ansi-green, 15) !default; | ||
$ansi-light-yellow: lighten($ansi-yellow, 10) !default; | ||
$ansi-light-blue: lighten($ansi-blue, 15) !default; | ||
$ansi-light-magenta: lighten($ansi-magenta, 10) !default; | ||
$ansi-light-cyan: lighten($ansi-cyan, 15) !default; | ||
} | ||
|
||
@else { | ||
$ansi-light-red: $red !default; | ||
$ansi-light-green: $green !default; | ||
$ansi-light-yellow: $yellow !default; | ||
$ansi-light-blue: $blue !default; | ||
$ansi-light-magenta: $purple !default; | ||
$ansi-light-cyan: $turquoise !default; | ||
|
||
$ansi-light-black: $grey !default; | ||
|
||
$ansi-red: darken($ansi-light-red, 10) !default; | ||
$ansi-green: darken($ansi-light-green, 10) !default; | ||
$ansi-yellow: darken($ansi-light-yellow, 18) !default; | ||
$ansi-blue: darken($ansi-light-blue, 10) !default; | ||
$ansi-magenta: darken($ansi-light-magenta, 15) !default; | ||
$ansi-cyan: darken($ansi-light-cyan, 10) !default; | ||
} | ||
|
||
.ansi span { | ||
&.sgr1 { | ||
font-weight: bolder; | ||
} | ||
|
||
&.sgr2 { | ||
font-weight: lighter; | ||
} | ||
|
||
&.sgr3 { | ||
font-style: italic; | ||
} | ||
|
||
&.sgr4 { | ||
text-decoration: underline; | ||
} | ||
|
||
&.sgr7 { | ||
color: $body-background-color; | ||
background-color: $text; | ||
} | ||
|
||
&.sgr8 { | ||
color: transparent; | ||
|
||
span { | ||
color: transparent; | ||
} | ||
} | ||
|
||
&.sgr9 { | ||
text-decoration: line-through; | ||
} | ||
|
||
&.sgr30 { | ||
color: $ansi-black; | ||
} | ||
|
||
&.sgr31 { | ||
color: $ansi-red; | ||
} | ||
|
||
&.sgr32 { | ||
color: $ansi-green; | ||
} | ||
|
||
&.sgr33 { | ||
color: $ansi-yellow; | ||
} | ||
|
||
&.sgr34 { | ||
color: $ansi-blue; | ||
} | ||
|
||
&.sgr35 { | ||
color: $ansi-magenta; | ||
} | ||
|
||
&.sgr36 { | ||
color: $ansi-cyan; | ||
} | ||
|
||
&.sgr37 { | ||
color: $ansi-white; | ||
} | ||
|
||
&.sgr40 { | ||
background-color: $ansi-black; | ||
} | ||
|
||
&.sgr41 { | ||
background-color: $ansi-red; | ||
} | ||
|
||
&.sgr42 { | ||
background-color: $ansi-green; | ||
} | ||
|
||
&.sgr43 { | ||
background-color: $ansi-yellow; | ||
} | ||
|
||
&.sgr44 { | ||
background-color: $ansi-blue; | ||
} | ||
|
||
&.sgr45 { | ||
background-color: $ansi-magenta; | ||
} | ||
|
||
&.sgr46 { | ||
background-color: $ansi-cyan; | ||
} | ||
|
||
&.sgr47 { | ||
background-color: $ansi-white; | ||
} | ||
|
||
&.sgr90 { | ||
color: $ansi-light-black; | ||
} | ||
|
||
&.sgr91 { | ||
color: $ansi-light-red; | ||
} | ||
|
||
&.sgr92 { | ||
color: $ansi-light-green; | ||
} | ||
|
||
&.sgr93 { | ||
color: $ansi-light-yellow; | ||
} | ||
|
||
&.sgr94 { | ||
color: $ansi-light-blue; | ||
} | ||
|
||
&.sgr95 { | ||
color: $ansi-light-magenta; | ||
} | ||
|
||
&.sgr96 { | ||
color: $ansi-light-cyan; | ||
} | ||
|
||
&.sgr97 { | ||
color: $ansi-light-white; | ||
} | ||
|
||
&.sgr100 { | ||
background-color: $ansi-light-black; | ||
} | ||
|
||
&.sgr101 { | ||
background-color: $ansi-light-red; | ||
} | ||
|
||
&.sgr102 { | ||
background-color: $ansi-light-green; | ||
} | ||
|
||
&.sgr103 { | ||
background-color: $ansi-light-yellow; | ||
} | ||
|
||
&.sgr104 { | ||
background-color: $ansi-light-blue; | ||
} | ||
|
||
&.sgr105 { | ||
background-color: $ansi-light-magenta; | ||
} | ||
|
||
&.sgr106 { | ||
background-color: $ansi-light-cyan; | ||
} | ||
|
||
&.sgr107 { | ||
background-color: $ansi-light-white; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.