#syntax-highlighting #documentation #rustdoc #class #lexer #classifier #html

nightly rustdoc-highlight

A Rust syntax highlighting library

10 releases

Uses old Rust 2015

0.1.10 Nov 16, 2019
0.1.9 Aug 18, 2019
0.1.7 Feb 1, 2019
0.1.6 Dec 19, 2018
0.1.1 Mar 26, 2018

#2172 in Development tools


Used in cargo-src

Apache-2.0/MIT

20KB
347 lines

rustdoc-highlight

Rustdoc's syntax highlighting in its own crate for ease of use.

Usage

TODO


lib.rs:

Basic syntax highlighting functionality.

This module uses libsyntax's lexer to provide token-based highlighting for the HTML documentation generated by rustdoc.

If you just want to syntax highlighting for a Rust program, then you can use the render_inner_with_highlighting or render_with_highlighting functions. For more advanced use cases (if you want to supply your own css classes or control how the HTML is generated, or even generate something other then HTML), then you should implement the Writer trait and use a Classifier.

Dependencies

~87KB