srid / neuron

Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote)
https://neuron.zettel.page
GNU Affero General Public License v3.0
1.52k stars 150 forks source link

ANSI colors in emacs look ugly #555

Closed arkoort closed 3 years ago

arkoort commented 3 years ago

When neuron-mode uses neuron executable for generating HTML, its output in the *compilation* buffer look like:

   Plugins enabled: links, tags, uptree
   Loading directory tree (84 .md files) ...
   Building graph (84 notes) ...
   Building route data ...
   Rendering routes (85 slugs) ...
💾 impulse.html
💾 forth.html
🥅 2 files updated in /home/ark/zettelkasten/.neuron/output

If I understand right, System.Console.ANSI has function hSupportsANSI, which can determine this situation. Maybe it would be better not to use colors if this function returns False.

srid commented 3 years ago

Agreed; this would be a good candidate for a PR.

srid commented 3 years ago

neuron uses the co-log library; so perhaps try to figure out how other co-log users achieve this in an idiomatic way.

https://github.com/srid/neuron/blob/master/neuron/src/app/Neuron/CLI/Logging.hs

EDIT: I suppose it would be sufficient to pass a flag to mkLogAction above, to allow / disable colors.

forketyfork commented 3 years ago

Hey, please check out my PR that fixes the issue.