Sha256: ac5901db487204b3caab3ff117143488e044d185267c2a0a3b87635101cc1be0

Contents?: true

Size: 1.31 KB

Versions: 90

Compression:

Stored size: 1.31 KB

Contents

<% type ||= "rails" %>

<% if type == "react" %>
  <% contents = File.read("#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{@kit_examples[:kit]}/docs/_#{key}.jsx") %>
<% else %>
  <% contents = File.read("#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{@kit_examples[:kit]}/docs/_#{key}.html.erb") %>
<% end %>

<div class="pb--kit-example">
  <%= pb_rails("caption", props: { text: item }) %>
  <br>
  <% if type == "rails" %>
    <%= render partial: "pb_#{@kit_examples[:kit]}/docs/#{key}" %>
  <% elsif type == "react" %>
    <%= pb_react(key.camelize) %>
  <% end %>
  <br>
</div>

  <% if @show_code%>
    <div class="markdown pb--kit-example-markdown">
      <%= markdown(get_per_sample_descriptions(@kit_examples[:kit], key)) %>
    </div>
    <div class="pb--codeControls">
      <ul>
        <li>
          <a href="#" data-toggle="code_example">Code Example</a>
        </li>
      </ul>
    </div>
    <div class="pb--codeCopy" data-action="toggle" data-togglable="code_example" style="display: none" >
      <a href="#" data-toggle="false" class="pb--close-toggle">Close</a>
      <% if type == "rails" %>
        <pre class="highlight"><%= raw rouge(contents, "erb") %></pre>
      <% elsif type == "react" %>
        <pre class="highlight"><%= raw rouge(contents, "react")%></pre>
      <% end %>
    </div>
  <% end %>

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
playbook_ui-6.6.1 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha10 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.6.0 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.5.2 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.5.1 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.5.0 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.4.2 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.4.1 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.4.0 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.3.1 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha4 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha3 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.3.0 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-6.2.1 app/pb_kits/playbook/config/_kit_ui.html.erb