Documentation
¶
Overview ¶
Package syntax detects source languages, highlights code, and finds foldable function and class blocks.
Index ¶
Constants ¶
const MaxHighlightLines = 8000
MaxHighlightLines caps the work done for one file. Longer files stay plain.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct {
// Start is the 0-based line that opens the block.
Start int
// End is the 0-based last line of the block, inclusive.
End int
// Kind is "func" or "type".
Kind string
}
Block is a foldable range of source lines.
type Language ¶
type Language struct {
// Name is the chroma lexer name, for example "Go" or "Python".
Name string
// Family groups languages that share a folding strategy: "go", "python",
// "brace", or "" when the language has no folding support.
Family string
}
Language is a detected source language.