<commit_before><% d = @doc_instance %>

<% @title = "#{d.full_name} (#{d.type})" %>

<h2 class="<%= class_names_for(d) %>">
  <span><%= d.type %></span>
  <%= d.full_name %>
</h2>


<% # Is it a CLASS?  %>
<% if @doc_instance.is_a?(Documentation::Klass) %>

	<% if @doc_instance.superklass %>
	<div class="section section-superclass">
	  <h3>Superclass</h3>
	  <p><%= auto_link(d.superklass, false) %></p>
	</div> <!-- .section -->		
	<% end %>

	<% unless @doc_instance.subklasses.empty? %>
	<div class="section section-subclasses">
	  <h3>Subclasses</h3>
	  <p><%= d.subklasses.map { |s| auto_link(s, false) }.join(', ') %></p>
	</div> <!-- .section -->		
	<% end %>

<% end %>

<% # Does it have MIXINS? %>
<% unless @doc_instance.mixins.empty? %>
  <div class="section section-mixins">
    <h3>Includes</h3>
    <p><%= d.mixins.map { |m| auto_link(m, false) }.join(', ') %></p>
  </div> <!-- .section -->
<% end %>

<div class="section section-method-list">
  <h3>Methods</h3>
  
  <ul class="method-list">
    <% d.all_methods.each do |method| %>
      <li><%= auto_link(method, true, :class => class_names_for(method)) %></li>
    <% end %>
  </ul>
  
  <% unless @doc_instance.mixins.empty? %>
    <% d.mixins.each do |mixin| %>
    <h4 class="inherited">Inherited from <%= auto_link(mixin) %></h4>
    <ul class="method-list">
			<% mixin.all_methods.each do |method| %>
				<li><%= auto_link(method, true, :class => class_names_for(method)) %></li>
			<% end %>
    </ul>
    <% end %>
  <% end %>
</div> <!-- .section -->

<% if d.is_a?(Documentation::Klass) && d.constructor %>
<div class="section section-constructor">
  <h3>Constructor</h3>
  <p>
    <pre id="<%= dom_id(d.constructor) %>" class="syntax"><code><%= d.constructor.ebnf_expressions %></code></pre>
  </p>
  
  <p><%= htmlize(d.constructor.description) %></p>
</div> <!-- .section -->
<% end %>


<%
types = {
	:constants           => "Constants",
	:klass_methods       => "Class methods",
	:klass_properties    => "Class properties",
	:instance_methods    => "Instance methods",
	:instance_properties => "Instance properties"  <commit_msg>Don't create a "methods" section if there are no methods.<commit_after><% d = @doc_instance %>

<% @title = "#{d.full_name} (#{d.type})" %>

<h2 class="<%= class_names_for(d) %>">
  <span><%= d.type %></span>
  <%= d.full_name %>
</h2>


<% # Is it a CLASS?  %>
<% if @doc_instance.is_a?(Documentation::Klass) %>

	<% if @doc_instance.superklass %>
	<div class="section section-superclass">
	  <h3>Superclass</h3>
	  <p><%= auto_link(d.superklass, false) %></p>
	</div> <!-- .section -->		
	<% end %>

	<% unless @doc_instance.subklasses.empty? %>
	<div class="section section-subclasses">
	  <h3>Subclasses</h3>
	  <p><%= d.subklasses.map { |s| auto_link(s, false) }.join(', ') %></p>
	</div> <!-- .section -->		
	<% end %>

<% end %>

<% # Does it have MIXINS? %>
<% unless @doc_instance.mixins.empty? %>
  <div class="section section-mixins">
    <h3>Includes</h3>
    <p><%= d.mixins.map { |m| auto_link(m, false) }.join(', ') %></p>
  </div> <!-- .section -->
<% end %>

<div class="section section-method-list">
  <% unless d.all_methods.empty? && d.mixins.empty? %>
    <h3>Methods</h3>
  
    <ul class="method-list">
      <% d.all_methods.each do |method| %>
        <li><%= auto_link(method, true, :class => class_names_for(method)) %></li>
      <% end %>
    </ul>
  
    <% unless @doc_instance.mixins.empty? %>
      <% d.mixins.each do |mixin| %>
      <h4 class="inherited">Inherited from <%= auto_link(mixin) %></h4>
      <ul class="method-list">
  			<% mixin.all_methods.each do |method| %>
  				<li><%= auto_link(method, true, :class => class_names_for(method)) %></li>
  			<% end %>
      </ul>
      <% end %>
    <% end %>
  <% end %>
</div> <!-- .section -->

<% if d.is_a?(Documentation::Klass) && d.constructor %>
<div class="section section-constructor">
  <h3>Constructor</h3>
  <p>
    <pre id="<%= dom_id(d.constructor) %>" class="syntax"><code><%= d.constructor.ebnf_expressions %></code></pre>
  </p>
  
  <p><%= htmlize(d.constructor.description) %></p>
</div> <!-- .section -->
<% end %>


<%
types = {
	:constants           => "Constants",
	:klass_methods       => "Class methods",
	:klass_properties    => "Class properties",
	:instance_methods    => "Instance methods",
	:instance_properties => "Instance properties"  
{'fraction_non_alphanumeric': 0.23954285714285714, 'fraction_numerical': 0.0064, 'mean_word_length': 3.358565737051793, 'pattern_counts': {'":': 0, '<': 181, '<?xml version=': 0, '>': 193, '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': '3075404', 'n_tokens_mistral': 1805, 'n_tokens_neox': 1660, 'n_words': 313}