# Doc

A class representing a Guppy document. To access this class, use `Guppy.Doc`. To get the document for a particular guppy instance, say called `"guppy1"`, do `Guppy("guppy1").doc()`.

## Constructor

#### new Doc(docopt)

Source:
  - doc.js, line 16

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`doc` | string | <optional> | `<m><e></e></m>` | An XML string representing the document

### Methods

#### (static) render(doc, target_id)

Source:
  - doc.js, line 362

Render a given document into a specified HTML element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`doc` | string | A GuppyXML string to be rendered
`target_id` | string | The ID of the HTML element to render into

#### evaluate(evaluators) → {Object}

Source:
  - doc.js, line 88

Evaluate the document using user-supplied functions to interpret symbols

##### Parameters:

Name | Type | Description
--- | --- | ---
`evaluators` | Object | A dictionary where each key is a node type in the AST ("var", "val", "sin", "cos", etc.) and the corresponding value is a function that takes a list of argument (the results of evaluating that AST node's arguments) as well as, optionally, a second argument for the parent AST node to the one currently being evaluated.

##### Returns:

Type
  Object

#### get_content(t) → {string}

Source:
  - doc.js, line 68

Get the content of the document as a string

##### Parameters:

Name | Type | Description
--- | --- | ---
`t` | string | The rendering method to use ("latex", "text", "ast" (for syntax tree), or "xml" (for internal XML representation))

##### Returns:

Type
  string

#### get_symbols(groupsopt) → {Array.<string>}

Source:
  - doc.js, line 170

Get the names of symbols used in this document

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`groups` | Array.<string> | <optional> | A list of groups you want strings for

##### Returns:

Type
  Array.<string>

#### root() → {Element}

Source:
  - doc.js, line 58

Get the document as a DOM object

##### Returns:

Type
  Element

#### set_content(xml_data)

Source:
  - doc.js, line 188

Set the content of the document

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml_data` | string | An XML string representing the content of the document