Skip to content

Color codes in docs are like chaos #37147

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

Closed
GuillaumeGomez opened this issue Oct 13, 2016 · 8 comments
Closed

Color codes in docs are like chaos #37147

GuillaumeGomez opened this issue Oct 13, 2016 · 8 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@GuillaumeGomez
Copy link
Member

A good example is: #37102 (comment)

Keywords should have one color code.
Enums should have another color code.
Structs should have another color code.
...

Color codes are up to debate. I'll start to clean this up soon.

cc @eddyb

@eddyb
Copy link
Member

eddyb commented Oct 13, 2016

What kate does, which works well for me, is bold keywords (real bold, not like that ? in the linked issue),
and colors for things like macros or literals.
You can ignore one kind of information ("channel") to spot the other, easily. This principle can be extended to full HSL (each of hue, saturation and luminance being used for different semantic values).

If only one "channel" is used (e.g. hue), then it's much harder to distinguish between various intents.
That and striking colors should not be used for every other word, it leads to semantic satiation.

Example from kate, with red ? added locally (I really wish bold ? were bolder 😞):
image

@eddyb
Copy link
Member

eddyb commented Oct 13, 2016

cc @rust-lang/docs (also not sure how to ping the style team)

@GuillaumeGomez
Copy link
Member Author

It seems to consider Ok as keyword. :-/

@eddyb
Copy link
Member

eddyb commented Oct 13, 2016

Well, it seems a bit silly:

        <list name="constants">
                <item> true </item>
                <item> false </item>
                <item> Some </item>
                <item> None </item>
                <item> Ok </item>
                <item> Err </item>
                <item> Success </item>
                <item> Failure </item>
                <item> Cons </item>
                <item> Nil </item>
        </list>

Out of those variants only Some, None, Ok and Err remain, and they're not keywords, unlike true and false. It's not exactly been thoroughly updated. However:

<keyword String="constants" attribute="Constant" context="#stay"/>
<itemData name="Constant"     defStyleNum="dsConstant" spellChecking="0"/>

And dsConstant is distinct from dsKeyword, so I can change it in the editor settings, if I want to.

@GuillaumeGomez
Copy link
Member Author

You should! :p

@Mark-Simulacrum
Copy link
Member

@GuillaumeGomez Is this something you still want to pursue? I've marked as T-doc.

@Mark-Simulacrum Mark-Simulacrum added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label May 14, 2017
@GuillaumeGomez
Copy link
Member Author

@Mark-Simulacrum: It's still in discussion actually, so yes. :)

@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 26, 2017
@steveklabnik
Copy link
Member

Closing, as this is not super-actionable as is and many fixes have landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

4 participants