Skip to content

Commit

Permalink
support sourcemap (#21)
Browse files Browse the repository at this point in the history
* support sourcemap

* support sourcemap

* support sourcemap
  • Loading branch information
ahaoboy authored Oct 30, 2024
1 parent 28e3ca1 commit 5c3f7bc
Show file tree
Hide file tree
Showing 74 changed files with 19,308 additions and 2,546 deletions.
4 changes: 4 additions & 0 deletions ansi2-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub fn to_svg(
dark_bg: Option<String>,
font_size: Option<usize>,
length_adjust: Option<String>,
sourcemap: Option<bool>,
) -> String {
let mode = mode.map(|m| match m {
Mode::Dark => ansi2::css::Mode::Dark,
Expand All @@ -28,6 +29,7 @@ pub fn to_svg(
dark_bg,
font_size,
length_adjust,
sourcemap.unwrap_or(false),
)
}

Expand All @@ -42,6 +44,7 @@ pub fn to_html(
light_bg: Option<String>,
dark_bg: Option<String>,
font_size: Option<usize>,
sourcemap: Option<bool>,
) -> String {
let mode = mode.map(|m| match m {
Mode::Dark => ansi2::css::Mode::Dark,
Expand All @@ -56,6 +59,7 @@ pub fn to_html(
light_bg,
dark_bg,
font_size,
sourcemap.unwrap_or(false),
)
}

Expand Down
3 changes: 3 additions & 0 deletions ansi2/Cargo.toml

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

5 changes: 3 additions & 2 deletions ansi2/src/ans.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BinaryHeap;

use crate::{color::AnsiColor, Canvas, Node};
use crate::{canvas::Canvas, color::AnsiColor, node::Node};
#[derive(Debug, Clone, PartialEq, Eq)]
struct Item {
state: Node,
Expand Down Expand Up @@ -278,8 +278,9 @@ mod test {

use crate::{
ans::{bfs, to_ans},
canvas::Canvas,
color::AnsiColor,
Canvas, Node,
node::Node,
};

use super::min_distance;
Expand Down
Loading

0 comments on commit 5c3f7bc

Please sign in to comment.