def construct_embed(source_url): shader_id = source_url.split("/")[-1] return f'' def make_iframe(shader_code): #keep a single function? script = make_script(shader_code) return f"""""" def make_script(shader_code): # code copied and fixed(escaping single quotes to double quotes!!!) from https://webglfundamentals.org/webgl/webgl-shadertoy.html script = (""" WebGL - Shadertoy
\nblank canvas here indicates that some of the shadertoy specific functions are not yet supported with this implementation (like #define I believe). you can always copy and paste the code into a shadertoy.com window to try. """) return script