Skip to content

Commit

Permalink
Rename package (AnsiColoredPrinters -> ANSIColoredPrinters) (#9)
Browse files Browse the repository at this point in the history
This also removes ".travis.yml" and updates "TagBot.yml" and "ci.yml".
  • Loading branch information
kimikage committed Nov 7, 2020
1 parent f040d21 commit bbdfb6d
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 103 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/TagBot.yml
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 }}
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI
on:
- push
- pull_request

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
Expand Down Expand Up @@ -45,3 +46,20 @@ jobs:
with:
file: lcov.info

docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs --color=yes docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "AnsiColoredPrinters"
name = "ANSIColoredPrinters"
uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
version = "0.1.0"

Expand Down
12 changes: 6 additions & 6 deletions README.md
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.
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Documenter, AnsiColoredPrinters
using Documenter, ANSIColoredPrinters

makedocs(
clean = false,
modules=[AnsiColoredPrinters],
modules=[ANSIColoredPrinters],
format=Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true",
assets = ["assets/default.css"]),
sitename="AnsiColoredPrinters",
sitename="ANSIColoredPrinters",
pages=[
"Introduction" => "index.md",
"Supported Codes" => "supported-codes.md",
Expand All @@ -14,7 +14,7 @@ makedocs(
)

deploydocs(
repo="github.com/kimikage/AnsiColoredPrinters.jl.git",
repo="github.com/kimikage/ANSIColoredPrinters.jl.git",
devbranch = "main",
push_preview = true
)
10 changes: 5 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AnsiColoredPrinters
# ANSIColoredPrinters

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. Currently, only conversion to an HTML ([`HTMLPrinter`](@ref)) is
implemented.
Expand All @@ -9,11 +9,11 @@ implemented.
The package can be installed with the Julia package manager. Run:
```julia
import Pkg
Pkg.add("AnsiColoredPrinters")
Pkg.add("ANSIColoredPrinters")
```
or, from the Julia REPL, type `]` to enter the Pkg REPL mode and run:
```julia
pkg> add AnsiColoredPrinters
pkg> add ANSIColoredPrinters
```

## Usage
Expand All @@ -25,7 +25,7 @@ this Documenter's HTML output), the text is displayed as HTML with its ANSI
escape codes are translated into HTML elements.

```@example ex
using AnsiColoredPrinters
using ANSIColoredPrinters
using Crayons
buf = IOBuffer()
Expand Down
2 changes: 1 addition & 1 deletion docs/src/supported-codes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Supported Codes
```@setup ex
using AnsiColoredPrinters
using ANSIColoredPrinters
```
## Bold and Faint
```@example ex
Expand Down
2 changes: 1 addition & 1 deletion src/AnsiColoredPrinters.jl → src/ANSIColoredPrinters.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module AnsiColoredPrinters
module ANSIColoredPrinters

import Base: show, showable

Expand Down
116 changes: 58 additions & 58 deletions test/colors.jl
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
2 changes: 1 addition & 1 deletion test/html.jl
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()
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
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")
Expand Down

0 comments on commit bbdfb6d

Please sign in to comment.