Documentation
¶
Index ¶
- type Heading
- type HeadingLine
- type Line
- type LineType
- type LinkLine
- type Parser
- type PreformatLine
- type PreformatToggleLine
- func (r PreformatToggleLine) CoreType() LineType
- func (r PreformatToggleLine) Data() string
- func (r PreformatToggleLine) Level() int
- func (r PreformatToggleLine) Meta() string
- func (r PreformatToggleLine) Prefix() string
- func (r PreformatToggleLine) String() string
- func (r PreformatToggleLine) Type() LineType
- type QuoteLine
- type TextLine
- type UnorderedListLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heading ¶
type Heading struct { HL [maxHeading]int // current section number, extendable in case we get >3 headings // for example, {1, 3, 0} is # followed by 3 ##s H *HeadingLine }
Heading represents a Heading in a TOC context, alongside its associated 3 levels within the overall structure
type HeadingLine ¶
type HeadingLine struct {
// contains filtered or unexported fields
}
HeadingLine represents a heading text/gemini line
func (HeadingLine) CoreType ¶
func (r HeadingLine) CoreType() LineType
func (HeadingLine) Data ¶
func (r HeadingLine) Data() string
func (HeadingLine) Level ¶
func (r HeadingLine) Level() int
func (HeadingLine) Meta ¶
func (r HeadingLine) Meta() string
func (HeadingLine) Prefix ¶
func (r HeadingLine) Prefix() string
func (HeadingLine) String ¶
func (r HeadingLine) String() string
func (HeadingLine) Type ¶
func (r HeadingLine) Type() LineType
type Line ¶
type Line interface { CoreType() LineType // CoreType returns the core type of the line (returns Text Type for advanced line types) Type() LineType // Type returns the true type of the line Level() int // Level returns the level of the heading, if it's a HeadingType, or 0 otherwise Data() string // Data returns the content data of the line Meta() string // Meta returns the secondary data of the line (e.g the link for link lines), if any Prefix() string // Prefix returns the documented prefix to the line, without whitespace String() string // String (Stringer) implements a post-formatted representation of the original line, including prefix }
Line represents a Line in text/gemini in a logical way
type LinkLine ¶
type LinkLine struct {
// contains filtered or unexported fields
}
LinkLine represents a link text/gemini line
type Parser ¶
type Parser struct { Lines []Line // contains filtered or unexported fields }
Parser handles parsing of a text/gemini document
func (*Parser) Parse ¶
Parse will parse the provided input until termination The returned error will be non-nil only if a significant error occured
type PreformatLine ¶
type PreformatLine string
PreformatLine represents a preformatted text/gemini line
func (PreformatLine) CoreType ¶
func (r PreformatLine) CoreType() LineType
func (PreformatLine) Data ¶
func (r PreformatLine) Data() string
func (PreformatLine) Level ¶
func (r PreformatLine) Level() int
func (PreformatLine) Meta ¶
func (r PreformatLine) Meta() string
func (PreformatLine) Prefix ¶
func (r PreformatLine) Prefix() string
func (PreformatLine) String ¶
func (r PreformatLine) String() string
func (PreformatLine) Type ¶
func (r PreformatLine) Type() LineType
type PreformatToggleLine ¶
type PreformatToggleLine string
PreformatToggleLine represents a "```" toggle in text/gemini
func (PreformatToggleLine) CoreType ¶
func (r PreformatToggleLine) CoreType() LineType
func (PreformatToggleLine) Data ¶
func (r PreformatToggleLine) Data() string
func (PreformatToggleLine) Level ¶
func (r PreformatToggleLine) Level() int
func (PreformatToggleLine) Meta ¶
func (r PreformatToggleLine) Meta() string
func (PreformatToggleLine) Prefix ¶
func (r PreformatToggleLine) Prefix() string
func (PreformatToggleLine) String ¶
func (r PreformatToggleLine) String() string
func (PreformatToggleLine) Type ¶
func (r PreformatToggleLine) Type() LineType
type UnorderedListLine ¶
type UnorderedListLine string
UnorderedListLine represents an unordered list entry in text/gemini
func (UnorderedListLine) CoreType ¶
func (r UnorderedListLine) CoreType() LineType
func (UnorderedListLine) Data ¶
func (r UnorderedListLine) Data() string
func (UnorderedListLine) Level ¶
func (r UnorderedListLine) Level() int
func (UnorderedListLine) Meta ¶
func (r UnorderedListLine) Meta() string
func (UnorderedListLine) Prefix ¶
func (r UnorderedListLine) Prefix() string
func (UnorderedListLine) String ¶
func (r UnorderedListLine) String() string
func (UnorderedListLine) Type ¶
func (r UnorderedListLine) Type() LineType
Click to show internal directories.
Click to hide internal directories.