Giter VIP home page Giter VIP logo

Comments (11)

matchai avatar matchai commented on May 26, 2024 2

If every module is also given a description value, I think it would be pretty easy to print the module and its associated description with some small modifications to print::prompt as it is.

starship on  master is 📦 v0.8.7 via 🦀 v1.36.0
❯ starship explainer

Here is a breakdown of your prompt:
starship    -  Your current working directory
 master    -  The active git branch
📦 v0.8.7   -  The package version of the current directory's project
🦀 v1.36.0  -  The current Rust version

We can add some custom logic in module files to add some complexity to the explainer. For instance, if it's a Rust package rather than a Node.js project, the explainer can say so. To start off, this could certainly be static.

from starship.

AZanellato avatar AZanellato commented on May 26, 2024 2

That makes sense.

One thing is that for modules like git, that can have a lot of symbols attachted to it, the explanation might grow quite a bit and running starship explainer and having print out stuff related to all of the modules at once might be too much.

Maybe having something like starship explain current where it would do that and starship explain module_name where it could list every possibility.

from starship.

chipbuster avatar chipbuster commented on May 26, 2024 2

Well I think the way to handle that would be to only have it explain all the individual symbols at higher verbosity levels, or if you pass in an individual module name (which is a really nice idea, by the way). So if I do starship explainer I would just get a thing telling me this is the git statusline, and if I run starship explainer git or starship explainer -vv I would get an explanation of each symbol.

from starship.

chipbuster avatar chipbuster commented on May 26, 2024 2

Though honestly, let's just start off getting the level-zero explainer command into the source tree, and then we can go wild afterwards :D

from starship.

chipbuster avatar chipbuster commented on May 26, 2024 1

I had originally envisioned adding a little logic to each module so that it could explain why it chose to display what it did...but that seems pretty rough to implement up-front.

What might be a nicer design is to support increasing verbosity flags like ripgrep does, so starship explainer gives you just the static text descriptions, starship explainer -v gives you the custom descriptions generated by each module, and starship explainer -vv might give you logic for why modules aren't being displayed as well.

I think just printing the Features section is going to be a little barebones, but adapting the descriptions in there to the zeroeth verbosity level might work (e.g. what matchai had, but borrowing from the Features section for the description strings)

from starship.

jletey avatar jletey commented on May 26, 2024 1

@AZanellato If you want to work on this, go for it!

from starship.

jletey avatar jletey commented on May 26, 2024

This would be an amazing feature to have! Great thinking @chipbuster!

I'll try to give this a go!

from starship.

matchai avatar matchai commented on May 26, 2024

This may not be a complete substitute to an explainer, but I was planning to eventually have starship generate a starship.toml containing the default configuration if the user didn't have one already made. This would be able to be used as an index.

That said, I definitely think a starship explain command would be great to have!

from starship.

AZanellato avatar AZanellato commented on May 26, 2024

I would be happy to do this if @johnletey does not mind. I was thinking a first quick win would be to simply print the #Features section of the README. What do you guys think?

from starship.

matchai avatar matchai commented on May 26, 2024

That said, feel free to tackle it @AZanellato if @johnletey isn't actively working on it!

from starship.

AZanellato avatar AZanellato commented on May 26, 2024

I will try to have something for next week! 😄

from starship.

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.