Code Monkey home page Code Monkey logo

Comments (8)

jtzeng avatar jtzeng commented on June 7, 2024

So there are two solutions I can think of:

a) Print each part of the output in its own line.
b) Add even more information to the output (e.g. fetch more data), so it will never fit one line on anybody's terminal and look like a "mistake".

Which is preferable?

from ansiweather.

BurntSushi avatar BurntSushi commented on June 7, 2024

I think the fact that the location can be of variable width makes it difficult to guarantee 80 columns.

However, I can think of one more solution that might help: add options to disable parts of the output. e.g.,

pressure = false

would make it so pressure isn't displayed.

from ansiweather.

jtzeng avatar jtzeng commented on June 7, 2024

That's a good idea @BurntSushi.

In my Python port of ansiweather, https://github.com/wktr/pyweather, I just removed the default background highlighting and split the output to use multiple lines. I personally favor how it looks. What do you think? I think it is a suitable default, as it is fairly concise in my opinion.

screen shot 2013-10-24 at 10 30 07 am

from ansiweather.

BurntSushi avatar BurntSushi commented on June 7, 2024

@wktr I think it looks nice, although I'm not particularly fussy about it. Just offering up other ideas. :-)

(The other way to go is to make the entire output configurable via a simple template or something. In Python, I'd reach for str.format.)

from ansiweather.

fcambus avatar fcambus commented on June 7, 2024

Text labels are now customizable in the configuration file. This solve this kind of issues, at least partially.

Adding options to disable parts of the output could be a nice idea as well. Not sure it's really needed though, as I would prefer keeping the logic as simple as possible :)

from ansiweather.

iandol avatar iandol commented on June 7, 2024

@fcambus there is a rogue leading space in the output of ansiweather (there is a space in your echo output line), which can only make overflow more likely to happen for no obvious gain...

from ansiweather.

fcambus avatar fcambus commented on June 7, 2024

@iandol It's a feature :-) There is a leading and a trailing space, the output looks better that way.

from ansiweather.

bakoenig avatar bakoenig commented on June 7, 2024

Could you leave a pointer as to how this new config solves this issue? How do I add "newline" in the delimiter of .ansiweatherrc?

EDIT: Aha, found it. Change "dashes" to "\n".

from ansiweather.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.