def new_document(source_path, settings=None):
 from docutils import frontend
 if (settings is None):
  settings = frontend.OptionParser().get_default_values()
 source_path = decode_path(source_path)
 reporter = new_reporter(source_path, settings)
 document = nodes.document(settings, reporter, source=source_path)
 document.note_source(source_path, (-1))
 return document

def new_document ( source_path , settings = None ) : from docutils import frontend if ( settings is None ) : settings = frontend . OptionParser ( ) . get_default_values ( ) source_path = decode_path ( source_path ) reporter = new_reporter ( source_path , settings ) document = nodes . document ( settings , reporter , source = source_path ) document . note_source ( source_path , ( - 1 ) ) return document
return a new empty document object .