www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - textattr library for text colors and attributes available in D

reply Shriramana Sharma writes:
https://github.com/jamadagni/textattr/

textattr is a library and command-line tool that makes adding 
color and attributes to beautify the terminal output of your 
program easier by translating human-readable specs into ANSI 
escape codes.

The library is available for C, C++, Python and D. C++ and Python 
use the C code for internal processing but the D code is a 
separate implementation for easy inclusion of textattr.d in a D 
compilation command without requiring any external linking.

Copyright: Shriramana Sharma, 2018
License: BSD-2-Clause
Nov 08 2018
next sibling parent reply Bastiaan Veelo <Bastiaan Veelo.net> writes:
On Thursday, 8 November 2018 at 13:37:08 UTC, Shriramana Sharma 
wrote:
 https://github.com/jamadagni/textattr/

 textattr is a library and command-line tool that makes adding 
 color and attributes to beautify the terminal output of your 
 program easier by translating human-readable specs into ANSI 
 escape codes.

 The library is available for C, C++, Python and D. C++ and 
 Python use the C code for internal processing but the D code is 
 a separate implementation for easy inclusion of textattr.d in a 
 D compilation command without requiring any external linking.

 Copyright: Shriramana Sharma, 2018
 License: BSD-2-Clause
Cool, must remember this in case I need it one day. Do you have plans to add it to the dub registry?
Nov 08 2018
parent reply Shriramana Sharma writes:
On Thursday, 8 November 2018 at 19:26:15 UTC, Bastiaan Veelo 
wrote:
 Cool, must remember this in case I need it one day. Do you have 
 plans to add it to the dub registry?
Don't know how. Can follow instructions if provided. Does DUB also allow multi-language libs one of which is D? Unfortunately my D usage isn't as much as I'd like it to be so haven't kept up so closely…
Nov 08 2018
parent reply JN <666total wp.pl> writes:
On Friday, 9 November 2018 at 03:02:01 UTC, Shriramana Sharma 
wrote:
 On Thursday, 8 November 2018 at 19:26:15 UTC, Bastiaan Veelo 
 wrote:
 Cool, must remember this in case I need it one day. Do you 
 have plans to add it to the dub registry?
Don't know how. Can follow instructions if provided. Does DUB also allow multi-language libs one of which is D? Unfortunately my D usage isn't as much as I'd like it to be so haven't kept up so closely…
You can find the instructions on how to create a dub package here: http://code.dlang.org/publish It looks to me like the textattr.d is all that is needed? Should be easy to put it in a separate package that could be uploaded to dub registry.
Nov 09 2018
parent Shriramana Sharma writes:
On Friday, 9 November 2018 at 22:28:28 UTC, JN wrote:
 It looks to me like the textattr.d is all that is needed? 
 Should be easy to put it in a separate package that could be 
 uploaded to dub registry.
Yes indeed textattr.d is all that is needed! For C too textattr.c|h are all that are needed.
Nov 22 2018
prev sibling parent Basile B. <b2.temp gmx.com> writes:
On Thursday, 8 November 2018 at 13:37:08 UTC, Shriramana Sharma 
wrote:
 https://github.com/jamadagni/textattr/

 textattr is a library and command-line tool that makes adding 
 color and attributes to beautify the terminal output of your 
 program easier by translating human-readable specs into ANSI 
 escape codes.

 The library is available for C, C++, Python and D. C++ and 
 Python use the C code for internal processing but the D code is 
 a separate implementation for easy inclusion of textattr.d in a 
 D compilation command without requiring any external linking.

 Copyright: Shriramana Sharma, 2018
 License: BSD-2-Clause
i was thinking to something like this the other day: struct ColoredText(int color) { string payload; alias payload this; } with a writeln() like function that check if the args are template instances of ColoredText. or even more versatile: Color!Blue string b1, b2; Color!Red string r1, r2; Color!Green int i1, i2; with a writeln() like function that inspects the UDA or the args.
Nov 23 2018