 highlight = require("highlight").Highlight
 read = (filename) -> fs.readFileSync filename, "utf8"
 thisDir = dirname module.filename
+configDir = join process.env.HOME, '.skeldown'
 argv = null
 
 # like jQuery.fn.html except it includes the outer tags (and outer tag attrs)

document:

    <span class=wordcount>Word count: 1042</span>
"""

links = """


  argv.extracss = argv.extracss?.split(",") or []

  if exists join(configDir, 'config.json')
    for key, value of JSON.parse(read(join(configDir, 'config.json')))
      if key == 'extracss'
        for file in value.split ','
          (argv.extracss ||= []).push(join(configDir, file))
      else if key == 'jspipeline'
        for file in value.split ','
          pipeline.push(join(configDir, file))
      else if not argv[key]?
        argv[key] = value


  for script in argv.jspipeline?.split(",") or []
    pipeline.push(require(resolve(script)).pipeline)

  pipeline.unshift prettify if not argv.noprettify

