   # The mirror of `divider_text` that we expect Pygments to return. We can split
   # on this to recover the original sections.
   l.divider_html: new RegExp('\\n*<span class="c1">' + l.symbol + 'DIVIDER<\\/span>\\n*')
+
+# Get the current language we're documenting, based on the extension.
+get_language: (source) -> languages[path.extname(source)]
 
 # Compute the destination HTML path for an input source file path. If the source
 # is `lib/example.coffee`, the HTML will be at `docs/example.html`

# marker comments between each section and then splitting the result string
# wherever our markers occur.
highlight: (source, sections, callback) ->
  pygments: process.createChildProcess 'pygmentize', ['-l', language.name, '-f', 'html']
  output: ''
  pygments.addListener 'error',  (error)  ->

# For each source file passed in as an argument, generate the documentation.
sources: process.ARGV.sort()
if sources.length
  ensure_directory ->
    fs.writeFile 'docs/docco.css', docco_styles
    files: sources.slice(0)
    next_file: -> generate_documentation files.shift(), next_file if files.length
    next_file()
