Documentation
¶
Overview ¶
Package internal contains common API functions and structures shared between lexer packages.
Index ¶
- Variables
- func Analyse(text string) zdpgo_pygments.Lexer
- func Get(name string) zdpgo_pygments.Lexer
- func Match(filename string) zdpgo_pygments.Lexer
- func MatchMimeType(mimeType string) zdpgo_pygments.Lexer
- func Names(withAliases bool) []string
- func PlaintextRules() zdpgo_pygments.Rules
- func Register(lexer zdpgo_pygments.Lexer) zdpgo_pygments.Lexer
Constants ¶
This section is empty.
Variables ¶
View Source
var Fallback zdpgo_pygments.Lexer = zdpgo_pygments.MustNewLazyLexer(&zdpgo_pygments.Config{ Name: "fallback", Filenames: []string{"*"}, }, PlaintextRules)
Fallback lexer if no other is found.
View Source
var Registry = struct { Lexers zdpgo_pygments.Lexers byName map[string]zdpgo_pygments.Lexer byAlias map[string]zdpgo_pygments.Lexer }{ // contains filtered or unexported fields }
Registry of Lexers.
Functions ¶
func Analyse ¶
func Analyse(text string) zdpgo_pygments.Lexer
Analyse text content and return the "best" lexer..
func Match ¶
func Match(filename string) zdpgo_pygments.Lexer
Match returns the first lexer matching filename.
func MatchMimeType ¶
func MatchMimeType(mimeType string) zdpgo_pygments.Lexer
MatchMimeType attempts to find a lexer for the given MIME type.
func PlaintextRules ¶
func PlaintextRules() zdpgo_pygments.Rules
PlaintextRules is used for the fallback lexer as well as the explicit plaintext lexer.
func Register ¶
func Register(lexer zdpgo_pygments.Lexer) zdpgo_pygments.Lexer
Register a Lexer with the global registry.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.