Skip to content
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

Adjust the rustdoc highlighting colour scheme #12648

Closed
huonw opened this issue Mar 2, 2014 · 12 comments · Fixed by #12649
Closed

Adjust the rustdoc highlighting colour scheme #12648

huonw opened this issue Mar 2, 2014 · 12 comments · Fixed by #12649
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Mar 2, 2014

It's currently very bright and distracting (IMO).

(Sorry @alexcrichton :( )

Current scheme, for future triage/comparison purposes:

such-rainbow

@alexcrichton
Copy link
Member

I think I should reconsider my career in graphic design.

@adrientetar
Copy link
Contributor

I'm looking at this.

@huonw
Copy link
Member Author

huonw commented Mar 2, 2014

(The relevant file is src/librustdoc/html/static/main.css, if you're lost. :) )

@adrientetar
Copy link
Contributor

BTW I was wondering, why not just use <ol><li> for src line numbering?
Probably more optimized/idiomatic in the browser.

@adrientetar
Copy link
Contributor

Also, it's pretty much impossible to have consistency between rustdoc and the old codemirror (tutorial) since both parsers behave very differently.
@alexcrichton, would it be possible to pass the standalone documentation through rustdoc?

@huonw
Copy link
Member Author

huonw commented Mar 2, 2014

BTW I was wondering, why not just use

  1. for src line numbering?
    Probably more optimized/idiomatic in the browser.

Doesn't this mean every line is a new <pre> tag? Also, it possibly screws with copy-paste and making the formatting consistent.

This bug is specifically about the colour scheme of rustdoc since it's so wild.

Also, #11392 about using rustdoc for everything.

@eddyb
Copy link
Member

eddyb commented Mar 2, 2014

My preference for the highlighting scheme is bold for keywords, green for macros, red for strings (the current color is fine), gray for comments (would be nice if code within comments were highlighted).
I'd also like to hear more suggestions before we change it.

@huonw
Copy link
Member Author

huonw commented Mar 2, 2014

Something I hacked up a few days ago:

n3gg8yb

(The macro colour wasn't "optimised" at all.)

@adrientetar
Copy link
Contributor

Doesn't this mean every line is a new <pre> tag?

No, it would look like this:

<pre class="code">
  <ol>
    <li class="L1"></li>
    <li class="L2"></li>
    <li class="L3"></li>
    ...
  </ol>
</pre>

I think it would be better to use that since that's the browser native numberings.

Also, it possibly screws with copy-paste and making the formatting consistent.

No it doesn't. The identifier of a list aren't inlined with the content. Here is an example.

@huonw
Copy link
Member Author

huonw commented Mar 2, 2014

Oh, awesome. It does seem like a good idea, if you can get that to work.

@adrientetar
Copy link
Contributor

Another note: current rustdoc parsing could be improved, i.e. the "ident" class corresponds to variable names, function names, paths, parameters... could be more split if you ask me.

@huonw
Copy link
Member Author

huonw commented Mar 2, 2014

The highlighting is performed by just by the token types the lexer (with a little bit of extra logic for attributes, macros and $ non-terminals in macros) and so does not have that information.

@bors bors closed this as completed in a15448c Mar 4, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
…=flodiebold

fix: Report proc macro errors in expressions correctly as well

They didn't have a krate before, resulting in the generic "proc macro not found" error.

Also improve error messages a bit more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants