From 464e1f062b8efb795558db285cbf104ce377dd3f Mon Sep 17 00:00:00 2001 From: TheZoq2 <frans.skarman@protonmail.com> Date: Tue, 14 Feb 2023 16:48:40 +0100 Subject: [PATCH] Fix docs build readme and add more _repr_*_ --- README.md | 6 ++++-- b_asic/signal_flow_graph.py | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 671e5c08..17224fca 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,10 @@ pytest --mpl ### Generating documentation -In `B-ASIC/docs_sphinx`: - +``` +sphinx-build -b html docs_sphinx docs_sphinx/_build +``` +or in `B-ASIC/docs_sphinx`: ``` make html ``` diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index bacdb629..2be252af 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -1425,6 +1425,19 @@ class SFG(AbstractOperation): def _repr_mimebundle_(self, include=None, exclude=None): return self.sfg()._repr_mimebundle_(include=include, exclude=exclude) + def _repr_jpeg_(self): + return self.sfg()._repr_mimebundle_(include=["image/jpeg"])[ + "image/jpeg" + ] + + def _repr_png_(self): + return self.sfg()._repr_mimebundle_(include=["image/png"])["image/png"] + + def _repr_html_(self): + return self.sfg()._repr_mimebundle_(include=["image/svg+xml"])[ + "image/svg+xlm" + ] + def show_sfg(self, format=None, show_id=False, engine=None) -> None: """ Shows a visual representation of the SFG using the default system viewer. -- GitLab