<commit_before>require 'jekyll'
require File.expand_path('helpers', File.dirname(__FILE__))

module Octopress
  class Docs < Command
    def self.init_with_program(p)
      p.command(:docs) do |c|
        c.syntax 'octopress docs'
        c.description "Launch local server with docs for Jekyll v#{Jekyll::VERSION}"

        c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
        c.option 'host', '-H', '--host [HOST]', 'Host to bind to'

        c.action do |args, options|

          # Find local Jekyll gem path
          spec = Gem::Specification.find_by_name("jekyll")
          gem_path = spec.gem_dir

          options = CommandHelpers.normalize_options(options)
          options = ::Jekyll.configuration(options.to_symbol_keys.merge!({
            'source' => "#{gem_path}/site",
            'destination' => "#{gem_path}/site/_site"
          }))
          ::Jekyll::Commands::Build.process(options)
          ::Jekyll::Commands::Serve.process(options)
        end
      end
    end
  end
end<commit_msg>Now docs requires the --jekyll flag to render jekyll docs<commit_after>require 'jekyll'
require File.expand_path('helpers', File.dirname(__FILE__))

module Octopress
  class Docs < Command
    def self.init_with_program(p)
      p.command(:docs) do |c|
        c.syntax 'octopress docs'
        c.description "Soon: Launch local server with docs for Octopress v#{Octopress::VERSION}"

        c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
        c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
        c.option 'jekyll', '--jekyll', "Launch local server with docs for Jekyll v#{Jekyll::VERSION}"

        c.action do |args, options|
          
          # Only show jekyll docs if the jekyll flag was used
          #
          if options['jekyll']
            options.delete('jekyll')

            # Find local Jekyll gem path
            #
            spec = Gem::Specification.find_by_name("jekyll")
            gem_path = spec.gem_dir

            options = CommandHelpers.normalize_options(options)
            options = ::Jekyll.configuration(options.to_symbol_keys.merge!({
              'source' => "#{gem_path}/site",
              'destination' => "#{gem_path}/site/_site"
            }))
            
            ::Jekyll::Commands::Build.process(options)
            ::Jekyll::Commands::Serve.process(options)
          else
            puts "Sorry, not yet. View Octopress docs on http://octopress.org or view Jekyll docs locally by running `octopress docs --jekyll`"
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12562814070351758, 'fraction_numerical': 0.0, 'mean_word_length': 2.296815286624204, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2465094', 'n_tokens_mistral': 792, 'n_tokens_neox': 780, 'n_words': 200}