-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathplot_to_md.py
More file actions
35 lines (28 loc) · 809 Bytes
/
plot_to_md.py
File metadata and controls
35 lines (28 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import meshplot
import json
first = True
meshplot.website()
def mp_to_md(self):
global first
if first:
first = False
res = self.to_html(imports=True, html_frame=False)
else:
res = self.to_html(imports=False, html_frame=False)
return res
def sp_to_md(self):
global first
if first:
first = False
res = self.to_html(imports=True, html_frame=False)
else:
res = self.to_html(imports=False, html_frame=False)
return res
def lis_to_md(self):
res = ""
for row in self:
for e in row:
res += e.to_html()
return res
get_ipython().display_formatter.formatters["text/html"].for_type(meshplot.Viewer, mp_to_md)
get_ipython().display_formatter.formatters["text/html"].for_type(meshplot.Subplot, sp_to_md)