Skip to content

Commit 3795193

Browse files
committed
Use _repr_svg_ in python interface
1 parent a710e20 commit 3795193

File tree

6 files changed

+5
-7
lines changed

6 files changed

+5
-7
lines changed

cgt-py/src/domineering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl PyDomineering {
3232
format!("Domineering('{}')", self.inner)
3333
}
3434

35-
fn to_svg(&self) -> String {
35+
fn _repr_svg_(&self) -> String {
3636
let mut buf = String::new();
3737
self.inner
3838
.to_svg(&mut buf)

cgt-py/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ use crate::{
1414
ski_jumps::*, thermograph::*, toads_and_frogs::*,
1515
};
1616

17-
// TODO: Pretty printers
18-
// TODO: SVG rendering & html()
19-
2017
#[macro_export]
2118
macro_rules! wrap_struct {
2219
($struct:path, $py_struct:ident, $py_class:expr $(, $trait:tt)*) => {

cgt-py/src/ski_jumps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl PySkiJumps {
3131
format!("SkiJumps('{}')", self.inner)
3232
}
3333

34-
fn to_svg(&self) -> String {
34+
fn _repr_svg_(&self) -> String {
3535
let mut buf = String::new();
3636
self.inner
3737
.to_svg(&mut buf)

cgt-py/src/thermograph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ impl PyThermograph {
99
format!("Thermograph({})", self.inner)
1010
}
1111

12-
fn to_svg(&self) -> String {
12+
fn _repr_svg_(&self) -> String {
1313
let mut buf = String::new();
1414
self.inner
1515
.to_svg(&mut buf)

cgt-py/src/toads_and_frogs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl PyToadsAndFrogs {
3131
format!("ToadsAndFrogs('{}')", self.inner)
3232
}
3333

34-
fn to_svg(&self) -> String {
34+
fn _repr_svg_(&self) -> String {
3535
let mut buf = String::new();
3636
self.inner
3737
.to_svg(&mut buf)

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272

7373
env = {
7474
"RUSTFLAGS" = "--cfg=web_sys_unstable_apis";
75+
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
7576
};
7677

7778
nativeBuildInputs = [

0 commit comments

Comments
 (0)