atomcorp / themes

Themes for Windows Terminal
https://windowsterminalthemes.dev/
Other
1.37k stars 77 forks source link

Suggestion #8

Closed jos3s closed 3 years ago

jos3s commented 4 years ago

It would be interesting if in the themes added directly from this repository a small message was added in the theme view, with the name of the person who added that theme

atomcorp commented 4 years ago

Hey! Yeah I think something like this would be a good idea, I'd like to find a way to credit the creators of the themes and/or anyone who ports them over.

The credits to most of these themes though live in an unhelpful txt format on the repo this site uses...

Savvasun commented 4 years ago

Should the names of the creators be in a separate tab? Or should we just stick it in there?

Savvasun commented 4 years ago

I would be glad to hear if anybody wants to or implemented this feature. Meanwhile, I am working on my own way of doing this on my fork of the repo.

atomcorp commented 4 years ago

Hey @Savvasun thanks for taking an interest!

I don't know if I have much time this week to look into it, but I had made a bit of a start which you may find useful. It's on a branch I just uploaded called credit. I was just messing round trying to extract the authors and themes from the readme in the iterm2 repo. The problems I saw is who the author is can be messy, and sometimes other people need crediting for various reasons. It's not ver neat.

I would like the theme objects to have a metadata property that hosts info like creator, porter, dark/light etc.

I would also quite like the credits to live in their own json file, and then maybe get the owner of the iterm2 repo to adopt it so it could be consumed more easily here and elsewhere 🤷‍♀️

Anyway, just my thoughts. Thanks again for your effort and have fun!

Savvasun commented 4 years ago

Hello @atomcorp,

Just so you know, all my work on this is on a branch called develop on my fork of the repo.

The problems I saw is who the author is can be messy, and sometimes other people need crediting for various reasons. It's not very neat.

I am currently working on a small program in Python that can extract info with the basic syntax. I have encountered issues with accuracy, but I have many ideas on how to fix them, so that's not an issue.

I would like the theme objects to have a metadata property that hosts info like creator, porter, dark/light, etc.

I'm not sure how to do that now, but I feel it can be implemented.

I would also quite like the credits to live in their own json file, and then maybe get the owner of the iterm2 repo to adopt it so it could be consumed more easily here and elsewhere 🤷‍♀️

My system currently just ports the info into a simple .txt file, which I think can also be accessed easily by the languages used in this repo.

If you want to look at my work, I am going to be mentioning some of my commits in this issue.

Here is a small example of the text file my code has extracted:

Afterglow:[yabatadesign](https://github.com/YabataDesign/afterglow-itermcolors)

Broadcast:[vinkla](https://github.com/vinkla/broadcast-theme)

Arthur,:[baskerville](https://github.com/baskerville/iTerm-2-Color-Themes)

Belafonte:[idleberg](https://github.com/idleberg)

3024:[0x3024](https://github.com/0x3024)

Argonaut:[effkay](https://github.com/effkay/iTerm-argonaut)

Espresso:[jurgemaister](https://github.com/jurgemaister/Espresso-Libre)

Hardcore:[hardcore](https://github.com/hardcore/iTerm-colors)

It's laggy, sure, but it's a start.

Savvasun commented 4 years ago

I have converted the output to .json instead of .txt.

Here is an example:

{
    "Credits": [
        {
            "Name": "[ashfinal](https://github.com/ashfinal/vim-colors-violet).",
            "Theme": "Violet"
        },
        {
            "Name": "[brettstil](https://github.com/brettstil/)",
            "Theme": "synthwave"
        },
        {
            "Name": "[vitalymak](https://github.com/vitalymak/iTerm2-Color-Schemes).",
            "Theme": "Monokai Vivid"
        },
Savvasun commented 4 years ago

Unfortunately, when trying to copy part of @atomcorp's code, the request() part just can't see the file no matter what I do. I can simply use my own code, but it is much less efficient than the JavaScript. I'm thinking of using the same algorithm in my own code. It may be easier.

Savvasun commented 4 years ago

Update!

I have shortened my Python script, but RegEx doesn't seem to work, and multi-word theme names aren't fully supported. I couldn't work on this before as I was busy.

Of course, the lack of RegEx made the algorithm a bit longer, but I feel it achieves the same output as my code.

I also added metadata about whether the theme is dark or not, the metadata about who ported and made the theme is all in the note part of the object.

Here is an example of the new code:

        {
            "dark": false,
            "name": "3024 Day",
            "note": "The 3024 Day and 3024 Night themes were created by [0x3024](https://github.com/0x3024)"
        },
        {
            "dark": true,
            "name": "3024 Night",
            "note": "The 3024 Day and 3024 Night themes were created by [0x3024](https://github.com/0x3024)"
        },
        {
            "dark": true,
            "name": "AdventureTime",
            "note": "Not Found"
        }
Savvasun commented 4 years ago

Update!

I was finally able to implement RegEx! The code is much more efficient now and works perfectly. I am thinking of opening a pull request to actually start implementing the feature.

atomcorp commented 4 years ago

Hay Savvasun, thanks for all your enthusiasm and hard work! I'd really like to accept your contribution, but I'd like to just try and focus things.

The app is pretty automated currently, I have a NodeJS server running a script every day which pulls all the Windows Terminal themes from the iterm2-themes repo and combines it with a JSON of themes people have contributed in this repo. It would be nice if the credits could coexist with this process, which means the credits would have to support the external repo and this one. I don't think it's possible to reliably automate gathering the credits from item2-themes, due to how it holds them, but manually scraping them occasionally is better than nothing.

In practice how I think this should work is in the file server/get-themes.js, when it gets the latest theme files, it checks each theme against a credits JSON file, and assigns any relevant credits as a property. It sort of does this already to check whether a theme is dark or light, for example. The file should probably live in the same place as app/src/custom-colour-schemes.json.

So I think what I would be really interested in accepting is one or more of the following:

@Savvasun it sounds to me like you've done the first one, creating the JSON of credits, so maybe focus a pull request on that first. I don't think I can accept things that need Python, I don't know much about it and I'd like the project to be self-contained with a simple yarn / npm install. But if you can translate what you did into JS maybe that could be another pull request. Also appreciate it's a Git thing, but it's quite hard to see what you added in the pull request as is, so maybe start a fresh branch?!

But thanks again for putting some much time and effort into the project, it's really cool! Let me know if you need anymore info!

atomcorp commented 3 years ago

Got around to this finally. Credits should be viewable for themes added here, or scraped from iterm2 repo