# Twine 2 HTML Output (v1.0.2)
Twine 2 stores its data within HTML elements.
The root of a Twine 2 story is the `` element with attributes encoding metadata about the story itself. Inside of this element are the `` (Passages), `` (Passage Tag Colors), `
```
## Story Data
Story metadata is stored as attributes on the `` element.
* name: (string) Required. The name of the story.
* ifid: (string) Required. An IFID is a sequence of between 8 and 63 characters, each of which shall be a digit, a capital letter or a hyphen that uniquely identify a story (see [Treaty of Babel](https://babel.ifarchive.org/)).
* format: (string) Optional. The story format used to create the story.
* format-version: (string) Optional. The version of the story format used to create the story.
* startnode: (string) Optional. The PID matching a `` element whose content should be displayed first.
* tags: (string) Optional. A list of tags assigned to the story by its author, with spaces separating them.
* zoom: (string) Optional. The decimal level of zoom (i.e. 1.0 is 100% and 1.2 would be 120% zoom level).
* creator: (string) Optional. The name of program used to create the file.
* creator-version: (string) Optional. The version of the program used to create the file.
**Example:**
```html
...
```
## Passages
Each passage is represented as a `` element with its metadata stored as its attributes.
* pid: (string) Required. The Passage ID (PID). (Note: This is subject to change during editing with Twine 2.)
* name: (string) Required. The name of the passage.
* tags: (string) Optional. Any tags for the passage separated by spaces.
* position: (string) Optional. Comma-separated X and Y position of the upper-left of the passage when viewed within the Twine 2 editor.
* size: (string) Optional. Comma-separated width and height of the passage when viewed within the Twine 2 editor.
Passage content is stored within the `` element itself as a single text node and must contain no other child nodes; all &, <, >, ", and ' characters should be escaped into their corresponding HTML entities.
**Example:**
```html
Some content
```
## Story JavaScript
Any JavaScript code saved from the Story JavaScript window of the Story menu in Twine 2 is kept within a single `
```
## Story Stylesheet
Any CSS rules saved from the Story Stylesheet window from the Story menu in Twine 2 are kept within a single `
```
## Passage Tag Colors
If any passage tags have been assigned colors within the Twine 2 editor, they will appear as `` elements. The `name` attribute will be the name of the tag and the `color` attribute will be one of seven named colors.
Named Colors:
* `gray`
* `red`
* `orange`
* `yellow`
* `green`
* `blue`
* `purple`
**Example:**
```html
```