Skip to content

RedSeaDocument Class

Represents a Red Sea Markup Language document.

Hierarchy

flowchart TB
    RedSeaDocument --> object

Constructor

RedSeaDocument.__init__()

Creates a new empty document.


Instance Methods

RedSeaDocument contains 5 instance methods.

get_document_data()

Returns the loaded data.

Returns

str

The document's data.

load_from_file(filepath: str, encoding: str = 'utf-8')

Loads a document from a file at a given filepath.

Parameters

filepath (str)

The file to load RSML data from.

encoding (str) = 'utf-8'

The encoding to open the file with, defaults to utf-8.

load_from_string(data: str)

Loads a document from a string containing RSML.

Parameters

data (str)

The string containing RSML data to load.

write_document_to_file(filepath: str, encoding: str = 'utf-8')

Writes the loaded data to a file.

Parameters

filepath (str)

The file to write RSML data to.

encoding (str) = 'utf-8'

The encoding to open the file with, defaults to utf-8.

write_document_to_new_list()

Writes the loaded document to a list.

Returns

list[str]

A list of strings, where each string is a line of loaded RSML.