-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Teach rustdoc to syntax highlight #11393
Labels
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
@brson For syntax highlighting, we could pipe the code snippets to pygments while generating the docs, or we could do the highlighting on the client with something like highlight.js. The former option seems better, and is what I'm currently using for prototyping. |
bors
added a commit
that referenced
this issue
Feb 23, 2014
This adds simple syntax highlighting based off libsyntax's lexer to be sure to stay up to date with rust's grammar. Some of the highlighting is a bit ad-hoc, but it definitely seems to get the job done! This currently doesn't highlight rustdoc-rendered function signatures and structs that are emitted to each page because the colors already signify what's clickable and I think we'd have to figure out a different scheme before colorizing them. This does, however, colorize all code examples and source code. Closes #11393
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Sep 7, 2023
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Sep 7, 2023
[`arithmetic_side_effects`] Fix rust-lang#11393 Fix rust-lang#11393 ``` changelog: [`arithmetic_side_effects`]: Detect division by zero for `Wrapping` and `Saturating` ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We can probably port the js code from doc/lib to Rust. It's really small.
The text was updated successfully, but these errors were encountered: