# Exporter
Class
## About
`Exporter` describes a named document-output format. Built-in instances route HTML, JSON, Markdown, and plain text to the editor's native exporters. Subclass it or override its export behavior to add an application format.
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| Formats | Custom <br > HTML <br > JSON <br > Markdown <br > PlainText | (None) |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Constructor | identifier As String <br> format As Formats = Formats.Custom | (None) | Creates a new exporter instance initialized from the supplied values. |
| Export | editor As GraffitiProEditor.Editor | String | Exports the document with the registered exporter and returns the generated text. |
| ExportToFile | editor As GraffitiProEditor.Editor <br> file As FolderItem | Boolean | Exports the editor content to the supplied file and returns whether it succeeded. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| FileExtension | String | (None) | Gets or sets the file extension. |
| Format | Formats | (None) | Gets or sets the format. |
| Identifier | String | (None) | Gets or sets the stable identifier used to locate this object. |
| MIMEType | String | (None) | Gets or sets the MIME type. |
## Notes
Exporter identifiers are the keys used by the editor's generic export API.
### Registration
Give each exporter a stable identifier and add it to `Editor.Exporters`. `Editor.Export` selects it by identifier. Set `FileExtension` and `MIMEType` so file-oriented application UI can describe the output correctly.
## Examples
Register custom formats once during editor initialization.
### Custom Text Exporter
```xojo
Class UppercaseExporter Inherits GraffitiProEditor.Exporter
Sub Constructor()
Super.Constructor("uppercase")
FileExtension = "txt"
MIMEType = "text/plain"
End Sub
Function Export(editor As GraffitiProEditor.Editor) As String
If editor = Nil Then Return ""
Return editor.ToPlainText.Uppercase
End Function
End Class
```
```xojo
Editor.Exporters.Add(New UppercaseExporter)
Var output As String = Editor.Export("uppercase")
```