Documentation ¶
Overview ¶
Main controller package for syntax highlighting
Index ¶
- Constants
- func Highlight(inputfilter, outputfilter string, source []byte) (string, error)
- func InputFilters() []string
- func OutputFilters() []string
- func RegisterInputFilter(name string, f HighlightFunc)
- func RegisterOutputFilter(name string, f RenderFunc)
- func RegisterSanitizer(name string, f FilterFunc)
- type FilterFunc
- type HighlightFunc
- type RenderFunc
- type Token
- type TypeMajor
- type TypeMinor
Constants ¶
View Source
const ( MAJOR_RAW TypeMajor = iota MAJOR_COMMENT MAJOR_STRING MAJOR_ERROR MAJOR_GENERIC MAJOR_KEYWORD MAJOR_NAME MAJOR_NUMBER MAJOR_VARIABLE MAJOR_OPERATOR MINOR_RAW TypeMinor = iota MINOR_NAME_TAG MINOR_NAME_ATTRIBUTE )
These are the allowed token types
Variables ¶
This section is empty.
Functions ¶
func Highlight ¶
Run the given input and output filters on the source and return a string of the highlighted input source and nil or, if there is an error, a perhaps empty string and an error.
func RegisterInputFilter ¶
func RegisterInputFilter(name string, f HighlightFunc)
All lexers are required to call this function exactly once.
func RegisterOutputFilter ¶
func RegisterOutputFilter(name string, f RenderFunc)
All output filters are required to call this function exactly once.
func RegisterSanitizer ¶
func RegisterSanitizer(name string, f FilterFunc)
Types ¶
type FilterFunc ¶
type HighlightFunc ¶
type RenderFunc ¶
Click to show internal directories.
Click to hide internal directories.