-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we color boxes differently? #45
Comments
I really agree and would like to, but wasn't confident enough to come up with a color scheme myself. But it will be easy to add it, if someone can find some good colors. (prototype is already in the css file, we just need the colors: |
List of custom directives:
https://github.com/coderefinery/sphinx-lesson/blob/master/sphinx_lesson/directives.py#L62
(one could also add extra classes here, not sure what happens when
they clash...)
Where to adjust colors:
https://github.com/coderefinery/sphinx-lesson/blob/master/sphinx_lesson/_static/sphinx_lesson.css
(copy instructor note at bottom)
|
Here is adobe's gadget to pick balanced colors: https://color.adobe.com/create/color-wheel you can even extract a color theme from images (screenshots?) |
See also ColorBrewer: https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3 |
For this, my general thought is:
|
I'm playing around a bit with this while preparing a lesson. I'm also adding some directives which might be generally useful. I'll keep you posted and maybe I can contribute a PR with these changes. At the moment, |
Hm, good to know.
I just tried pydata-sphinx-theme, and it seems the main problem is the
top-bar is too wid. Do you see other problems?
One thing someone could do is only enable the extension
`sphinx_lesson.directives` and/or `sphinx_lesson.md_transforms`,
instead of `sphinx_lesson`. This won't bring in some of the other
optional formatting stuff, which should (theoretically) increase
compatibility more. But it should let the directives be used in other
projects. I guess there are likely some other poblems to be resolved
in that, though...
Also, the sphinx_rtd_theme_ext_color_contrast is active by default in
the conf.py file. This could very well cause some other themes to
break a lot (but not, it seems to me, the pydata theme).
(the above is for reference, if someone is ever checking for theme
compatibility goals)
|
I just found some old uncommitted test I did, where I had "challenge"
and "solution" derive from "important". If you've already got a
better solution, this can be closed without using it.
The previous carpentries theme had a lot of directives, many of which
we didn't use. When re-designing things, we should think about what
they did, how it is or isn't useful, and how we want to be different.
I haven't done any of this yet, I would be inclined to accept anything
well thought out. Is a discussion where we invite a broader group of
people useful?
|
I would like to limit the number of directives to what "we" need. To not suffer from YAGNI and carrying the legacy backwards compatibility backpack. But a broader discussion on this is useful. |
By the way, when picking colors, I also run it through some web accessibility checker to make sure the colors are OK (AA level). I think this is what I used before: https://wave.webaim.org/ |
I am also adapting this for my new lesson. I think we should:
|
I agree. And I think now we have enough different use cases that we can think about this. Can everyone interested give your thoughts on what principles to use, and what directives you suggest? Built-in directives (ReST/Sphinx) include:
At reast sphinx_rtd_theme has four default colors, but I think I have seen a similar system in other themes but it is my no means guaranteed. I think the more compatibility we keep with other themes, the better (even if it doesn't work yet). Perhaps an easy way to do this is to try to inherit from these roles, rather than define our own new colors, as much as possible:
So, please comment! |
And for reference carpentries blocks:
|
For our (ENCCS) purposes we've added (see here https://github.com/ENCCS/cmake-workshop/blob/main/content/custom.py):
|
|
Here is my proposal: We have three base colors (blue, green, yellow, red). green/red is bad for color preception purposes, also "red" seems rather extreme and thus I don't use it often. Blue: admonition (general class), most everything by default gets this.
Green: "Take an action", derived from "important". This is everything which a person should do. This includes "Exercise" and "Homework".
Yellow: "Important". Important things to remember. No new directives here,
Red: "Danger", nothing new here
Grey: "Not important, don't read" (as we have now)
Primarily we distinguish between the types of boxes by the emojis, which could be improved. As for general extendability, anything can be done with a basic admonition directive. For example, prerequisites can be (as defined by sphinx-lesson):
Or (using nothing but base ReST):
One difference in regular ReST is that "admonition" accepts a title, but other directives don't. I made all of our custom directives accept a title, but if it's not given, then it has some default one (usually the same as the directive). I think this is a useful default, but may have some issues with confusion because it's non-standard! |
@bast re: callout: "callout" was just from carpentries template when I copied everything. I guess we should leave some aliases (even if not documented) for purposes of conversion. I think they have a different philosophy where learners don't really see things and almost everything is type-along by default, so the concept of exercise or type-along isn't so relevant to them, thus the difficulty in adapting their default to us. Perhaps I should check again to see what they have... |
- Standardize and color directives as described in #45 - Give various emojis to directives, but not to every one. - Allow directive content to be empty - This requires non-trivial (but not too difficult) changes, and may introduce some maintenance burden. It may also cause some incompatility with other themes, but probably not much more than we already get by our particular styling. - Improve documentation - List all directives, how they work, and recommended uses. - Have a gallery of all directives - Do not remove carpentries-compatibility directives (and do list them). - Review: - Read #45, and compare these results to that. - Is this a good implementation? Good directive names? - Decide if there is anything to remove or add. - Is the "empty content" a good idea? - Are the colors good? (can be improved late) - Future - Change the sample lesson template to use this.
Now: "challenge" and "discussion" and "callout" and ... are all blue.
The text was updated successfully, but these errors were encountered: