Documentation
¶
Overview ¶
text.go implements a text structure and function for building a text editor functionality independent of UI.
Index ¶
Constants ¶
View Source
const ( // Plain describes a text/plain document Plain = iota // FDX a Final Draft XML document FDX // Markdown document Markdown // Fountain document Fountain )
View Source
const Version = `v0.0.1-dev`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// Source holds the text in a byte slice
Source []byte
// Cursor holds the location of where to start reading or writing
Cursor int
}
Block is a structure for holding text content you want to process. The goal is to have a foundation for making stream processors, analyzers and editors easily.
A Block structure should play nicely with any Reader, Writer and Seeker interfaces
type Document ¶
type Document struct {
// Name holds a human friendly name as a label
Name string
// Type is an integer value representing one of the text types supported (e.g. TextPlain).
Type int
// Meta is a map to any additional data associated with the text, e.g. File Info, DOI content, etc.
Meta map[string]interface{}
// Cursor holds the document level cursor (byte count into document)
Cursor int
// Source holds an ordered list of Block pointers
Source []*Block
}
Click to show internal directories.
Click to hide internal directories.