dunovank / jupyter-themes

Custom Jupyter Notebook Themes
MIT License
9.76k stars 1.06k forks source link

fix user themes support #351

Closed kokostek closed 3 years ago

kokostek commented 5 years ago

According to stylefx.style_layout logic, there is user themes support (although, I didn't found it in docs).

    if (os.path.isdir(styles_dir_user) and
            '{}.less'.format(theme) in os.listdir(styles_dir_user)):
        theme_relpath = os.path.relpath(
            os.path.join(styles_dir_user, theme), package_dir)
    else:
        theme_relpath = os.path.relpath(
            os.path.join(styles_dir, theme), package_dir)

But get_themes() function does not list user themes, and "Didn't recognize theme name" error message is shown. This pull request solves it by adding user's ~/.jupyter-themes/styles/*.less files to get_themes() listing.