<commit_before>class RecentDocumentsBlock < Block

  def self.description
    _('List of recent content')
  end

  settings_items :limit

  include ActionController::UrlWriter
  def content
    docs =
      if self.limit.nil?
        owner.recent_documents
      else
        owner.recent_documents(self.limit)
      end

    block_title(_('Recent content')) +
    content_tag('ul', docs.map {|item| content_tag('li', link_to(item.title, item.url))}.join("\n"))

  end

end<commit_msg>ActionItem193: only text articles is now showed in the recent documents<commit_after>class RecentDocumentsBlock < Block

  def self.description
    _('List of recent content')
  end

  settings_items :limit

  include ActionController::UrlWriter
  def content
    docs =
      if self.limit.nil?
        owner.recent_documents
      else
        owner.recent_documents(self.limit)
      end

    docs = docs.select{|d| d.kind_of?(TextArticle)}

    block_title(_('Recent content')) +
    content_tag('ul', docs.map {|item| content_tag('li', link_to(item.title, item.url))}.join("\n"))

  end

end
{'fraction_non_alphanumeric': 0.11008325624421832, 'fraction_numerical': 0.0027752081406105457, 'mean_word_length': 3.328, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3851396', 'n_tokens_mistral': 354, 'n_tokens_neox': 321, 'n_words': 78}