From 83e9fb80533ae62a92a757c62ba4e7fb3904b4b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 3 Apr 2020 18:04:53 +0200 Subject: [PATCH] :art: Convert terminal output --- .gitignore | 1 + Makefile | 8 +++++++- book.toml | 2 +- scripts/test.sh | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 514f1647..ecbc9158 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ src book log *.gw +ansi2html* diff --git a/Makefile b/Makefile index 1a3193bd..04e64fb3 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: ensure deploy: build @sh scripts/deploy.sh -ensure: +ensure: style.css @sh scripts/ensure.sh lint: @@ -22,6 +22,12 @@ clean-tests: clean-all: clean clean-tests @rm -rf src +style.css: ansi2html.sh + @bash ansi2html.sh --css-only > ansi2html.css + +ansi2html.sh: + @curl https://raw.githubusercontent.com/pixelb/scripts/master/scripts/ansi2html.sh -o $@ + .SUFFIXES: .gw .test .gw.test: @bash scripts/test.sh $< "${CONTAINS}" diff --git a/book.toml b/book.toml index 1a1a9bff..b18458c2 100644 --- a/book.toml +++ b/book.toml @@ -4,7 +4,7 @@ title = "Gwion" [output.html] default-theme = "rust" -additional-css = ["custom.css"] +additional-css = ["custom.css", "ansi2html.css"] git-repository-url ="https://github.com/fennecdjay/Gwion" [output.html.fold] diff --git a/scripts/test.sh b/scripts/test.sh index 28b75977..2463f81f 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -17,7 +17,7 @@ interm() { noterm() { echo '

' - sed 's/$/<\/br>/' log + cat log | bash ansi2html.sh --body-only | sed 's/$/<\/br>/' echo "
" check $@ && printf "${NOTERM_OK}\n" || printf "${NOTERM_NOT_OK}\n" echo '

' -- 2.43.0