Skip to content

Add previews of all themes #339

Open

Description

@aidalgol

Could we add preview screenshots of the themes similar to how the Helix editor provides preview for its themes?

Activity

  1. fdncred commented on Jan 10, 2023

    @fdncred
    Contributor

    Sure. Go for it. It would be cool to have a readme in that folder that has screenshots of all the themes that have been provided.

  2. aidalgol commented on Jan 11, 2023

    @aidalgol
    Author

    What should I include in the screenshots to show the various theme colours? Maybe just the same ls command example on the Nushell website?
    nushell screenshot

  3. fdncred commented on Jan 11, 2023

    @fdncred
    Contributor

    I think the key is to have something that shows off the theme best. I'm fine with what you've suggested for now. However, it would be nice to have a script in the repo that generates this readme. If there was a script, it should be pretty easy to change whatever the output is.

  4. aidalgol commented on Jan 12, 2023

    @aidalgol
    Author

    I'm going to try figuring out how asciinema does this for video to see whether that would be feasible for automating this.

  5. amtoine commented on Jan 12, 2023

    @amtoine
    Member

    I'm going to try figuring out how asciinema does this for video to see whether that would be feasible for automating this.

    you could also probably automate screenshot taking with a script which would, for each theme available in themes/themes/, do the following

    • source the theme
    • run some command to have an overview of the color palette
    • take a screenshot
    • save it under the right path and with the right name

    and finally update the README to preview all the themes 😋

  6. aidalgol commented on Jan 13, 2023

    @aidalgol
    Author

    That would work, but it seems less reliable. Especially as I am on a tabbed window-manager.

  7. amtoine commented on Jan 13, 2023

    @amtoine
    Member

    That would work, but it seems less reliable. Especially as I am on a tabbed window-manager.

    mm 🤔
    you should be able to make a screenshot of a single window, or even of a particular portion of the screen 😋

  8. fdncred commented on Jan 14, 2023

    @fdncred
    Contributor

    Another potential idea is to create "screenshots" without images and just create a markdown page with the appropriate colors and fake image. Or maybe an html page? Not sure exactly.

  9. amtoine commented on Jan 14, 2023

    @amtoine
    Member

    Another potential idea is to create "screenshots" without images and just create a markdown page with the appropriate colors and fake image. Or maybe an html page? Not sure exactly.

    that could be great 😮
    much lighter than raw images 👍

    asciinema has the benefits or being light-weight, i.e. text-based, and nice to look at in a little video format 😌

  10. aidalgol commented on Feb 4, 2023

    @aidalgol
    Author

    Another potential idea is to create "screenshots" without images and just create a markdown page with the appropriate colors and fake image. Or maybe an html page? Not sure exactly.

    Looks like GitHub Flavored Markdown (GFM) filters out any colour styling in raw HTML, so it seems we would have to build a website to render themes using HTML and CSS.

    Since mentioning wanting to look into asciinema, I have found termshot, which looks like it does exactly what I wanted.

  11. aidalgol commented on Feb 4, 2023

    @aidalgol
    Author
  12. aidalgol commented on Jan 13, 2025

    @aidalgol
    Author

    The blocking issue in termshot has been fixed.

    @fdncred I see you have since added screenshots to the repo. What command did you use to produce the output shown there?

  13. fdncred commented on Jan 13, 2025

    @fdncred
    Contributor

    IIRC, @NotTheDr01ds reworked the script but there's a preview script or two under the themes folder. I think this is it. We've also been considering removing all the previews and replacing them with svg files for a smaller repo.

  14. NotTheDr01ds commented on Jan 13, 2025

    @NotTheDr01ds
    Contributor

    Yes, if I can find the time and motivation to finish it up, there's just a bit more to do on to svg (IIRC) to get it to the point where this script could be much "easier" to run. Right now, I think it's pretty system-dependent, unfortunately. And I probably broke @fdncred's method when adding mine.

  15. Kissaki commented on Apr 19, 2025

    @Kissaki
    Contributor

    Is the work on the svg generating open (visible somewhere) or closed off?

    I saw it mentioned in #970 too, but also without any references. @NotTheDr01ds is there something you could be supported with? The "finishing touches" for it to become more system neutral or "easier to run" you mentioned?

  16. fdncred commented on Apr 19, 2025

    @fdncred
    Contributor

    This is the last version I have. I have it in a folder called to-svg and you'll need to rename it to mod.nu
    mod.txt

  17. added a commit that references this issue on Apr 19, 2025
  18. Kissaki commented on May 16, 2026

    @Kissaki
    Contributor

    I used the linked mod.txt as a basis and generated svg for all themes, and a Markdown and html file for previewing them in one file/view.

    https://github.com/Kissaki/nu_scripts/blob/themes-svg/themes/theme-previews.md

    (There's a html file next to it, those don't render on GitHub, but in a local checkout a flex layout is much denser.)


    Looks like at least reverse handling is still missing. (Image with svg above and live Terminal below.)

    Image

    And if I don't load a theme at all, seems like my color doesn't map correctly. (Image with svg above and live Terminal below.)

    Image

    My question would be, is the generated svg screenshots still a goal, and a viable goal? What is the minimum coverage and verification where we would make the switch from png to generated svg?

    I assume once the conversion works well, the colors and other terminal styles are stable so there's no risk of stuff becoming wrong, gaps, or otherwise a lack of maintainability and verifiability?

    I could

    1. Handle attr_reverse
    2. Trim whitespace surrounding svg visual content
    3. Investigate why my default/current theme color seems to not match
    4. Explore verifiability or check some more individual themes manually
    5. Explore whether the svg should not have a viewBox attribute, and what a good font size/scaling is (so it looks similar to live)

    I just don't want to invest a ton [more] if we never make the switch anyway.

    Also, maybe there should be a separate issue for the theme svg concern? Currently, this ticket and #970 both concern themselves with it, but the original issue is a different concern, just possibly resolved/improved through or with a switch to svg.

  19. fdncred commented on Jun 1, 2026

    @fdncred
    Contributor

    I'd like to have svg previews but we'd also have to figure out how to overwrite the repo history to remove the png files to shrink the repo size. The svgs would also need to be very small without clutter not to mention, the colors need to be right.

  20. Bahex commented on Jun 1, 2026

    @Bahex
    Member

    I wonder if we can do something like:

    • a single svg file where all elements have classes
    • all themes are just css files that can be used with the svg file
    • we have a script that produces such a css file from a theme/color_config
  21. fdncred commented on Jun 1, 2026

    @fdncred
    Contributor

    @NotTheDr01ds had a nushell to svg writer 95% done a year or so ago, iirc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions