   "#{context.config.output_dir}/" + base_path + path.basename(filepath, path.extname(filepath)) + '.html'
 
 # Ensure that the destination directory exists.
-ensure_directory = (dir, callback) ->
-  exec "mkdir -p #{dir}", -> callback()
+ensure_directory = (dir, cb) ->
+  exec "mkdir -p #{dir}", -> cb()
 
 file_exists = (path) ->
   try


# Process our arguments, passing an array of sources to generate docs for,
# and an optional relative root.
parse_args = (callback) ->

  args = process.ARGV
  project_name = ""

  exec "find #{roots} -type f \\( #{lang_filter} \\)", (err, stdout) ->
    throw err if err

    sources = stdout.split("\n").filter (file) ->
      return false if file is ''
      filename = path.basename file
      # Ignore hidden files
      return false if filename[0] is '.'
      # Ignore SASS partials
      return false if filename.match /^_.*\.s[ac]ss$/
      true

    console.log "styledocco: Recursively generating docs underneath #{roots}/"

    cb sources, project_name, args

parseArgs (sources, project_name, raw_paths) ->
  # Rather than relying on globals, let's pass around a context w/ misc info
  # that we require down the line.
  context = {
    sources
    options: { project_name }
  }
  context.config = {
    show_timestamp: yes
    output_dir: 'docs'
    project_name: project_name or ''
  }

  ensure_directory context.config.output_dir, ->
    generate_readme(context, raw_paths)
    files = sources[0..sources.length]
    next_file = ->
      if files.length
        generateDocumentation files.shift(), context, next_file
    next_file()
    if context.config.content_dir?
      generate_content context, context.config.content_dir
