'Parse ``source``, write results to ``document``.'

def parse(self, source, document):

    source = CODING.sub('', source)
    env = document.settings.env
    filename = env.doc2path(env.docname)
    m = ast.parse(source)
    docstring = ast.get_docstring(m)
    if (docstring is not None):
        lines = source.split('\n')
        lineno = m.body[0].lineno
        source = '\n'.join(lines[lineno:])
    js_name = ('bokeh-plot-%s.js' % hashlib.md5(env.docname.encode('utf-8')).hexdigest())
    (script, js, js_path, source) = _process_script(source, filename, env.bokeh_plot_auxdir, js_name)
    env.bokeh_plot_files[env.docname] = (script, js, js_path, source)
    rst = PLOT_PAGE.render(source=source, filename=basename(filename), docstring=docstring, script=script)
    document['bokeh_plot_include_bokehjs'] = True
    Parser.parse(self, rst, document)
