-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename package (AnsiColoredPrinters -> ANSIColoredPrinters) (#9)
This also removes ".travis.yml" and updates "TagBot.yml" and "ci.yml".
- Loading branch information
Showing
12 changed files
with
102 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
name: TagBot | ||
on: | ||
schedule: | ||
- cron: 0 * * * * | ||
issue_comment: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
jobs: | ||
TagBot: | ||
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JuliaRegistries/TagBot@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ssh: ${{ secrets.DOCUMENTER_KEY }} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# AnsiColoredPrinters | ||
# ANSIColoredPrinters | ||
|
||
[![Docs Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://kimikage.github.io/AnsiColoredPrinters.jl/stable) | ||
[![Docs Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://kimikage.github.io/AnsiColoredPrinters.jl/dev) | ||
[![Build Status](https://travis-ci.com/kimikage/AnsiColoredPrinters.jl.svg?branch=main)](https://travis-ci.com/kimikage/AnsiColoredPrinters.jl) | ||
[![Codecov](https://codecov.io/gh/kimikage/AnsiColoredPrinters.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/kimikage/AnsiColoredPrinters.jl) | ||
[![Docs Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://kimikage.github.io/ANSIColoredPrinters.jl/stable) | ||
[![Docs Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://kimikage.github.io/ANSIColoredPrinters.jl/dev) | ||
[![CI](https://github.com/kimikage/ANSIColoredPrinters.jl/workflows/CI/badge.svg)](https://github.com/kimikage/ANSIColoredPrinters.jl/actions?query=workflow%3ACI) | ||
[![Codecov](https://codecov.io/gh/kimikage/ANSIColoredPrinters.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/kimikage/ANSIColoredPrinters.jl) | ||
|
||
AnsiColoredPrinters converts a UTF-8 text qualified by | ||
ANSIColoredPrinters converts a UTF-8 text qualified by | ||
[ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) to another | ||
format. |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module AnsiColoredPrinters | ||
module ANSIColoredPrinters | ||
|
||
import Base: show, showable | ||
|
||
|
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 |
---|---|---|
@@ -1,145 +1,145 @@ | ||
using Test, AnsiColoredPrinters | ||
using Test, ANSIColoredPrinters | ||
|
||
@testset "isnormal" begin | ||
n = AnsiColoredPrinters.SGRColor() | ||
@test AnsiColoredPrinters.isnormal(n) | ||
n = ANSIColoredPrinters.SGRColor() | ||
@test ANSIColoredPrinters.isnormal(n) | ||
|
||
c16 = AnsiColoredPrinters.SGRColor("30") | ||
@test !AnsiColoredPrinters.isnormal(c16) | ||
c16 = ANSIColoredPrinters.SGRColor("30") | ||
@test !ANSIColoredPrinters.isnormal(c16) | ||
|
||
c256 = AnsiColoredPrinters.SGRColor("38_5", "000") | ||
@test !AnsiColoredPrinters.isnormal(c256) | ||
c256 = ANSIColoredPrinters.SGRColor("38_5", "000") | ||
@test !ANSIColoredPrinters.isnormal(c256) | ||
end | ||
|
||
@testset "is216color" begin | ||
c000 = AnsiColoredPrinters.SGRColor("38_5", "000") | ||
@test AnsiColoredPrinters.is216color(c000) | ||
c000 = ANSIColoredPrinters.SGRColor("38_5", "000") | ||
@test ANSIColoredPrinters.is216color(c000) | ||
|
||
c080808 = AnsiColoredPrinters.SGRColor("48_5", "080808") | ||
@test !AnsiColoredPrinters.is216color(c080808) | ||
c080808 = ANSIColoredPrinters.SGRColor("48_5", "080808") | ||
@test !ANSIColoredPrinters.is216color(c080808) | ||
|
||
cabc = AnsiColoredPrinters.SGRColor("38_2", "abc") | ||
@test !AnsiColoredPrinters.is216color(cabc) | ||
cabc = ANSIColoredPrinters.SGRColor("38_2", "abc") | ||
@test !ANSIColoredPrinters.is216color(cabc) | ||
end | ||
|
||
@testset "set_16colors!" begin | ||
ctx = AnsiColoredPrinters.SGRContext() | ||
ctx = ANSIColoredPrinters.SGRContext() | ||
|
||
AnsiColoredPrinters.set_16colors!(ctx, "30") | ||
ANSIColoredPrinters.set_16colors!(ctx, "30") | ||
@test ctx.fg.class == "30" | ||
@test isempty(ctx.fg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (30,) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (30,) | ||
|
||
AnsiColoredPrinters.set_16colors!(ctx, "47") | ||
ANSIColoredPrinters.set_16colors!(ctx, "47") | ||
@test ctx.bg.class == "47" | ||
@test isempty(ctx.bg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (47,) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (47,) | ||
|
||
AnsiColoredPrinters.set_16colors!(ctx, "97") | ||
ANSIColoredPrinters.set_16colors!(ctx, "97") | ||
@test ctx.fg.class == "97" | ||
@test isempty(ctx.fg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (97,) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (97,) | ||
|
||
AnsiColoredPrinters.set_16colors!(ctx, "100") | ||
ANSIColoredPrinters.set_16colors!(ctx, "100") | ||
@test ctx.bg.class == "100" | ||
@test isempty(ctx.bg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (100,) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (100,) | ||
end | ||
|
||
@testset "set_256colors!" begin | ||
ctx = AnsiColoredPrinters.SGRContext() | ||
ctx = ANSIColoredPrinters.SGRContext() | ||
|
||
# 16 colors | ||
AnsiColoredPrinters.set_256colors!(ctx, "38", "1") | ||
ANSIColoredPrinters.set_256colors!(ctx, "38", "1") | ||
@test ctx.fg.class == "31" | ||
@test isempty(ctx.fg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (31,) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (31,) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "48", "6") | ||
ANSIColoredPrinters.set_256colors!(ctx, "48", "6") | ||
@test ctx.bg.class == "46" | ||
@test isempty(ctx.bg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (46,) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (46,) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "38", "15") | ||
ANSIColoredPrinters.set_256colors!(ctx, "38", "15") | ||
@test ctx.fg.class == "97" | ||
@test isempty(ctx.fg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (97,) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (97,) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "48", "8") | ||
ANSIColoredPrinters.set_256colors!(ctx, "48", "8") | ||
@test ctx.bg.class == "100" | ||
@test isempty(ctx.bg.hex) | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (100,) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (100,) | ||
|
||
# 216 colors (6 * 6 * 6) | ||
AnsiColoredPrinters.set_256colors!(ctx, "38", "16") | ||
ANSIColoredPrinters.set_256colors!(ctx, "38", "16") | ||
@test ctx.fg.class == "38_5" | ||
@test ctx.fg.hex == "000" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 5, 16) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 5, 16) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "48", "17") | ||
ANSIColoredPrinters.set_256colors!(ctx, "48", "17") | ||
@test ctx.bg.class == "48_5" | ||
@test ctx.bg.hex == "00005f" | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (48, 5, 17) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (48, 5, 17) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "38", "110") | ||
ANSIColoredPrinters.set_256colors!(ctx, "38", "110") | ||
@test ctx.fg.class == "38_5" | ||
@test ctx.fg.hex == "87afd7" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 5, 110) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 5, 110) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "38", "230") | ||
ANSIColoredPrinters.set_256colors!(ctx, "38", "230") | ||
@test ctx.fg.class == "38_5" | ||
@test ctx.fg.hex == "ffffd7" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 5, 230) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 5, 230) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "48", "231") | ||
ANSIColoredPrinters.set_256colors!(ctx, "48", "231") | ||
@test ctx.bg.class == "48_5" | ||
@test ctx.bg.hex == "fff" | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (48, 5, 231) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (48, 5, 231) | ||
|
||
# grays | ||
AnsiColoredPrinters.set_256colors!(ctx, "38", "232") | ||
ANSIColoredPrinters.set_256colors!(ctx, "38", "232") | ||
@test ctx.fg.class == "38_5" | ||
@test ctx.fg.hex == "080808" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 5, 232) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 5, 232) | ||
|
||
AnsiColoredPrinters.set_256colors!(ctx, "48", "255") | ||
ANSIColoredPrinters.set_256colors!(ctx, "48", "255") | ||
@test ctx.bg.class == "48_5" | ||
@test ctx.bg.hex == "eee" | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (48, 5, 255) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (48, 5, 255) | ||
end | ||
|
||
@testset "set_24bitcolors" begin | ||
ctx = AnsiColoredPrinters.SGRContext() | ||
ctx = ANSIColoredPrinters.SGRContext() | ||
|
||
AnsiColoredPrinters.set_24bitcolors!(ctx, "38", "0", "128", "255") | ||
ANSIColoredPrinters.set_24bitcolors!(ctx, "38", "0", "128", "255") | ||
@test ctx.fg.class == "38_2" | ||
@test ctx.fg.hex == "0080ff" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 2, 0, 128, 255) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 2, 0, 128, 255) | ||
|
||
AnsiColoredPrinters.set_24bitcolors!(ctx, "48", "170", "187", "204") | ||
ANSIColoredPrinters.set_24bitcolors!(ctx, "48", "170", "187", "204") | ||
@test ctx.bg.class == "48_2" | ||
@test ctx.bg.hex == "abc" | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (48, 2, 170, 187, 204) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (48, 2, 170, 187, 204) | ||
|
||
# 216 colors | ||
AnsiColoredPrinters.set_24bitcolors!(ctx, "38", "0", "0", "0") | ||
ANSIColoredPrinters.set_24bitcolors!(ctx, "38", "0", "0", "0") | ||
@test ctx.fg.class == "38_5" | ||
@test ctx.fg.hex == "000" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 5, 16) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 5, 16) | ||
|
||
AnsiColoredPrinters.set_24bitcolors!(ctx, "48", "0", "0", "95") | ||
ANSIColoredPrinters.set_24bitcolors!(ctx, "48", "0", "0", "95") | ||
@test ctx.bg.class == "48_5" | ||
@test ctx.bg.hex == "00005f" | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (48, 5, 17) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (48, 5, 17) | ||
|
||
# grays | ||
AnsiColoredPrinters.set_24bitcolors!(ctx, "38", "8", "8", "8") | ||
ANSIColoredPrinters.set_24bitcolors!(ctx, "38", "8", "8", "8") | ||
@test ctx.fg.class == "38_5" | ||
@test ctx.fg.hex == "080808" | ||
@test AnsiColoredPrinters.codes(ctx.fg) === (38, 5, 232) | ||
@test ANSIColoredPrinters.codes(ctx.fg) === (38, 5, 232) | ||
|
||
AnsiColoredPrinters.set_24bitcolors!(ctx, "48", "238", "238", "238") | ||
ANSIColoredPrinters.set_24bitcolors!(ctx, "48", "238", "238", "238") | ||
@test ctx.bg.class == "48_5" | ||
@test ctx.bg.hex == "eee" | ||
@test AnsiColoredPrinters.codes(ctx.bg) === (48, 5, 255) | ||
@test ANSIColoredPrinters.codes(ctx.bg) === (48, 5, 255) | ||
end |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Test, AnsiColoredPrinters | ||
using Test, ANSIColoredPrinters | ||
|
||
@testset "plain" begin | ||
buf = IOBuffer() | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Test, AnsiColoredPrinters | ||
using Test, ANSIColoredPrinters | ||
|
||
@testset "colors" begin | ||
include("colors.jl") | ||
|