Skip to content

Commit

Permalink
feat: Update to match bat 0.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicHorrorDev committed Jan 14, 2025
1 parent 8f4784d commit 0979cae
Show file tree
Hide file tree
Showing 13 changed files with 351 additions and 25 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ For reference here are the sizes associated with their different functions
| function | `two-face` (KiB) | `syntect` (KiB) |
| ---: | ---: | ---: |
| [`acknowledgement::listing()`](https://docs.rs/two-face/latest/two_face/acknowledgement/fn.listing.html) | 10 | - |
| [`syntax::extra_newlines()`](https://docs.rs/two-face/latest/two_face/syntax/fn.extra_newlines.html) (onig) | 859 | 360 |
| ^^ (fancy) | 804 | 360 |
| [`syntax::extra_no_newlines()`](https://docs.rs/two-face/latest/two_face/syntax/fn.extra_no_newlines.html) (onig) | 858 | 359 |
| ^^ (fancy) | 803 | 359 |
| [`syntax::extra_newlines()`](https://docs.rs/two-face/latest/two_face/syntax/fn.extra_newlines.html) (onig) | 920 | 360 |
| ^^ (fancy) | 865 | 360 |
| [`syntax::extra_no_newlines()`](https://docs.rs/two-face/latest/two_face/syntax/fn.extra_no_newlines.html) (onig) | 919 | 359 |
| ^^ (fancy) | 864 | 359 |
| [`theme::extra()`](https://docs.rs/two-face/latest/two_face/theme/index.html) | 45 | 5 |

In short the syntax definitions are the real chonky part, and if you're
Expand All @@ -106,7 +106,7 @@ The full listing of all syntaxes included in [`two_face::syntax`](https://docs.r
| :---: | :---: |
| A | ActionScript†, Ada, Apache Conf, AppleScript†, AsciiDoc, ASP†, ARM Assembly\*, Assembly (x86\_64), AWK |
| B | Bash†, Batch File†, BibTeX† |
| C | C†, C#†, C++†, Cabal, Clojure†, CMake, CoffeeScript, Crontab, Crystal, CSS†, CSV† |
| C | C†, C#†, C++†, Cabal, CFML, Clojure†, CMake, CoffeeScript, Crontab, Crystal, CSS†, CSV† |
| D | D†, Dart, Dockerfile, DotENV, Diff† |
| E | Elixir, Elm, Email, Erlang† |
| F | F#, Fish, Fortran |
Expand All @@ -117,14 +117,15 @@ The full listing of all syntaxes included in [`two_face::syntax`](https://docs.r
| K | Kotlin |
| L | LaTeX†, LaTeX Log†, Lean, LESS, Lisp†, Literate Haskell†, LiveScript\*, LLVM, Lua† |
| M | Makefile†, Manpage, Markdown†, MATLAB†, Mediawiki, MutliMarkdown† |
| N | NAnt Build File†, Nginx, Nim, Ninja, Nix |
| N | NAnt Build File†, Nginx, Nim, Ninja, Nix, NSIS |
| O | Objective-C†, Objective-C++†, OCaml†, OCamllex†, OCamlyacc†, Org Mode |
| P | Pascal†, Perl†, PHP†, PowerShell\*, Protobuf, Puppet, PureScript, Python† |
| Q | QML |
| R | R†, Racket, Rd†, Rego, Regular Expression†, Requirements.txt, reStructuredText†, Robot Framework, Ruby†, Ruby Haml†, Ruby on Rails†, Ruby Slim, Rust† |
| S | Sass\*, Scala†, SCSS, Salt State SLS\*, SML, Solidity, SQL†, Strace, Stylus, Svelte, Swift, SystemVerilog |
| T | Tcl†, Terraform, TeX†, Textile†, Todo.txt, TOML, TypeScript, TypescriptReact |
| V | Varlink, Verilog, VimL, Vue, Vyper |
| W | WGSL |
| X | XML† |
| Y | YAML† |
| Z | Zig |
Expand Down
2 changes: 1 addition & 1 deletion bat
Submodule bat updated 166 files
Binary file modified generated/acknowledgements_full.bin
Binary file not shown.
325 changes: 324 additions & 1 deletion generated/acknowledgements_full.md

Large diffs are not rendered by default.

Binary file modified generated/syntaxes-fancy-newlines.bin
Binary file not shown.
Binary file modified generated/syntaxes-fancy-no-newlines.bin
Binary file not shown.
Binary file modified generated/syntaxes-onig-newlines.bin
Binary file not shown.
Binary file modified generated/syntaxes-onig-no-newlines.bin
Binary file not shown.
Binary file modified generated/themes.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions src/theme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ pub enum EmbeddedThemeName {
VisualStudioDarkPlus,
/// zenburn
///
/// <pre style="background-color:#393939;">
/// <pre style="background-color:#3f3f3f;">
/// <span style="color:#a0cfa1;">#</span><span style="color:#87ae86;"> There currently is no ternary operator like true ? &quot;yes&quot; : &quot;no&quot;
/// </span><span style="color:#a0cfa1;">#</span><span style="color:#87ae86;"> So the following is suggested
/// </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot; </span><span style="color:#ececec;">= </span><span style="color:#fed6af;">if </span><span style="font-weight:bold;color:#87d6d5;">1 </span><span style="color:#ececec;">== </span><span style="font-weight:bold;color:#87d6d5;">0</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#cc9495;">do: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">yes</span><span style="color:#d6d6d680;">&quot;</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#cc9495;">else: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot;
/// </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot; </span><span style="color:#ececec;">= </span><span style="color:#fed6af;">if </span><span style="font-weight:bold;color:#87d6d5;">1 </span><span style="color:#ececec;">== </span><span style="font-weight:bold;color:#87d6d5;">0</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#d58684;">do: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">yes</span><span style="color:#d6d6d680;">&quot;</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#d58684;">else: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot;
/// </span></pre>
Zenburn,
}
Expand Down
8 changes: 4 additions & 4 deletions tests/acknowledgements/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn full_matches_prebuilt() {
let diff = TextDiff::from_lines(&rendered, &prebuilt);
// The only extra lines should be from assets that don't require acknowledgements which still
// gets included in the prebuilt listing and not the embedded
insta::assert_snapshot!(diff.unified_diff(), @r###"
insta::assert_snapshot!(diff.unified_diff(), @r#"
@@ -5,6 +5,22 @@
# Syntaxes
Expand All @@ -35,7 +35,7 @@ fn full_matches_prebuilt() {
<summary>syntaxes/01_Packages/Rust/LICENSE.txt</summary>
````text
@@ -479,6 +495,58 @@
@@ -507,6 +523,58 @@
</details>
<details>
Expand Down Expand Up @@ -94,7 +94,7 @@ fn full_matches_prebuilt() {
<summary>syntaxes/02_Extra/Groff/LICENSE</summary>
````text
@@ -1485,6 +1553,38 @@
@@ -1722,6 +1790,38 @@
</details>
<details>
Expand Down Expand Up @@ -133,5 +133,5 @@ fn full_matches_prebuilt() {
<summary>syntaxes/02_Extra/PureScript/NOTICE</summary>
````text
"###);
"#);
}
16 changes: 9 additions & 7 deletions tests/docs_watchdog/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ fn embedded_asset_sizes() {

assert_eq!(10, kib(TwoFaceAsset::AckFull));

assert_eq!(859, kib(TwoFaceAsset::SynOnigNewlines));
assert_eq!(804, kib(TwoFaceAsset::SynFancyNewlines));
assert_eq!(920, kib(TwoFaceAsset::SynOnigNewlines));
assert_eq!(865, kib(TwoFaceAsset::SynFancyNewlines));

assert_eq!(858, kib(TwoFaceAsset::SynOnigNoNewlines));
assert_eq!(803, kib(TwoFaceAsset::SynFancyNoNewlines));
assert_eq!(919, kib(TwoFaceAsset::SynOnigNoNewlines));
assert_eq!(864, kib(TwoFaceAsset::SynFancyNoNewlines));

assert_eq!(45, kib(TwoFaceAsset::Themes));
}
Expand All @@ -29,7 +29,7 @@ const EXPECTED: &[&str] = &[
// B
"Bourne Again Shell (bash)", "Batch File", "BibTeX",
// C
"C", "C#", "C++", "Cabal", "Clojure", "CMake", "CoffeeScript", "Comma Separated Values",
"C", "C#", "C++", "Cabal", "CFML", "Clojure", "CMake", "CoffeeScript", "Comma Separated Values",
"Crontab", "Crystal", "CSS",
// D
"D", "Dart", "Diff", "Dockerfile", "DotENV",
Expand All @@ -54,7 +54,7 @@ const EXPECTED: &[&str] = &[
// M
"Makefile", "Manpage", "Markdown", "MATLAB", "MediaWiki", "MultiMarkdown",
// N
"NAnt Build File", "nginx", "Nim", "Ninja", "Nix",
"NAnt Build File", "nginx", "Nim", "Ninja", "Nix", "NSIS",
// O
"Objective-C", "Objective-C++", "OCaml", "OCamllex", "OCamlyacc", "orgmode",
// P
Expand All @@ -72,6 +72,8 @@ const EXPECTED: &[&str] = &[
"Tcl", "Terraform", "TeX", "Textile", "Todo.txt", "TOML", "TypeScript", "TypeScriptReact",
// V
"varlink", "Verilog", "VimL", "Vyper",
// W
"WGSL",
// X
"XML",
// Y
Expand All @@ -95,7 +97,7 @@ const EXPECTED: &[&str] = &[
// Misc
"Java Properties", "JavaScript (Rails)", "jsonnet", "Vue Component", "camlp4", "Plain Text",
"R Console", "SQL (Rails)", "Protocol Buffer (TEXT)", "gnuplot", "HTTP Request and Response",
"log", "syslog", "Highlight non-printables",
"log", "syslog", "Highlight non-printables", "Dockerfile (with bash)",
];

/// Some syntax definitions use regex features that aren't supported by `fancy-regex`
Expand Down
8 changes: 4 additions & 4 deletions tests/docs_watchdog/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,12 @@ fn visual_studio_dark_plus() {
fn zenburn() {
insta::assert_snapshot!(
sample_html(EmbeddedThemeName::Zenburn),
@r###"
<pre style="background-color:#393939;">
@r#"
<pre style="background-color:#3f3f3f;">
<span style="color:#a0cfa1;">#</span><span style="color:#87ae86;"> There currently is no ternary operator like true ? &quot;yes&quot; : &quot;no&quot;
</span><span style="color:#a0cfa1;">#</span><span style="color:#87ae86;"> So the following is suggested
</span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot; </span><span style="color:#ececec;">= </span><span style="color:#fed6af;">if </span><span style="font-weight:bold;color:#87d6d5;">1 </span><span style="color:#ececec;">== </span><span style="font-weight:bold;color:#87d6d5;">0</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#cc9495;">do: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">yes</span><span style="color:#d6d6d680;">&quot;</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#cc9495;">else: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot;
</span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot; </span><span style="color:#ececec;">= </span><span style="color:#fed6af;">if </span><span style="font-weight:bold;color:#87d6d5;">1 </span><span style="color:#ececec;">== </span><span style="font-weight:bold;color:#87d6d5;">0</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#d58684;">do: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">yes</span><span style="color:#d6d6d680;">&quot;</span><span style="color:#dedede;">, </span><span style="font-weight:bold;color:#d58684;">else: </span><span style="color:#d6d6d680;">&quot;</span><span style="color:#d68686;">no</span><span style="color:#d6d6d680;">&quot;
</span></pre>
"###
"#
);
}

0 comments on commit 0979cae

Please sign in to comment.