<commit_before>module Garage
  module Docs
    class Application
      def initialize(application)
        @application = application
      end

      def name
        @application.class.name.split("::")[0]
      end

      def documents
        @documents ||= pathnames.map {|pathname| Documentation.new(pathname) }
      end

      def pathnames
        Pathname.glob("#{Garage.configuration.docs.document_root}/resources/**/*.md").sort
      end

      def find_document(name)
        documents.find {|document| document.name == name }
      end
    end

    class Documentation
      attr_reader :pathname

      def self.renderer
        @renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(with_toc_data: true), fenced_code_blocks: true)
      end

      def self.toc_renderer
        @toc_renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML_TOC)
      end

      def initialize(pathname)
        @pathname = pathname
      end

      def name
        pathname.basename(".md").to_s
      end

      def toc
        self.class.toc_renderer.render(body).html_safe
      end<commit_msg>Change redcarpet option: disable emphasis<commit_after>module Garage
  module Docs
    class Application
      def initialize(application)
        @application = application
      end

      def name
        @application.class.name.split("::")[0]
      end

      def documents
        @documents ||= pathnames.map {|pathname| Documentation.new(pathname) }
      end

      def pathnames
        Pathname.glob("#{Garage.configuration.docs.document_root}/resources/**/*.md").sort
      end

      def find_document(name)
        documents.find {|document| document.name == name }
      end
    end

    class Documentation
      attr_reader :pathname

      def self.renderer
        @renderer ||= Redcarpet::Markdown.new(
          Redcarpet::Render::HTML.new(with_toc_data: true),
          fenced_code_blocks: true,
          no_intra_emphasis: true
        )
      end

      def self.toc_renderer
        @toc_renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML_TOC, no_intra_emphasis: true)
      end

      def initialize(pathname)
        @pathname = pathname
      end

      def name
        pathname.basename(".md").to_s
      end

      def toc
        self.class.toc_renderer.render(body).html_safe
      end
{'fraction_non_alphanumeric': 0.09786324786324786, 'fraction_numerical': 0.0008547008547008547, 'mean_word_length': 2.3111739745403113, 'pattern_counts': {'":': 2, '<': 3, '<?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': '5261719', 'n_tokens_mistral': 719, 'n_tokens_neox': 685, 'n_words': 136}