From bbdfb6d973241f021b399f2286377681d65f2c64 Mon Sep 17 00:00:00 2001 From: kimikage Date: Sat, 7 Nov 2020 10:29:38 +0900 Subject: [PATCH] Rename package (AnsiColoredPrinters -> ANSIColoredPrinters) (#9) This also removes ".travis.yml" and updates "TagBot.yml" and "ci.yml". --- .github/workflows/TagBot.yml | 8 +- .github/workflows/ci.yml | 18 +++ .travis.yml | 23 ---- Project.toml | 2 +- README.md | 12 +- docs/make.jl | 8 +- docs/src/index.md | 10 +- docs/src/supported-codes.md | 2 +- ...oredPrinters.jl => ANSIColoredPrinters.jl} | 2 +- test/colors.jl | 116 +++++++++--------- test/html.jl | 2 +- test/runtests.jl | 2 +- 12 files changed, 102 insertions(+), 103 deletions(-) delete mode 100644 .travis.yml rename src/{AnsiColoredPrinters.jl => ANSIColoredPrinters.jl} (99%) diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0..623860f 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04ed32f..6c85540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: - push - pull_request + jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} @@ -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 }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8ed8f79..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: julia -os: - - linux -julia: - - '1' -arch: - - x64 - - arm64 -notifications: - email: false -jobs: - include: - - stage: "Documentation" - julia: '1' - os: linux - arch: x64 - script: - - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate()' - - julia --project=docs/ docs/make.jl - after_success: skip -after_success: - - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())' diff --git a/Project.toml b/Project.toml index e9c686f..ae72ff9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "AnsiColoredPrinters" +name = "ANSIColoredPrinters" uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" version = "0.1.0" diff --git a/README.md b/README.md index 752c010..e3b9961 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/make.jl b/docs/make.jl index 286a328..45486ce 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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", @@ -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 ) diff --git a/docs/src/index.md b/docs/src/index.md index be73b11..470f854 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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. @@ -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 @@ -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() diff --git a/docs/src/supported-codes.md b/docs/src/supported-codes.md index ac1f3be..d9923d8 100644 --- a/docs/src/supported-codes.md +++ b/docs/src/supported-codes.md @@ -1,6 +1,6 @@ # Supported Codes ```@setup ex -using AnsiColoredPrinters +using ANSIColoredPrinters ``` ## Bold and Faint ```@example ex diff --git a/src/AnsiColoredPrinters.jl b/src/ANSIColoredPrinters.jl similarity index 99% rename from src/AnsiColoredPrinters.jl rename to src/ANSIColoredPrinters.jl index 4cfb67a..f60aca7 100644 --- a/src/AnsiColoredPrinters.jl +++ b/src/ANSIColoredPrinters.jl @@ -1,4 +1,4 @@ -module AnsiColoredPrinters +module ANSIColoredPrinters import Base: show, showable diff --git a/test/colors.jl b/test/colors.jl index 91a2ee1..c823ab8 100644 --- a/test/colors.jl +++ b/test/colors.jl @@ -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 diff --git a/test/html.jl b/test/html.jl index ea3273d..53073fb 100644 --- a/test/html.jl +++ b/test/html.jl @@ -1,4 +1,4 @@ -using Test, AnsiColoredPrinters +using Test, ANSIColoredPrinters @testset "plain" begin buf = IOBuffer() diff --git a/test/runtests.jl b/test/runtests.jl index 6d1c4ff..e2f11a9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using Test, AnsiColoredPrinters +using Test, ANSIColoredPrinters @testset "colors" begin include("colors.jl")