Sha256: a52cba8ccbd177527681916ab7f7721c539567bde17196cf4bcc83545df5264f

Contents?: true

Size: 610 Bytes

Versions: 7

Compression:

Stored size: 610 Bytes

Contents

class CodeDemo < ExpressTemplates::Components::Container

  before_build -> {
    set_attribute(:class, 'ae-demo-container')
  }

  contains -> (&block) {
    ul(class: 'ae-tabs') {
      li(class: 'ae-tab active-tab', 'data-tab' => 'input'){
        "Input"
      }
      li(class: 'ae-tab', 'data-tab' => 'output'){
        "Output"
      }
    }

    div(id: 'input', class: 'ae-tab-content active-tab'){
      highlight_code_block {
        block.call
      }
    }

    div(id: 'output', class: 'ae-tab-content'){
      div(class: 'demo-container'){
        eval block.call.html_safe
      }
    }
  }
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
express_ui-0.5.0 app/components/code_demo.rb
express_ui-0.4.2 app/components/code_demo.rb
express_ui-0.4.1 app/components/code_demo.rb
express_ui-0.4.0 app/components/code_demo.rb
express_ui-0.3.0 app/components/code_demo.rb
express_ui-0.2.1 app/components/code_demo.rb
express_ui-0.2.0 app/components/code_demo.rb