[][src]Trait dialect::Highlight

pub trait Highlight {
    fn highlight<'input>(
        &self,
        input: &'input str
    ) -> Vec<HighlightedSpan<'input>>; }

This trait is to be implemented by any type that syntax highlights source code for a particular language. This is done by taking in a string slice and outputting a vector of HighlightedSpans.

Required methods

fn highlight<'input>(&self, input: &'input str) -> Vec<HighlightedSpan<'input>>

Ensure that all input text is also contained in the text fields of the outputted HighlightedSpans – in other words, this function must be lossless.

Loading content...

Implementors

Loading content...