Sha256: db22d8bf82bdd2b3b4eb23332ecd3243622eca9401e5468fcfc2f977f523a316
Contents?: true
Size: 963 Bytes
Versions: 30
Compression:
Stored size: 963 Bytes
Contents
module Nexmo module OAS module Renderer module Filters class Techio < Banzai::Filter def call(input) input.gsub(/```techio(.+?)```/m) do |_s| config = YAML.safe_load($1) techio = <<~HEREDOC <div class="techio-container"> <iframe width="100%" frameborder="0" scrolling="no" allowtransparency="true" style="visibility: hidden" src="https://tech.io/playground-widget#{config['path']}/#{config['title']}"></iframe> <script>if(typeof window.techioScriptInjected==="undefined"){window.techioScriptInjected=true;var d=document,s=d.createElement("script");s.src="https://files.codingame.com/codingame/iframe-v-1-4.js";(d.head||d.body).appendChild(s);}</script> </div> HEREDOC "FREEZESTART#{Base64.urlsafe_encode64(techio)}FREEZEEND" end end end end end end end
Version data entries
30 entries across 30 versions & 1 rubygems