-
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
rustdoc does not highlight code blocks in other languages #40301
Comments
I thought this was a rustdoc feature, but now am not so sure. I thought we used highlight.js and so inherited everything it uses. If this is not true, we should decide which is broken: the docs or rustdoc. /cc @rust-lang/tools @rust-lang/docs |
Currently code is highlighted using the actual libsyntax lexer, which in turn is why no other language is supported (we only lex rust!) |
(at least that's what it originally did, unsure if it still does that...) |
No, it's still the case. Should we use highlightjs or any equivalent instead? |
I'd be happy to keep using a custom highlighter - it is nice to have a highlighter written in Rust (I use it rustw for example) and it allows us to be in control and ensure quality highlighting. I suspect it is uncommon for rustdoc to need to highlight non-Rust code. |
Okay, let's change this into a docs bug to fix the book. |
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
…g, r=steveklabnik Remove doc about highlighting code in other languages rust-lang#40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See rust-lang#40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
fixed by #40466 |
The "Documentation" chapter of the Rust book says:
This doesn't work for me. I asked Steve about it on IRC:
The text was updated successfully, but these errors were encountered: