]> Nishi Git Mirror - gwion.git/commitdiff
:art: Convert terminal output
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Fri, 3 Apr 2020 16:04:53 +0000 (18:04 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Fri, 3 Apr 2020 16:04:53 +0000 (18:04 +0200)
.gitignore
Makefile
book.toml
scripts/test.sh

index 514f1647cb71bea86832e8feae784c780ada4723..ecbc915834da92a001eb2106cf677c0d58e045f1 100644 (file)
@@ -2,3 +2,4 @@ src
 book
 log
 *.gw
+ansi2html*
index 1a3193bd81363ec8b60acaef8f8efc6fe17a0b86..04e64fb3b2b14adb26606af14f1be08911f8d1b4 100644 (file)
--- 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}"
index 1a1a9bff468ff14be80bec4d1d0e55eb27b46a8d..b18458c2ebebd1f2d36493df557f4f03fa91d968 100644 (file)
--- 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]
index 28b75977012d63e9a9060cc6333bed4459c71b0a..2463f81f93571e242a1b9af472568e1742a57c88 100644 (file)
@@ -17,7 +17,7 @@ interm() {
 
 noterm() {
   echo '<p class="mdr">'
-  sed 's/$/<\/br>/' log
+  cat log | bash ansi2html.sh --body-only | sed 's/$/<\/br>/'
   echo "</br>"
   check $@ && printf "${NOTERM_OK}\n" || printf "${NOTERM_NOT_OK}\n"
   echo '</p>'