1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-07-01 00:35:06 +02:00
Commit Graph

14 Commits

Author SHA1 Message Date
5921c52787 Add bool argument to WithClasses, WithLineNumbers etc.
This allows the boolean options to be reconfigured, e.g:

```go
options := getOptions()
options = append(options, html.WithLineNumbers(true))
```

Fixes #301
2019-11-22 10:13:00 +11:00
611a24ccdd embedded font in svg (#292) 2019-10-15 23:38:42 +11:00
22511fb8e4 added svg formatter
basic version without any options. colors and font-styles seem to be ok.
rough support for text background in styles like `murphy` using predrawn
rectangles (svg has no text background attribute).

things to improve:
- svg width attribute (`<svg width=""`)
- linenumbers
- highlighting
- embedded font
- tabwidth option
- margins?
- better position/width calculation (rectangles not correctly drawn on
resize)
2019-09-30 09:43:27 +10:00
da5ac60d8c Add golangci-lint and fix all lint issues. 2018-12-31 22:46:59 +11:00
9c3abeae1d Tokens by value (#187)
This results in about a 8% improvement in speed.
2018-11-04 10:22:51 +11:00
cc0e4a59ab Switch to an Iterator interface.
This is to solve an issue where writers returned by the Formatter
were often stateful, but this fact was not obvious to the API consumer,
and failed in interesting ways.
2017-09-20 22:19:36 +10:00
d80c30ae4e Sort formatters and styles Names(). 2017-09-19 11:31:51 +10:00
431e913333 Update documentation. Include "quick" package. 2017-09-18 13:15:07 +10:00
d12529ae61 HTML formatter + import all Pygments styles. 2017-07-20 00:01:29 -07:00
d852022f8d Move style and formatter API into chroma package. 2017-06-07 19:47:59 +10:00
5749aebe42 Generalise and support 8, 256 and 16m colour terminals. 2017-06-07 19:47:59 +10:00
1f47bd705c Use pointers to tokens + support regex flags in importer. 2017-06-07 19:47:59 +10:00
b30de35ff1 Use a callback to emit tokens.
This is a) faster and b) supports streaming output.
2017-06-07 19:47:59 +10:00
b2fb8edf77 Initial commit! Working! 2017-06-07 19:47:59 +10:00