]> git.lizzy.rs Git - rust.git/commit
rustdoc: Add syntax highlighting
authorAlex Crichton <alex@alexcrichton.com>
Thu, 20 Feb 2014 09:14:51 +0000 (01:14 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 23 Feb 2014 08:16:23 +0000 (00:16 -0800)
commitad9e26dab3ae8f5d739e89167338bc97b99905b7
tree69c4ba9a246b85e822b4aeaeb4ebc90e4b633553
parent87e3b5fe7fc5e601f502a82b4bd73da5c07c59f2
rustdoc: Add syntax highlighting

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
src/librustdoc/html/highlight.rs [new file with mode: 0644]
src/librustdoc/html/markdown.rs
src/librustdoc/html/render.rs
src/librustdoc/html/static/main.css
src/librustdoc/lib.rs
src/libstd/fmt/mod.rs
src/libstd/num/mod.rs
src/test/run-make/rustdoc-hidden-line/verify.sh