rishabhsrao/voxel-hologram

View on GitHub
app/_templates/code_example_renderers/jsx_execute_only_renderer.rb

Summary

Maintainability
A
15 mins
Test Coverage
require "babel/transpiler"

Hologram::CodeExampleRenderer::Factory.define "jsx_execute_only" do
  example_template "jsx_execute_only_example_template"

  lexer { Rouge::Lexer.find("js") }

  rendered_example do |code|
    Babel::Transpiler.transform(code.strip)["code"]
  end
end