<commit_before><% part ||= show || @part %>

<% links do %>
  <li><%= edit_part_link(part) %> </li>
<% end %>

<% accordion do %>
  
  <% accordion_item 'Preview' do %>
    <% show part, :preview, :skip_label => true do %>
      <div class="rendering <%= part.filename -%> <%= part.preferred_types.first.domify %>">
        <%= part.render_with_fake_content %>
      </div>
    <% end %>
  <% end %>

  <% accordion_item 'Basic' do %>
    <%= show part, :name %>
    <%= show part, :filename %>
    <%= show part, :preferred_types_names, :label => 'Preferred Types' %>
  <% end %>
  
  <% accordion_item 'Options' do %>
    <% part.options.to_hash_with_defaults.each do |key,value| %>
      <%= di_dt_dd(key,value) %>
    <% end %>
  <% end %>

  <% accordion_item 'Code', :content_tag => :div do %>
      <code class="liquid"><%=h part.liquid %></code>
  <% end %>

  <% accordion_item 'Example', :content_tag => :div do %>
      <code class="html"><%=h part.render_with_fake_content %></code>
  <% end %>

<% end %>
<commit_msg>hide options if Part has none<commit_after><% part ||= show || @part %>

<% links do %>
  <li><%= edit_part_link(part) %> </li>
<% end %>

<% accordion do %>
  
  <% accordion_item 'Preview' do %>
    <% show part, :preview, :skip_label => true do %>
      <div class="rendering <%= part.filename -%> <%= part.preferred_types.first.domify %>">
        <%= part.render_with_fake_content %>
      </div>
    <% end %>
  <% end %>

  <% accordion_item 'Basic' do %>
    <%= show part, :name %>
    <%= show part, :filename %>
    <%= show part, :preferred_types_names, :label => 'Preferred Types' %>
  <% end %>
  
  <% unless part.defined_options.blank? %>
    <% accordion_item 'Options' do %>
      <% part.options.to_hash_with_defaults.each do |key,value| %>
        <%= di_dt_dd(key,value) %>
      <% end %>
    <% end %>
  <% end %>

  <% accordion_item 'Code', :content_tag => :div do %>
      <code class="liquid"><%=h part.liquid %></code>
  <% end %>

  <% accordion_item 'Example', :content_tag => :div do %>
      <code class="html"><%=h part.render_with_fake_content %></code>
  <% end %>

<% end %>

{'fraction_non_alphanumeric': 0.21158337225595517, 'fraction_numerical': 0.0, 'mean_word_length': 3.08, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5604382', 'n_tokens_mistral': 870, 'n_tokens_neox': 739, 'n_words': 158}