File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
2+
13import matplotlib .tri as mtri
24import numpy as np
35from matplotlib import animation
@@ -96,4 +98,6 @@ def main(fname="source/_static/logo_docs.mp4"):
9698
9799
98100if __name__ == "__main__" :
99- main ()
101+ fname = "_static/logo_docs.mp4"
102+ if not os .path .exists (fname ):
103+ main (fname )
Original file line number Diff line number Diff line change 1414import os
1515import sys
1616
17- from docutils import nodes
18- from docutils .parsers .rst import Directive
19-
2017package_path = os .path .abspath ("../.." )
2118# Insert into sys.path so that we can import adaptive here
2219sys .path .insert (0 , package_path )
160157html_logo = "_static/logo_docs.png"
161158
162159
163- class RunLogoAnimated (Directive ):
164- def run (self ):
165- fname = "_static/logo_docs.mp4"
166- if not os .path .exists (fname ):
167- import logo_animated
168-
169- print (f"{ fname } does not exist." )
170- logo_animated .main (fname )
171- style = "width: 400px; max-width: 100%; margin: 0 auto; display:block;"
172- opts = f'autoplay loop muted playsinline webkit-playsinline style="{ style } "'
173- html = f'<video { opts } ><source src="{ fname } " type="video/mp4"></video><br>'
174- return [nodes .raw (text = html , format = "html" )]
175-
176-
177160def setup (app ):
178161 app .add_css_file ("custom.css" ) # For the `live_info` widget
179- app .add_directive ("animated-logo" , RunLogoAnimated )
Original file line number Diff line number Diff line change 1- .. animated-logo ::
1+ .. jupyter-execute :: ../logo_animated.py
2+ :hide-code:
3+ :hide-output:
4+
5+ .. raw :: html
6+
7+ <video autoplay loop muted playsinline webkit-playsinline
8+ style =" width : 400px ; max-width : 100% ; margin : 0 auto ; display :block ;" >
9+ <source src =" _static/logo_docs.mp4" type =" video/mp4" >
10+ </video ><br >
You can’t perform that action at this time.
0 commit comments