discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

HTML commands in echo

E
egburr
Mon, Jan 6, 2020 6:40 PM

Probably depends on the terminal you're on, at least for the color option.
There is some way for a program to determine if the terminal it's
interacting with supports color or not, isn't there?

Scaling might have to be just ignored altogether for command-line.

nophead wrote

What would these do when run from the command line?

On Mon, 6 Jan 2020 at 18:27, Jordan Brown <

openscad@.maileater

>
wrote:

On 1/5/2020 11:02 PM, egburr wrote:

Too bad this:
color("red") echo("This should be red text.");
doesn't work. :)

Or

scale(1.1) echo("Big text");

Probably depends on the terminal you're on, at least for the color option. There is some way for a program to determine if the terminal it's interacting with supports color or not, isn't there? Scaling might have to be just ignored altogether for command-line. nophead wrote > What would these do when run from the command line? > > On Mon, 6 Jan 2020 at 18:27, Jordan Brown &lt; > openscad@.maileater > &gt; > wrote: > >> On 1/5/2020 11:02 PM, egburr wrote: >> >> Too bad this: >> *color("red") echo("This should be red text.");* >> doesn't work. :) >> >> >> Or >> >> scale(1.1) echo("Big text"); >> -- Sent from: http://forum.openscad.org/
E
egburr
Mon, Jan 6, 2020 6:43 PM

What happens on command-line with current "ERROR" and "WARNING" messages that
are currently colored/highlited in the OpenSCAD console? I'm guessing they
come out as just plain uncolored text?

nophead wrote

What would these do when run from the command line?

On Mon, 6 Jan 2020 at 18:27, Jordan Brown <

openscad@.maileater

>
wrote:

On 1/5/2020 11:02 PM, egburr wrote:

Too bad this:
color("red") echo("This should be red text.");
doesn't work. :)

Or

scale(1.1) echo("Big text");

What happens on command-line with current "ERROR" and "WARNING" messages that are currently colored/highlited in the OpenSCAD console? I'm guessing they come out as just plain uncolored text? nophead wrote > What would these do when run from the command line? > > On Mon, 6 Jan 2020 at 18:27, Jordan Brown &lt; > openscad@.maileater > &gt; > wrote: > >> On 1/5/2020 11:02 PM, egburr wrote: >> >> Too bad this: >> *color("red") echo("This should be red text.");* >> doesn't work. :) >> >> >> Or >> >> scale(1.1) echo("Big text"); >> -- Sent from: http://forum.openscad.org/
NH
nop head
Mon, Jan 6, 2020 6:49 PM

Yes they need to be plain text for my usage.

On Mon, 6 Jan 2020 at 18:44, egburr egburr@burr.cc wrote:

What happens on command-line with current "ERROR" and "WARNING" messages
that
are currently colored/highlited in the OpenSCAD console? I'm guessing they
come out as just plain uncolored text?

nophead wrote

What would these do when run from the command line?

On Mon, 6 Jan 2020 at 18:27, Jordan Brown <

openscad@.maileater

>
wrote:

On 1/5/2020 11:02 PM, egburr wrote:

Too bad this:
color("red") echo("This should be red text.");
doesn't work. :)

Or

scale(1.1) echo("Big text");

Yes they need to be plain text for my usage. On Mon, 6 Jan 2020 at 18:44, egburr <egburr@burr.cc> wrote: > What happens on command-line with current "ERROR" and "WARNING" messages > that > are currently colored/highlited in the OpenSCAD console? I'm guessing they > come out as just plain uncolored text? > > > nophead wrote > > What would these do when run from the command line? > > > > On Mon, 6 Jan 2020 at 18:27, Jordan Brown &lt; > > > openscad@.maileater > > > &gt; > > wrote: > > > >> On 1/5/2020 11:02 PM, egburr wrote: > >> > >> Too bad this: > >> *color("red") echo("This should be red text.");* > >> doesn't work. :) > >> > >> > >> Or > >> > >> scale(1.1) echo("Big text"); > >> > > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JB
Jordan Brown
Mon, Jan 6, 2020 10:21 PM

On 1/6/2020 10:30 AM, nop head wrote:

On Mon, 6 Jan 2020 at 18:27, Jordan Brown
<openscad@jordan.maileater.net mailto:openscad@jordan.maileater.net>
wrote:

 On 1/5/2020 11:02 PM, egburr wrote:
 Too bad this:
 *color("red") echo("This should be red text.");*
 doesn't work. :)
 Or

 scale(1.1) echo("Big text");

What would these do when run from the command line?

I guess it was unclear that I was 97% kidding.

Semi-seriously...

You could use ANSI x3.64 escape sequences for color.  Addenda bring in
24-bit color support.  However, I don't see any size support.

That would mess up any postprocessor, but you'd use the same strategy
that was used for (e.g.) ls and its color-coding of file types:  have
OpenSCAD automatically disable colors if stdout isn't a terminal.

Tempting and cute as this scheme might be, I don't think you'd actually
want to have the same operators affecting your console output and your
geometry.  Just because a particular component is scaled or colored
doesn't mean that you want its diagnostic output to be scaled or colored.

On 1/6/2020 10:30 AM, nop head wrote: > On Mon, 6 Jan 2020 at 18:27, Jordan Brown > <openscad@jordan.maileater.net <mailto:openscad@jordan.maileater.net>> > wrote: > > On 1/5/2020 11:02 PM, egburr wrote: >> Too bad this: >> *color("red") echo("This should be red text.");* >> doesn't work. :) > Or > > scale(1.1) echo("Big text"); > > > What would these do when run from the command line? I guess it was unclear that I was 97% kidding. Semi-seriously... You *could* use ANSI x3.64 escape sequences for color.  Addenda bring in 24-bit color support.  However, I don't see any size support. That would mess up any postprocessor, but you'd use the same strategy that was used for (e.g.) ls and its color-coding of file types:  have OpenSCAD automatically disable colors if stdout isn't a terminal. Tempting and cute as this scheme might be, I don't think you'd actually want to have the same operators affecting your console output and your geometry.  Just because a particular component is scaled or colored doesn't mean that you want its diagnostic output to be scaled or colored.
Q
QuackingPlums
Sat, Jan 11, 2020 4:23 PM

I also use some simple HTML formatting in my output window.

I have a rudimentary library that creates documentation for my other
libraries, so that I can quickly remind myself of function/module syntax
without loading up the library source directly.

I don't use colours as much but I do use text formatting - for example:
http://forum.openscad.org/file/t311/Screenshot_2020-01-11_at_16.png

Will this be lost?

--
Sent from: http://forum.openscad.org/

I also use some simple HTML formatting in my output window. I have a rudimentary library that creates documentation for my other libraries, so that I can quickly remind myself of function/module syntax without loading up the library source directly. I don't use colours as much but I do use text formatting - for example: <http://forum.openscad.org/file/t311/Screenshot_2020-01-11_at_16.png> Will this be lost? -- Sent from: http://forum.openscad.org/
R
runsun
Sat, Jan 18, 2020 6:32 PM

This is not a direct answer to your question, but some of my programs has a
switch to output either HTML-encoded text or plain text.

nophead wrote

What would these do when run from the command line?


$  Runsun Pan, PhD $ libs: scadx , doctest , faces ( git ), offline doc ( git ), runscad.py ( 2 , git ), editor of choice: CudaText  ( OpenSCAD lexer ); $ Tips ; $ Snippets

--
Sent from: http://forum.openscad.org/

This is not a direct answer to your question, but some of my programs has a switch to output either HTML-encoded text or plain text. nophead wrote > What would these do when run from the command line? ----- $ Runsun Pan, PhD $ libs: scadx , doctest , faces ( git ), offline doc ( git ), runscad.py ( 2 , git ), editor of choice: CudaText ( OpenSCAD lexer );&nbsp;$ Tips ;&nbsp;$ Snippets -- Sent from: http://forum.openscad.org/
NH
nop head
Sat, Jan 18, 2020 8:18 PM

So perhaps we need a variable to indicate command line mode.

On Sat, 18 Jan 2020, 18:31 runsun, runsun@gmail.com wrote:

This is not a direct answer to your question, but some of my programs has a
switch to output either HTML-encoded text or plain text.

nophead wrote

What would these do when run from the command line?


$  Runsun Pan, PhD $ libs: scadx , doctest , faces ( git ), offline doc (
git ), runscad.py ( 2 , git ), editor of choice: CudaText  ( OpenSCAD lexer
); $ Tips ; $ Snippets

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

So perhaps we need a variable to indicate command line mode. On Sat, 18 Jan 2020, 18:31 runsun, <runsun@gmail.com> wrote: > This is not a direct answer to your question, but some of my programs has a > switch to output either HTML-encoded text or plain text. > > > nophead wrote > > What would these do when run from the command line? > > > > > > ----- > > $ Runsun Pan, PhD $ libs: scadx , doctest , faces ( git ), offline doc ( > git ), runscad.py ( 2 , git ), editor of choice: CudaText ( OpenSCAD lexer > );&nbsp;$ Tips ;&nbsp;$ Snippets > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
K
kitwallace
Tue, Feb 11, 2020 8:37 AM

My use case for "HTML" output is to generate and output SVG  (mainly in
generating nets from solids).  I used to output this with angle brackets but
thanks to the change to interpret such characters as HTML which since they
are not and are all ignored, I've had to change to outputing < etc.

Of course, I would prefer to be able to output the SVG directly to a file
rather than the console :)

--
Sent from: http://forum.openscad.org/

My use case for "HTML" output is to generate and output SVG (mainly in generating nets from solids). I used to output this with angle brackets but thanks to the change to interpret such characters as HTML which since they are not and are all ignored, I've had to change to outputing &lt; etc. Of course, I would prefer to be able to output the SVG directly to a file rather than the console :) -- Sent from: http://forum.openscad.org/