<commit_before><% header_title ||= t_display_type(@document) %>
<% page_title @document.title, "Worldwide Priorities" %>

<%= content_tag_for :article, @document, nil, class: "document-page #{@document.type.downcase}" do %>
  <header class="block headings-block">
    <div class="inner-block floated-children">
      <%= render(partial: 'documents/header', locals: { header_title: header_title, document: @document, footer_meta: true }) %>
    </div>
  </header>

  <div class="block">
    <div class="inner-block">
      <%= render(partial: 'navigation', locals: { worldwide_priority: @document }) if show_navigation? %>
    </div>
  </div>

  <div class="block-3">
    <div class="inner-block">
      <section class="contextual-info policy-parts js-stick-at-top-when-scrolling">
        <h1>Contents</h1>
        <nav role="navigation">
          <% if govspeak_headers(@document.body).any? %>
            <ol id="document_sections">
              <% govspeak_headers(@document.body).each do |header| %>
                <li><%= link_to header.text, public_document_path(@document, anchor: header.id) %></li>
              <% end %>
            </ol>
          <% end %>
        </nav>
      </section>
    </div>
  </div>
<commit_msg>Calculate govspeak headers once for priorities<commit_after><% header_title ||= t_display_type(@document) %>
<% page_title @document.title, "Worldwide Priorities" %>

<%= content_tag_for :article, @document, nil, class: "document-page #{@document.type.downcase}" do %>
  <header class="block headings-block">
    <div class="inner-block floated-children">
      <%= render(partial: 'documents/header', locals: { header_title: header_title, document: @document, footer_meta: true }) %>
    </div>
  </header>

  <div class="block">
    <div class="inner-block">
      <%= render(partial: 'navigation', locals: { worldwide_priority: @document }) if show_navigation? %>
    </div>
  </div>

  <div class="block-3">
    <div class="inner-block">
      <section class="contextual-info policy-parts js-stick-at-top-when-scrolling">
        <h1>Contents</h1>
        <nav role="navigation">
          <% headers = govspeak_headers(@document.body) %>
          <% if headers.any? %>
            <ol id="document_sections">
              <% headers.each do |header| %>
                <li><%= link_to header.text, public_document_path(@document, anchor: header.id) %></li>
              <% end %>
            </ol>
          <% end %>
        </nav>
      </section>
    </div>
  </div>

{'fraction_non_alphanumeric': 0.1730310262529833, 'fraction_numerical': 0.002386634844868735, 'mean_word_length': 2.9420062695924765, 'pattern_counts': {'":': 0, '<': 68, '<?xml version=': 0, '>': 68, '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': '3007440', 'n_tokens_mistral': 819, 'n_tokens_neox': 767, 'n_words': 161}