1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-25 21:39:02 +02:00

245 Commits

Author SHA1 Message Date
Alec Thomas
2a59c2c77e Synthesise meta style-entries on demand.
This includes line highlighting, numbers, etc.

Fixes #211.
2018-12-31 11:33:36 +11:00
Alec Thomas
69c9a262c3 Expose Colour.BrightenOrDarken (useful for #211). 2018-12-31 10:48:45 +11:00
Alec Thomas
881a441774 Don't keep trailing empty tokens when splitting tokens by line.
Fixes #155. Fixes #209.
v0.6.2
2018-12-27 16:20:38 +11:00
Alec Thomas
4eb0355de0 Formatting. 2018-12-27 16:13:37 +11:00
Alec Thomas
3b3f74c6a5 Fix stdin mode in chroma tool.
Fixes #207.
v0.6.1
2018-12-14 10:42:19 +11:00
Alec Thomas
3175fa52d7 Support go modules + VB.Net lexer.
Fixes #201.
2018-12-03 20:38:33 -10:00
Jos512
813e33c8f4 Fix YAML pipe symbol (issue #194) 2018-11-12 20:08:24 +11:00
Alec Thomas
022b6f4fc2 Fix --json.
Fixes #199.
2018-11-12 18:50:00 +11:00
Alec Thomas
fb4c38e204 Fix build (see #190). 2018-11-08 17:16:58 +11:00
Randall C. O'Reilly
a4f179974b move SplitTokensIntoLines into chroma/iterator.go, fixes issue #190 2018-11-08 16:21:45 +11:00
Daniel Eloff
9c3abeae1d Tokens by value (#187)
This results in about a 8% improvement in speed.
2018-11-04 10:22:51 +11:00
Pedro Sland
5a473179cf Improve Go lexer to detect functions (NameFunction) v0.6.0 2018-10-23 06:35:09 -07:00
Thth
01e18834b5 Elixir: add underscore separators for hex, oct, bin 2018-10-13 17:18:43 -04:00
Jos512
c0b13daec9 Added missing 'to' keyword to TradingView lexer 2018-10-05 23:45:09 +10:00
Daniel G. Taylor
0955241525 Add HTTP unit test 2018-10-03 19:40:14 +10:00
Daniel G. Taylor
eafa8e1c69 Properly syntax highlight HTTP body
Currently given an example like:

```http
GET /foo HTTP/1.1
Content-Type: application/json
User-Agent: foo

{"hello": "world"}
```

It will fail to highlight because the content type will get reset when processing the `User-Agent` header. The is particularly problematic because Go maps are randomly ordered and `http.Request` use a map for headers, meaning on some runs you could get highlighting and on others it would silently fail if you are generating the above from an `http.Request`.

This PR fixes it by resetting `isContentType` once we've read the actual content type, which prevents replacing it with later literals.
2018-10-03 19:40:14 +10:00
Jos512
e9d4ea1fe5 Add missing lexers to README
And also more alphabetically.
2018-09-21 22:27:42 +10:00
Jos512
a24ed6d984 List lexers in README in table (#176)
This makes it easier to scan through the line and add new lexers in the future.
2018-09-21 18:01:03 +10:00
Jos512
1ab0293d07 Add test for Bash lexer (#172) 2018-09-19 09:17:08 +10:00
Peter Lamby
c4123fc163 #170 Add lexer for systemd config files (#171)
See: https://www.freedesktop.org/software/systemd/man/systemd.syntax.html#
2018-09-18 19:45:27 +10:00
Felix Knischewski
e36baa268a Add option to prevent surroundign pre tags 2018-09-18 19:44:44 +10:00
Jos512
0ee91688c8 Fixes #168 (error with bash lexer) 2018-09-15 07:53:41 +10:00
Alec Thomas
3575c5f597 Fix line endings in tradingview fixture. 2018-09-15 07:52:42 +10:00
Alec Thomas
d5ca12b82f
Merge pull request #166 from Jos512/tradingview
Add TradingView lexer
2018-09-11 08:49:09 +10:00
Jos512
fccc5bb5f5 First version of TradingView lexer
Treat ( and ) as text in lexer

Added test files and small change of lexer

Fixed 'err' messages in Chroma output

Removed postfix behind numbers

Was originally from C# lexer, but not needed for TradingView

Improved single comment, punctuation, and operator

Simplified text match, improved punctuation and operators

Add slash to punctuation

Added missing named variables

Added proper test data with .expected file

Added TradingView lexer
2018-09-10 20:10:06 +02:00
Alec Thomas
5d7fef2ae6
Merge pull request #157 from kaushalmodi/nim_underscore
Allow standalone _ to be recognized as identifier in Nim
v0.5.0
2018-08-02 13:21:39 +10:00
Alec Thomas
cccad298e0
Merge pull request #158 from kaushalmodi/improve-org-mode-support
Add more Org mode syntax support
2018-08-02 13:21:25 +10:00
Alec Thomas
e6c740a5d9
Merge pull request #161 from kaushalmodi/add-genericunderline-class
Assign .gl class to GenericUnderline
2018-08-02 13:10:17 +10:00
Kaushal Modi
371820dad6 Assign .gl class to GenericUnderline; add CSS rules for the same
'l' in gl is for under(l)ine, as the "gu" class is taken by
GenericSubheading.

- Rules for GenericUnderline are added to all the styles
- Make "Underline" style insert "text-decoration: underline" in CSS.

Fixes https://github.com/alecthomas/chroma/issues/159.
2018-08-01 17:28:52 -04:00
Kaushal Modi
7e453ef68f Add more Org mode syntax support
- Export blocks (#+begin_export foo .. #+end_export)
- Org Special blocks (nested) (#+begin_foo .. #+begin_bar..#+end_bar .. #+end_foo)
- Org DONE state CLOSED datestamp
- Org _underlined text_
2018-08-01 16:49:42 -04:00
Kaushal Modi
a85919fea1 Allow standalone _ to be recognized as identifier in Nim
Fixes https://github.com/alecthomas/chroma/issues/146.
2018-08-01 10:01:18 -04:00
Alec Thomas
3fb10fb85d
Merge pull request #156 from kaushalmodi/add-org-mode
Add Org mode lexer (https://orgmode.org)
2018-08-01 09:30:57 +10:00
Kaushal Modi
e4dff9a08c Add Org mode lexer (https://orgmode.org)
Fixes https://github.com/alecthomas/chroma/issues/40.
2018-07-31 15:06:05 -04:00
James Turnbull
91b12285fd Added Ballerina - https://ballerina.io (#154) 2018-07-23 12:28:37 +10:00
Alec Thomas
0c0b382eca Add .gitconfig to Ini lexer filenames.
Fixes #128.
2018-06-25 20:57:01 +10:00
Alec Thomas
0961f82bc3 Fix nearest colour matching.
This was caused by precision loss due to using uint8. The cast to int64
was occurring in the wrong location.

Fixes #145.
2018-06-25 20:48:31 +10:00
Alec Thomas
1da70b26df
Merge pull request #152 from pzl/monkeyc
Add MonkeyC & Jungle Lexers
2018-06-25 20:05:21 +10:00
Alec Thomas
e80511cc8c Document LineNumbersInTable(). 2018-06-25 20:04:04 +10:00
pzl
b18849cbf7
add jungle lexer 2018-06-23 08:53:43 -04:00
pzl
8387f77374
add monkeyc lexer 2018-06-23 08:53:29 -04:00
Alec Thomas
1e3d94a832
Merge pull request #151 from pzl/openscad
Add OpenSCAD Lexer
2018-06-23 14:46:21 +10:00
pzl
a2f2f3cf1c
add openscad lexer 2018-06-22 20:00:57 -04:00
Alec Thomas
d7b2ed20a4
Merge pull request #149 from kenshaw/fix-dollar-strings
Fix Dollar-Quoted Strings (postgres + cql)
2018-06-12 12:35:32 +10:00
Kenneth Shaw
95d0a9381b Fix Dollar-Quoted Strings (postgres + cql)
This commit refactors code from the markdown lexer into the chroma
package, and alters the PostgreSQL and CQL lexers to make use of it.

Additionally, an example markdown with the various sublexers is added.
2018-06-12 09:16:18 +07:00
Alec Thomas
307ceefd96
Merge pull request #148 from kenshaw/add-cql-lexer
Add Cassandra CQL lexer
2018-06-09 10:50:26 +10:00
Kenneth Shaw
2eb5cacd01 Add Cassandra CQL lexer
Adds a lexer (based off PostgreSQL) for Cassandra CQL support.
2018-06-09 07:42:49 +07:00
Jonathan Poelen
1b755a90bd c++: fix highlighting of the 'class' keyword
C++ highlighting ignores class keyword if it is not followed by a space

template<class T> struct X; // ok
template<class> struct X; // fails
template<class...> struct X; // fails
X<class::Y> x; // fails
2018-05-15 10:27:52 +10:00
Benjamin Congdon
7f4d42f585 Add EnsureNL to Rust lexer; Add test data for Rust lexer 2018-05-13 00:44:43 +10:00
Alec Thomas
222a1f0fc8 Don't require --html to write styles.
See #139.
2018-04-21 09:30:33 +10:00
German Lashevich
33cc533118 New styles from solarized styles family 2018-04-21 09:03:12 +10:00