spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.26k stars 1.61k forks source link

Support 'theme files' #3768

Open nbara opened 7 years ago

nbara commented 7 years ago

Hi all,

This is more of a feature request than bug report.

Recently I've been looking at the interesting base16 project, which already supports various IDEs and software, and was thinking I could port these themes to Spyder.

However the way Spyder handles color schemes is quite inconvenient. If I understand correctly all themes are store in a subsection of spyder.ini? Also, while the interface created by @goanpeca (https://github.com/spyder-ide/spyder/pull/2861) in Spyder 3 is great, when creating many themes it is usually faster to edit a text file rather than the current gui-based method.

I wonder if it wouldn't be more practical to have single theme files instead, which would be stored in a given themes folder. Spyder could scan the contents of this folder on startup. This of course would be perfectly compatible with the current GUI method, but would have the benefit of making importing 3rd party themes very easy.

(PS: you can visualise the many base16 color schemes here: http://chriskempson.github.io/base16/)

goanpeca commented 7 years ago

@nbara thanks for the feedback. We do have plans to add import and export functionality to theme coloring, it is just not high on the priority list.

:-)

ccordoba12 commented 7 years ago

I wonder if it wouldn't be more practical to have single theme files instead, which would be stored in a given themes folder.

This sounds like a very good idea. If you want to work on this, please go ahead and create PR for it.

Themes could be defined as yaml or json files, and then you would need to add some functionality to convert those files to a single entry in our config system (as it's represented now). That's pretty doable and a very interesting project too :-)

nbara commented 7 years ago

Well, I've never coded for a GUI, but I can give it a try !

ccordoba12 commented 7 years ago

This doesn't require GUI work on your side. Just

  1. Move the theme definitions from spyder/config/main.py to spyder/themes as json files (each theme in a file).
  2. Code a function that reads those files, transforms them to dictionaries and adds them back to spyder/config/main.py.
ccordoba12 commented 7 years ago

Please let us know if you want to work on this, or else I'll assign one of our junior developers to this task :-)

nbara commented 7 years ago

Hi @ccordoba12 I'll try, but I won't be able to get to it before the new year.

ccordoba12 commented 7 years ago

Ok, no problem. We are planning to add this improvement to Spyder 3.2, so if you can send us a pull request around February 2017, that'd be fine :-)

goanpeca commented 7 years ago

@mariacamilaremolinagutierrez this work is related to the theming functionality we want to have so please work on this one :-)

Lets have an open mind already about themes that include both the application look and the editor look.