         # new jquery context
         @$ = jQuery.create()
         @$.fn.compile = -> jsonify this
+        # values
+        @loaded = no
+        @loading = no
         #aliases
         @loadSync = @open
 

        return el

    use: (data) ->
        @loaded = yes
        @parse data

    load: (filename, callback) ->
        @read filename, (err, data) ->
            return callback.call(this, err) if err
            @use data
            callback(null, @el)

    open: (filename) ->
        data = @readSync filename
        return @use data

    compile: (el) ->
        throw new Error "no html file loaded or html string used." unless @loaded
        el ?= @el
        # return only the important information
        do el.compile

# exports

module.exports = HTMLCompiler

fs = require 'fs'
jQuery = require 'jquery'
{ extname } = require 'path'
{ jsonify } = require './traverse'
link = require './linker'


class HTMLCompiler
