Crate twee_parser

Source
Expand description

§twee_parser

The Story and Passage structs describe a Twine story.
They can be constructed by the user, or parsed using the parse_* functions.
A Story can then be modified and serialized again using the serialize_* functions.

Re-exports§

pub use serde_json;
pub use xmltree;

Structs§

Element
Represents an XML element.
Passage
Representation of a passage in a Story.
Story
An in-memory representation of a Twine story.

Enums§

Error
Possible parsing errors.
ParseError
Errors that can occur parsing XML
Warning
Possible warnings during parsing.
Per specification, the parser is quite generous and generates many things as warnings instead of errors.
XMLNode

Functions§

parse_archive
Parses a Twine archive, a list of <tw-storydata> tags, into a list of Storys.
parse_html
Parses a published Twine HTML file into a Story, looking for a <tw-storydata> tag.
parse_twee3
Parses Twee3 into a Story.
serialize_html
Serializes a Story into a <tw-storydata> tag.
serialize_twee3
Serializes a Story into Twee3.