Sha256: 37f1249c3306bc39569b9e94d1c1072d1a0731d14ac36adba4e0081ae517b926

Contents?: true

Size: 1.46 KB

Versions: 5

Compression:

Stored size: 1.46 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 <%= cookies[:dark_mode] == "true" ? "dark" : "" %>">
    <%= markdown(get_per_sample_descriptions(@kit_examples[:kit], key)) %>
  </div>
  <div id="code-wrapper">
    <div class="pb--codeControls">
      <ul>
        <li>
          <a href="#" id="toggle-open" data-toggle="code_example">Code Example</a>
        </li>
      </ul>
    </div>
    <div class="pb--codeCopy" data-action="toggle" data-togglable="code_example" style="display: none" >
      <%= pb_rails("section_separator")%>
      <a href="#" id="toggle-close" 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>
  </div>
<% end %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
playbook_ui-7.16.0.pre.alpha5 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.16.0.pre.alpha4 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.16.0.pre.alpha3 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.16.0.pre.alpha2 app/pb_kits/playbook/config/_kit_ui.html.erb
playbook_ui-7.16.0.pre.alpha1 app/pb_kits/playbook/config/_kit_ui.html.erb