- Add Objective C language.
- Updated Rust, Svelte, and Python languages.
All thanks to @leandrocp.
- (Bugfix) - Fixed Lua not highlighting correctly.
- Updated languages:
- Elixir
- Erlang
- Gleam
- HEEx
- Lua
- CSS
- HTML
- Javascript
- Python
- Ruby
- SQL
- Added Svelte language.
- Added Vimscript, TSX and JSX languages.
- Update TOML dependency to
0.8
.
- (Bugfix) - Fix Javascript and Typescript highlighting (thanks @leandrop!)
- Updated Haskell grammar.
- (Bugfix, breaking) - The
ThemedHtml
formatter is now feature-gated behindtheme
instead ofhtml
. - (Improvement) - Remove
rayon
andindoc
from build dependencies, replacing them withstd::thread::spawn
andformat!
. This should speed up build times by a few seconds. - (Improvement) - Gate development portions of the build script behind a feature, further improving build times.
- (Improvement) -
Language::from_token
andHighlight::highlight_*
now accept anAsRef<str>
instead of a plain&str
. - (Feature) - Added the
Runtime
variant toLanguage
, which holds anfn() -> &'static HighlightConfiguration
. This makes it possible to use languages not statically known by Inkjet.
- (Bugfix) - Fix missing
cfg
attribute that made compiling without thetheme
feature impossible. - (Bugfix) - Fix typo in inline HTML formatter.
- (Feature) - Added new
plaintext
language. Under the hood, this uses thediff
grammar (small and cheap to load) but doesn't provide any highlighting queries, which makes highlighting with it a no-op. - Tidied up a few docs and added some additional tests.
- (Bugfix) -
highlight_to_writer
no longer erroneously shells out tohighlight_to_fmt
.
- (Bugfix, Breaking) - Due to an error in the test code, highlight configurations were not properly tested prior to this version. The following languages have been removed, as no working queries are available:
- CMake
- Jinja2
- Julia
- Just
- (Thanks again to @leandrop for the detective work. Hopefully I'll be able to re-introduce these languages down the road.)
- Added HEEx, IEx and EEx
- Fix some typos and missing names in
HIGHLIGHT_NAMES
- Fix HCL not being properly included in the languages list
Thank you to @leandrocp for the PRs!
Changes to formatters:
- (Feature) Added the
IoWrapper
newtype, which allows instances ofio::Write
to be treated as an instance offmt::Write
. - (Feature) Added optional
start_*
andfinish_*
methods toFormatter
. These methods are called once before and after highlighting, which is useful for formatters that need (say) to write a header or footer. By default, these methods are a no-op. - (Feature) Added theme-aware HTML formatter. This formatter generates HTML
span
elements with inline styles rather than class names, which is ideal for simpler use cases.- The new
Theme
type is additionally output-agnostic, making it usable in custom formatters for non-web use cases. Theme
s can be loaded from TOML files, or created programmatically.- Currently no themes are included, but I will likely bundle some in the future.
- The new
- (Improvement, Breaking) -
Formatter
now only requires an implementation ofwrite
(which takes an instance offmt::Write
). The*_io
variants now have default implementations that use the aformentionedIoWrapper
.
Changes to the primary highlighting API:
- (Feature) Added new
highlight_raw
method toHighlighter
, which gives direct access to the underlying iterator ofHighlightEvents
. For advanced use only. - (Feature) Added new
highlight_to_fmt
method toHighlighter
, which highlights to an instance offmt::Write
. This is useful for highlighting into an existingString
or more exotic implementors likeOsString
.
Other changes:
- (Bugfix) Corrected some erroneous documentation.
- (Feature) Added new languages:
- WASM (WAT and WAST)
- (Enhancement, Breaking)
HIGHLIGHT_CLASS_NAMES
now separates selectors with spaces rather than dashes. For example,type-builtin
is nowtype builtin
. This makes theming in CSS easier, as you can simply style (say) thekeyword
class and have that automatically apply to everykeyword
variant. (Of course, you can override this by using chained selectors, such as.keyword.function
.)
- (Feature) Added new languages:
- Astro
- Awk
- Bicep
- CMake
- Forth
- GDScript
- Gleam
- INI
- Jinja2
- Julia
- Just
- LaTeX
- YAML
- (Feature) Highlighting queries from the Helix project are now used where possible.
- (Feature) Added the ability to enable and disable certain languages via Cargo features. All languages are enabled by default (using the
all-languages
feature.)
- (Bugfix) Removed a stray debug
println!
from thewrite_io
implementation of the HTML formatter.