Exemple #1
0
func Highlight(data []byte, inputfilter string, outputfilter string) (string, error) {
	ret, err := processor.Highlight(inputfilter, outputfilter, data)
	if err != nil {
		return "", err
	}
	return ret, nil
}
Exemple #2
0
// Return a string rendering the given file using the outputfilter and running the inputfilter as a lexer.
func HighlightFile(filename string, inputfilter string, outputfilter string) (string, error) {
	data, err := ioutil.ReadFile(filename)
	if err != nil {
		return "", err
	}
	ret, err := processor.Highlight(inputfilter, outputfilter, data)
	if err != nil {
		return "", err
	}
	return ret, nil
}