Skip to content

Commit

Permalink
Use two-face for more syntax definitions
Browse files Browse the repository at this point in the history
Fixes #50, fixes #64.
  • Loading branch information
matze committed Jan 31, 2025
1 parent 8119154 commit 3b71a8e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### Changed

- Use the [two-face](https://docs.rs/two-face) crate for an extended syntax
list.


## 2.7.1

Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ url = "2"
zstd = "0.13"
parking_lot = "0.12.1"
http = "1.1.0"
two-face = { version = "0.4.2", default-features = false, features = ["syntect-fancy"] }

[dev-dependencies]
reqwest = { version = "0.12", default-features = false, features = ["cookies", "json"] }
Expand Down
Binary file removed assets/newlines.packdump
Binary file not shown.
3 changes: 1 addition & 2 deletions src/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ pub static DATA: LazyLock<Data> = LazyLock::new(|| {
let style = Hashed::new("style", "css", include_str!("themes/style.css"));
let index = Hashed::new("index", "js", include_str!("javascript/index.js"));
let paste = Hashed::new("paste", "js", include_str!("javascript/paste.js"));
let syntax_set: SyntaxSet =
syntect::dumps::from_binary(include_bytes!("../assets/newlines.packdump"));
let syntax_set = two_face::syntax::extra_newlines();
let mut syntaxes = syntax_set.syntaxes().to_vec();
syntaxes.sort_by(|a, b| a.name.partial_cmp(&b.name).unwrap_or(Ordering::Less));

Expand Down

0 comments on commit 3b71a8e

Please # to comment.