theziz / aha Goto Github PK
View Code? Open in Web Editor NEWAnsi HTML Adapter
License: Other
Ansi HTML Adapter
License: Other
I am using the script(1)
command to record terminal sessions. aha
handles the output files well, but for one issue: programs which use \r
repeatedly to update the current output line. This results in numerous repeated lines in the aha
output, along with the raw CR characters.
Here is a sample file produced by script(1)
, in which I invoke apt-get(8)
. If you view this file in less(1)
, the CR characters and their associated text are clearly visible.
Here is a straight copy-and-paste from the terminal after the above command was run. The desired processing would produce text of this form (aside from the color, of course).
Being able to process script(1)
-generated files cleanly would be a useful feature, as these often capture ANSI escape sequences, and removing the CR characters without munging up the colors is nontrivial with standard Unix tools.
1;30 is rendered as black text, while it should be darkgray (#555 according to wikipedia standard VGA color table).
Is it possible to get only the body code without HTML, body and head tags?
While using the black color scheme, the SGR 'reset' parameter 0 turns the background of all following lines to white.
As an example, this line:
\033[1mLast segment %d (task index %d) completed: %s\033[0m
Gets turned into:
</span><span style="color:white;font-weight:bold;">Last segment 0 (task index 2) completed: Succeeded!</span><span style="color:white;"></span><span style="color:white;background-color:white;">
I'm by no mean well versed in those things, but I've looked into it a little and I believe this is caused by some of the content of the background color array having the wrong index.
Looking at .gitignore, there's this line:
/testcases/*
which hints that some tests have been written for the program, but are excluded from the repository.
It would be useful to have these tests as part of the repo.
Italic ansi codes don't seem to be applied into the html render.
It would be nice if AHA could process backspaces found in the text instead of just throwing them out as it seems to currently be doing. I'm using the program to pretty-print scripts my students have prepared with either their own or GCC's ANSI coloring in them. (That is a typescript from the script program.) They regularly backspace while scripting and/or use the arrows to scroll through their command history. The results I've seen so far look like such codes are just being thrown out. Could you please process them?
Since recently there's been quite a lot of new features introduced, I think it'd be great to bump the version number and have a new release.
Hey there!
I'd like to report a security issue but cannot find contact instructions on your repository.
If not a hassle, might you kindly add a SECURITY.md
file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.
Thank you for your consideration, and I look forward to hearing from you!
(cc @huntr-helper)
Hello. A look at the code doesn't seem to indicate that aha
actually supports xterm's 256 colors, so I'll ask it explicitly: Does aha
support 256 colors?
is it possible to use aha with "tee"
I want to display the output of my command on the console as well as pipe it using "aha" to an html file
I created a capture file of ANSI colors of a session of ffmpeg, see attached ansible-output.txt.
Then:
cat ansible-output.txt |aha >aha_out.htm
the file aha_out.htm is just black and white.
Is something getting lost in the "cat" command? Is there a way to push saved ANSI encoded content through aha?
Hey,
thanks for your project. Currently, make install
does not work on macOS since the install
command does not support the -D
option.
I created RPM packages for EL (6, 7), Fedora (26, 27, 28, 29), Mageia (6, 7), openSUSE (Leap 15.0, Tumbleweed). I hope it will be useful for someone.
RPM SPEC: http://pastebin.centos.org/876726/15301392/raw/
Repos: https://copr.fedorainfracloud.org/coprs/scx/aha/
When I try to install aha
in windows machine found the below error, Does anyone found the same?
Using cached https://files.pythonhosted.org/packages/95/61/6076ed4ce338fb124ad5ed2d2300b0464fe73aeb59237c21c12284c9479c/aha-0.85adev.tar.gz
ERROR: Command errored out with exit status 1:
command: 'd:\virtual\ssl_test\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AAUGUS~1\\AppData\\Local\\Temp\\pip-install-tv1qchjq\\aha\\setup.py'"'"'; __file__='"'"'C:\\Users\\AAUGUS~1\\AppData\\Local\\Temp\\pip-install-tv1qchjq\\aha\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\AAUGUS~1\AppData\Local\Temp\pip-install-tv1qchjq\aha\
Complete output (14 lines):
running egg_info
creating pip-egg-info\aha.egg-info
writing namespace_packages to pip-egg-info\aha.egg-info\namespace_packages.txt
writing top-level names to pip-egg-info\aha.egg-info\top_level.txt
writing dependency_links to pip-egg-info\aha.egg-info\dependency_links.txt
writing requirements to pip-egg-info\aha.egg-info\requires.txt
writing pip-egg-info\aha.egg-info\PKG-INFO
writing manifest file 'pip-egg-info\aha.egg-info\SOURCES.txt'
d:\virtual\ssl_test\lib\site-packages\setuptools\dist.py:474: UserWarning: Normalizing '0.85a' to '0.85a0'
normalized_version,
error: Namespace package problem: aha is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
"
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
root@fuzz06:/home/fuzz/fuzz/aha-master# gdb --args ./aha -f out/fuzzer1/crashes/poc.txt
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./aha...
(gdb) r
Starting program: /home/fuzz/fuzz/aha-master/aha -f out/fuzzer1/crashes/poc.txt
Program received signal SIGSEGV, Segmentation fault.
0x000055555555dc2b in main (argc=3, args=0x7fffffffe598) at aha.c:973
973 momelem=momelem->next;
(gdb) bt
#0 0x000055555555dc2b in main (argc=3, args=0x7fffffffe598) at aha.c:973
(gdb) l
968 state.highlighted = 1;
969 *dest=momelem->value-100;
970 }
971 break;
972 }
973 momelem=momelem->next;
974 }
975 deleteParse(elem);
976 break;
977 case 'H':
(gdb) nProgram terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
Installation from prebuilt packages:
pkgin install aha
Installation from sources
cd /usr/pkgsrc/textproc/aha && make install
I would like to use this tool on my NAS system.
The repo for it is a public one:
https://github.com/Entware/Entware
Now I was asked there whether the "aha" is unicode.
Can you answer this question?
Hello,
Curious if you might consider updating aha to include 256 color support, and ideally even true color support? For example, I have several scripts using Term::ExtendedColor to generate console colors...
Best,
Ryan
For some things passed to aha I get everything printed in a single line in the HTML where I would like the new lines to be printed. Am I missing something obvious?
$ df -l | aha
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with the aha Ansi HTML Adapter. https://github.com/theZiz/aha -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8" />
<title>stdin</title>
</head>
<body>
<pre>
Filesystem 1K-blocks Used Available Use% Mounted on
udev 2987924 0 2987924 0% /dev
tmpfs 603800 1768 602032 1% /run
/dev/sdb5 278083628 16868800 247019272 7% /
tmpfs 3018988 20 3018968 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 3018988 0 3018988 0% /sys/fs/cgroup
/dev/loop7 14848 14848 0 100% /snap/gnome-logs/37
/dev/loop1 35584 35584 0 100% /snap/gtk-common-themes/319
/dev/loop0 13312 13312 0 100% /snap/gnome-characters/103
/dev/loop3 144384 144384 0 100% /snap/gnome-3-26-1604/70
/dev/loop5 2304 2304 0 100% /snap/gnome-calculator/260
/dev/loop2 3840 3840 0 100% /snap/gnome-system-monitor/51
/dev/loop6 14976 14976 0 100% /snap/gnome-logs/45
/dev/loop8 13312 13312 0 100% /snap/gnome-characters/139
/dev/loop10 35456 35456 0 100% /snap/gtk-common-themes/818
/dev/loop9 90368 90368 0 100% /snap/core/5897
/dev/loop12 89984 89984 0 100% /snap/core/5742
/dev/loop13 3840 3840 0 100% /snap/gnome-system-monitor/57
/dev/loop14 89088 89088 0 100% /snap/core/4917
/dev/loop4 2432 2432 0 100% /snap/gnome-calculator/180
/dev/loop11 144128 144128 0 100% /snap/gnome-3-26-1604/74
/dev/sdc2 732470268 257415360 475054908 36% /media/sys-storage
/dev/sdb1 201454560 75544748 115653432 40% /media/lin-storage
tmpfs 603796 4 603792 1% /run/user/1000
tmpfs 603796 12 603784 1% /run/user/121
</pre>
</body>
</html>
The HTML mentions http://ziz.delphigl.com/tool_aha.php but that page is down so you probably want to remove the reference or point it to https://github.com/theZiz/aha
I took a hardcopy with a tmux session (tmux.hardcopy.gz) containing graphics characters. Aha doesn't seem to properly convert it regardless of ISO mode.
Original:
aha output:
I use aha in PHP code for colorize output.
But output text not ok. why?
exec("inxi -c 2 | aha -n > inxi.html", $returnOut, $stdout);
๏ฟฝ12CPU๏ฟฝ Quad Core AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (-MT MCP-) ๏ฟฝ
๏ฟฝ12speed/min/max๏ฟฝ 2762/1400/2100 MHz ๏ฟฝ12Kernel๏ฟฝ 5.13.0-40-generic x86_64 ๏ฟฝ12Up๏ฟฝ 8h 15m ๏ฟฝ
๏ฟฝ12Mem๏ฟฝ 14955.5/15704.2 MiB (95.2%) ๏ฟฝ12Storage๏ฟฝ 464.97 GiB (18.7% used) ๏ฟฝ12Procs๏ฟฝ 660 ๏ฟฝ
๏ฟฝ12Client๏ฟฝ Unknown Client: php7.2 ๏ฟฝ12inxi๏ฟฝ 3.3.06 ๏ฟฝ
Your filter can't distinguish between foreground and background colors. So you can't render bright fg with normal bg or vice-versa.
With my Perl One Liner pl
I give an example for generating a table of all combinations and the numbers that create them.
If you run that command snippet in a terminal, you get this output ansi-table.txt (which you can cat
if you don't want to download & run pl
). But if you hover it with your mouse, you see what aha -n
makes of it: In the "fg;" column you still see the contrast between color-pairs. But in all following columns, with a bg-color added, they become the same.
On a lesser note, you create a rather redundant amount of <span>
and style
. E.g. in the above example, the fg stays the same for the rest of the line. So you could set it once in an outer <span>
.
Similarly this alternates between red & green several times. You can see that I have adapted your output. I put the 1st color into an outer <span>
and nest the other color, saving quite a bit of html.
Thirdly, in this last example you also see how replacing the style
s with my predefined class
es makes it even more compact and readable. Here I didn't need it, but html would allow, e.g. class='red bright-green-bg'
.
I've trying to use aha with output generated by:
file1:
this is a test
file2:
this is also a test
diff -u file1 file2 | diff-highlight | aha > diff.html
This results in the end of line 1 (and line 2) being a weird background color. I expect a white background (no background color overridden), but it's gray instead.
It looks like the ^[27m isn't cancelling the ^[7m correctly.
diff-highlight can be found at git/contrib/diff-highlight
Great work. Is there any way I could view output in terminal and get the htm simultaneously? I am doing android builds and these are very long and it'll be great if we can have output on terminal as well as an htm
Using aha commit 5eaec96, and this input file:
aha
by itself gives correct output, but aha --line-fix
gives output like
Script started on 2022-03-21 12:55:00-0400
host:/tmp/lstest$ ls -1
apple
banana
canteloupe/
durian
enchilada
host:/tmp/lstest$ exit
Script done on 2022-03-21 12:55:03-0400
Adding the --ignore-cr
option does not help.
This input file is intended as a minimal example. --line-fix
is not needed to process it correctly, but I have more complex inputs that do require this option, and likewise get the double-spaced lines.
I don't know much about how ANSI colors work, so forgive my ignorance here.
I'm trying to save colorized git diff
output to HTML, but am having an issue where the background colors aren't appearing in the HTML. Running the following command:
git diff -w --color old.txt new.txt | aha --black > diff.html
Terminal output:
Rendered Aha HTML:
I tried ansifilter as well and had the same problem, so I wonder if it might be something weird with how diff-highlight
does background colors or something?
Potentially-relevant lines from my .gitconfig
:
[color]
ui = true
[pager]
diff = diff-highlight | less
and software versions:
$ aha --version
Ansi Html Adapter Version 0.4.10.6
$ git --version
git version 2.12.2
hub version 2.2.9
Tested using ZSH on iTerm and Terminal. Awesome project, thanks!
Apparently, by default, in the terminal, it makes a program line-buffered, whereas outside that it is fully buffered.
aha
you can just type and immediately see output, whereas aha | cat
, you do not.
This led to some confusion when i was trying to re-use a few piped programs to reduce overhead by inserting a pattern i'd recognize and stop reading at, but the stream just blocked. (Here is a bit of discussion about that.) eklitzke.org/stdout-buffering indicates some other ways it could give people some trouble. @zseri also provides a command stdbuf -o L aha
to avoid this issue.
I am not sure if it is the aha-program's responsibility. See that, for instance, bat
syntax highlighting disables buffering entirely, seems to me that efficiency does kindah matter. Based on what zseri says setvbuf(stream, NULL, _IOLBF, 0);
disables it setlinebuf
makes it line-buffered. I don't think this complexity will bite users/devs in the ass, since it's just setting about the stream?
A nice feature would be to have a --font-size
option where you can set 30px
for example.
I've now solved it with a sed
:
... | aha | \
sed -E "s,^<pre>$,<div style=\"font-size:${fontsize}\"><pre>," | \
sed -E 's,^</pre>$,</pre></div>,'
Nice project, I'm using it for some logs)
It would be cool if the user could inject javascript into the header, or body. I'd like my logs to be able to scroll to the bottom.
i made a wrapper script, to convert aha's html output to github-compatible html
https://github.com/milahu/random/blob/master/colors-to-github.sh
on github, we need <pre><span color="red">red</span></pre>
etc
demo:
colors-to-github.sh jp2a 'awesome face.png'
.;ldkO00Okdl;. .o0XXXXXXXXXXXXXX0o. .kKKXXXXXXXXXXXXKKXXXXk' ::dk: :0XXXXXXdcdkd.'xXXXo o.NMMc ..KXXXX:dMMM0...dXXXd 'O,MMMMMM;kXXXX.MMMMMMMX'XXXX, oXloooooolKXXXXoooooooolxXXXXd oXKkkkkkkkkkkkkkkkkkkkkkXXXXXo 'XKk .................. dXXXX, oXXc...................lXXXd lXX:.......':lolc,....KXXo .kXx....'oKKKKKKKc.cKXk' .l0kc,;oxxdolccxK0o. .cdxxxkkkdc'
MPL-1.1 or what version of LGPL? Any?
Thank you
Compiled from ea38baa
$ echo $( tput bold )"foo"$( tput sgr0 )"bar" | ~/aha/aha
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with the aha Ansi HTML Adapter. https://github.com/theZiz/aha -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8" />
<title>stdin</title>
</head>
<body>
<pre>
<span style="font-weight:bold;">fooB</span>bar
</pre>
</body>
</html>
(There's a B after foo)
Is there any way to specify a different (monospace) font for the HTML output? To get the output HTML in the font SF Mono, for example, I tried:
... | aha -y 'font-family: "SF Mono"'
, but the HTML output is still in what looks like Courier. Disclaimer: I don't really know CSS.
Hi,
Could you help me understand how the htop fix works? I don't quite get the code.
I can't install aha on a server, but need to parse htop output and the only part I am still missing is how to replace the "newlines" in the output. I would love to have an example akin to `echo "weird htop newline"|sed command to replace with \n``
if (opts.htop_fix) //a little dirty ...
{
elem=parseInsert(buffer);
pelem second=elem->next;
if (second==NULL)
second=elem;
newline=second->digit[0]-1;
if (second->digitcount>1)
newline=(newline+1)*10+second->digit[1]-1;
if (second->digitcount>2)
newline=(newline+1)*10+second->digit[2]-1;
deleteParse(elem);
if (newline<line)
opts.line_break=1;
}
Have readme explain what aha does.
Hello!
If possible, could you add support for this? Would be nice to have.
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
Thanks!
I have a script that generates pretty terminal tables that I'd like to convert to HTML using AHA.
The output in the console looks like this:
But once it has been parsed by aha it looks like this:
The bars/lines are all messed up. I have encountered a very similar issue with tmux in the past, where the problem was that tmux was showing these characters instead of pretty tables but can be solved by forcing tmux in unicode mode with -u flag.
Is there something similar I could use for this ?
If it makes any difference I'm using aha through pipes, like this:
data=$(./status.py $@)
echo -e "$data" | aha
input file gdb.txt
command:
aha --title "PHP core dump backtrace" --word-wrap -f gdb.txt > gdb_color.html
part of output (browser)
#1 0x00005603b6cfddc7 in strx_printv (ccp=0x7ffd455f2964, buf=0x5603b94ba6f0 "P\227K\271\003V",
len=1,
format=0x7f0586f798a8 "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> %s: %s in %s on line <i>%d</i></th></tr>\n", ap=0x7ffd455f29a0) at /php-7.4.4/main/snprintf.c:1239
part of output (source)
#1 <span style="color:blue;">0x00005603b6cfddc7</span> in <span style="color:olive;">strx_printv</span> (<span style="color:teal;">ccp</span>=0x7ffd455f2964, <span style="color:teal;">buf</span>=0x5603b94ba6f0 "P\227K\271\003V",
<span style="color:teal;">len</span>=1,
<span style="color:teal;">format</span>=0x7f0586f798a8 "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> %s: %s in %s on line <i>%d</i></th></tr>\n", <span style="color:teal;">ap</span>=0x7ffd455f29a0) at <span style="color:green;">/php-7.4.4/main/snprintf.c</span>:1239
Hi,
not sure if this is possible at all, but could aha
query the current rgb-mapping of, for example, the color green and insert this value instead of the name into the html?
Greetings
Relating to #14. Can you just add files called "LICENSE" or "COPYING" with the text of the licences that you want to use? Please use one file for each license.
I use the command line tool rougify
of the ruby highlighting lib https://github.com/jneen/rouge to color text files that I want to save later as html.
Minimal example:
echo "{'a': 14}" | rougify highlight -l js | aha --title "rougify test"
Unfortunately, the output seems empty, because the colors are wrongly set. The output from above is:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with the aha Ansi HTML Adapter. https://github.com/theZiz/aha -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8" />
<title>rougify test</title>
</head>
<body>
<pre>
<span style="color:white;text-decoration:blink;">{</span><span style="color:black;text-decoration:blink;"></span><span style="color:white;font-weight:bold;text-decoration:blink;">'a'</span><span style="color:white;text-decoration:blink;">:</span><span style="color:black;text-decoration:blink;"></span><span style="color:white;text-decoration:blink;"> </span><span style="color:black;text-decoration:blink;"></span><span style="color:white;font-weight:bold;text-decoration:blink;">14</span><span style="color:white;text-decoration:blink;">}</span><span style="color:black;text-decoration:blink;"></span><span style="color:white;text-decoration:blink;"></span><span style="color:black;text-decoration:blink;">
</span><span style="color:white;text-decoration:blink;"></span><span style="color:black;text-decoration:blink;"></span>
</pre>
</body>
</html>
Note that the color is only black and white. In the browser Firefox, the file seems to be empty.
Since the last release has happened ~2 years ago and some fixes have been merged, would it be possible to get a new release (i.e. version)?. This would be immensely helpful to distro packagers, so we don't have to patch the 0.5.1 release.
When I record terminal sessions using script(1), on occasion a full-screen ncurses-style dialog will pop up. This results in a big mess in the recorded session, with a large number of escapes for colors, cursor positioning, etc. However, none of that needs to be reflected in the final output, if all you want to see is the normal terminal buffer.
This file is a simple example. It is a terminal session recorded with script(1), in which I invoke a command dpkg-reconfigure tzdata
that pops up an ncurses dialog. You can see the mess of escapes in the file, after the command is entered. I even navigated around the dialog a bit, just to make the mess even worse.
However, once I exit the dialog, the terminal looks like this:
root@xubuntu:/tmp# script typescript-dialog.txt
Script started, output log file is 'typescript-dialog.txt'.
root@xubuntu:/tmp#
root@xubuntu:/tmp# dpkg-reconfigure tzdata
Current default time zone: 'Etc/UTC'
Local time is now: Mon Mar 21 17:21:29 UTC 2022.
Universal Time is now: Mon Mar 21 17:21:29 UTC 2022.
root@xubuntu:/tmp#
root@xubuntu:/tmp#
exit
Script done.
root@xubuntu:/tmp#
The dialog screens are no longer present in the terminal buffer, even if I scroll up. That is because the entire dialog interaction took place in the terminal's "alternative screen buffer," which is separate from the normal buffer. The normal buffer is what I would want to see in the final HTML output.
As documented here, the alternative screen buffer is enabled by ESC[?1049h
, and disabled by ESC[?1049l
. All that would be needed is to ignore everything between these two escapes.
(This could be made optional, but given that the alternative screen buffer is typically used by full-screen text UIs that aha can't meaningfully handle anyway, I don't think that anyone would want to turn it off.)
Would be cool if there's a way to specify a css file to use.
Something like --css=style.css
And then it just injects the tag into the header.
I could just do it with extra commands, but it would be easier this way.
Or at least some style options like font size.
See the dump at https://gist.github.com/6d536c6ed8af20bcacb0d89077101f41
When you look at the rendered html https://rawgit.com/jpluimers/6d536c6ed8af20bcacb0d89077101f41/raw/19bbaad542764ce5f99fce66ed313dc9caf2e834/testssl.sh.html, you see these URLs are not a href
tags:
It would be cool if they did (but I understand this would make parsing more than a tad complexer).
When given a character whose highlight and text colour match, the terminal will render text using its background colour (essentially 'punching through' the highlight).
aha
, however, renders the text in its own highlight colour -- resulting in a solid block in the HTML output, whose text can only be read by block-selecting it.
When text and highlight colour match, aha
should therefore render text in the chosen/specified terminal background colour, as opposed to the ANSI colour currently in use.
Issue: In my terminal, the output of my npm run has only 1 word in bold. The output in my html file after running aha has all the following words in bold as well.
see dump of files here: https://gist.github.com/eanderson4/807cc5dc676e8be291863c0bc043aa33
I run the following command to keep the ansi escape characters in a log.
$ unbuffer npm start > npm.log
$ cat npm.log | ./aha > npm.html
In the terminal, only 'Access URLs:' appears to be bold. However, in the html file, every word that follows is in bold. I don't really know much about these ansi characters to debug anything so I was wondering if there is any obvious mistake I was making in this.
$ ./aha --version
Ansi Html Adapter Version 0.4.10.3
And thank you for this program, it is very useful! Much appreciated.
Eric
I assumed that using the --no-header
option would remove the <head></head>
section from the outputted HTML but it actually doesn't output any HTML formatting at all.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.