types

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// AttrDocType the "doctype" attribute
	AttrDocType = "doctype"
	// AttrDocType the "description" attribute
	AttrDescription = "description"
	// AttrSyntaxHighlighter the attribute to define the syntax highlighter on code source blocks
	AttrSyntaxHighlighter = "source-highlighter"
	// AttrChromaClassPrefix the class prefix used by Chroma when rendering source code (default: `tok-`)
	AttrChromaClassPrefix = "chroma-class-prefix"
	// AttrID the key to retrieve the ID
	AttrID = "id"
	// AttrIDPrefix the key to retrieve the ID Prefix
	AttrIDPrefix = "idprefix"
	// DefaultIDPrefix the default ID Prefix
	DefaultIDPrefix = "_"
	// AttrIDSeparator the key to retrieve the ID Separator
	AttrIDSeparator = "idseparator"
	// DefaultIDSeparator the default ID Separator
	DefaultIDSeparator = "_"
	// AttrNumbered the `numbered` attribute to trigger section numbering at renderding time
	AttrNumbered = "numbered"
	// AttrSectionNumbers the `sectnums` attribute to trigger section numbering at renderding time (an alias for `numbered`)
	AttrSectionNumbering = "sectnums"
	// AttrTableOfContents the `toc` attribute at document level
	AttrTableOfContents = "toc"
	// AttrTableOfContentsLevels the document attribute which specifies the number of levels to display in the ToC
	AttrTableOfContentsLevels = "toclevels"
	// AttrTableOfContentsTitle the document attribute which specifies the title of the table of contents
	AttrTableOfContentsTitle = "toc-title"
	// AttrNoHeader attribute to disable the rendering of document footer
	AttrNoHeader = "noheader"
	// AttrNoFooter attribute to disable the rendering of document footer
	AttrNoFooter = "nofooter"
	// AttrCustomID the key to retrieve the flag that indicates if the element ID is custom or generated
	// AttrCustomID = "@customID"
	// AttrTitle the key to retrieve the title
	AttrTitle = "title"
	// AttrAuthors the key to the authors declared after the section level 0 (at the beginning of the doc)
	AttrAuthors = "authors"
	// AttrAuthor the key to the author's full name declared as a standalone attribute
	AttrAuthor = "author"
	// AttrAuthor the key to the author's email address declared as a standalone attribute
	AttrEmail = "email"
	// AttrRevision the key to the revision declared after the section level 0 (at the beginning of the doc)
	// or as a standalone attribute
	AttrRevision = "revision"
	// AttrRole the key for a single role attribute
	AttrRole = "role"
	// AttrRoles the key to retrieve the roles attribute
	AttrRoles = "roles"
	// AttrOption the key for a single option attribute
	AttrOption = "option"
	// AttrOptions the key to retrieve the options attribute
	AttrOptions = "options"
	// AttrOpts alias for AttrOptions
	AttrOpts = "opts"
	// AttrInlineLink the key to retrieve the link
	AttrInlineLink = "link"
	// AttrQuoteAuthor attribute for the author of a verse
	AttrQuoteAuthor = "quoteAuthor"
	// AttrQuoteTitle attribute for the title of a verse
	AttrQuoteTitle = "quoteTitle"
	// AttrSource the `source` attribute for a source block or a source paragraph (this is a placeholder, ie, it does not expect any value for this attribute)
	AttrSource = "source"
	// AttrLanguage the `language` attribute for a source block or a source paragraph
	AttrLanguage = "language"
	// AttrLineNums the `linenums` attribute for a source block or a source paragraph
	AttrLineNums = "linenums"
	// AttrCheckStyle the attribute to mark the first element of an unordered list item as a checked or not
	AttrCheckStyle = "checkstyle"
	// AttrInteractive the attribute to mark the first element of an unordered list item as n interactive checkbox or not
	// (paired with `AttrCheckStyle`)
	AttrInteractive = "interactive"
	// AttrStart the `start` attribute in an ordered list
	AttrStart = "start"
	// AttrLevelOffset the `leveloffset` attribute used in file inclusions
	AttrLevelOffset = "leveloffset"
	// AttrLineRanges the `lines` attribute used in file inclusions
	AttrLineRanges = "lines"
	// AttrTagRanges the `tag`/`tags` attribute used in file inclusions
	AttrTagRanges = "tags"
	// AttrLastUpdated the "last updated" data in the document, i.e., the output/generation time
	AttrLastUpdated = "LastUpdated"
	// AttrImageAlt the image `alt` attribute
	AttrImageAlt = "alt"
	// AttrHeight the image `height` attribute
	AttrHeight = "height"
	// AttrImageWindow the `window` attribute, which becomes the target for the link
	AttrImageWindow = "window"
	// AttrImageAlign is for image alignment
	AttrImageAlign = "align"
	// AttrIconSize the icon `size`, and can be one of 1x, 2x, 3x, 4x, 5x, lg, fw
	AttrIconSize = "size"
	// AttrIconRotate the icon `rotate` attribute, and can be one of 90, 180, or 270
	AttrIconRotate = "rotate"
	// AttrIconFlip the icon `flip` attribute, and if set can be "horizontal" or "vertical"
	AttrIconFlip = "flip"
	// AttrUnicode local libasciidoc attribute to encode output as UTF-8 instead of ASCII.
	AttrUnicode = "unicode"
	// AttrCaption is the caption for block images, tables, and so forth
	AttrCaption = "caption"
	// AttrStyle paragraph, block or list style
	AttrStyle = "style"
	// AttrInlineLinkText the text attribute (first positional) of links
	AttrInlineLinkText = "text"
	// AttrInlineLinkTarget the 'window' attribute
	AttrInlineLinkTarget = "window"
	// AttrWidth the `width` attribute used ior images, tables, and so forth
	AttrWidth = "width"
	// AttrFrame the frame used mostly for tables (all, topbot, sides, none)
	AttrFrame = "frame"
	// AttrGrid the grid (none, all, cols, rows) in tables
	AttrGrid = "grid"
	// AttrStripes controls table row background (even, odd, all, none, hover)
	AttrStripes = "stripes"
	// AttrFloat is for image or table float (text flows around)
	AttrFloat = "float"
	// AttrCols the table columns attribute
	AttrCols = "cols"
	// AttrAutoWidth the `autowidth` attribute on a table
	AttrAutoWidth = "autowidth"
	// AttrPositionalIndex positional parameter index
	AttrPositionalIndex = "@positional-"
	// AttrPositional1 positional parameter 1
	AttrPositional1 = "@positional-1"
	// AttrPositional2 positional parameter 2
	AttrPositional2 = "@positional-2"
	// AttrPositional3 positional parameter 3
	AttrPositional3 = "@positional-3"
	// AttrVersionLabel labels the version number in the document
	AttrVersionLabel = "version-label"
	// AttrExampleCaption is the example caption
	AttrExampleCaption = "example-caption"
	// AttrFigureCaption is the figure (image) caption
	AttrFigureCaption = "figure-caption"
	// AttrTableCaption is the table caption
	AttrTableCaption = "table-caption"
	// AttrCautionCaption is the CAUTION caption
	AttrCautionCaption = "caution-caption"
	// AttrImportantCaption is the IMPORTANT caption
	AttrImportantCaption = "important-caption"
	// AttrNoteCaption is the NOTE caption
	AttrNoteCaption = "note-caption"
	// AttrTipCaption is the TIP caption
	AttrTipCaption = "tip-caption"
	// AttrWarningCaption is the TIP caption
	AttrWarningCaption = "warning-caption"
	// AttrSubstitutions the "subs" attribute to configure substitutions on delimited blocks and paragraphs
	AttrSubstitutions = "subs"
	// AttrImagesDir the `imagesdir` attribute
	AttrImagesDir = "imagesdir"
	// AttrXRefLabel the label of a cross reference
	AttrXRefLabel = "xrefLabel"
	// AttrExperimental a flag to enable experiment macros (for UI)
	AttrExperimental = "experimental"
	// AttrButtonLabel the label of a button
	AttrButtonLabel = "label"
	// AttrHardBreaks the attribute to set on a paragraph to render with hard breaks on each line
	AttrHardBreaks = "hardbreaks"
)
View Source
const (
	// TODO: define a `NumberingStyle` type
	// Arabic the arabic numbering (1, 2, 3, etc.)
	Arabic = "arabic"
	// LowerAlpha the lower-alpha numbering (a, b, c, etc.)
	LowerAlpha = "loweralpha"
	// UpperAlpha the upper-alpha numbering (A, B, C, etc.)
	UpperAlpha = "upperalpha"
	// LowerRoman the lower-roman numbering (i, ii, iii, etc.)
	LowerRoman = "lowerroman"
	// UpperRoman the upper-roman numbering (I, II, III, etc.)
	UpperRoman = "upperroman"
)
View Source
const (
	// Tip the 'TIP' type of admonition
	Tip string = "TIP"
	// Note the 'NOTE' type of admonition
	Note string = "NOTE"
	// Important the 'IMPORTANT' type of admonition
	Important string = "IMPORTANT"
	// Warning the 'WARNING' type of admonition
	Warning string = "WARNING"
	// Caution the 'CAUTION' type of admonition
	Caution string = "CAUTION"
)

TODO: use custom `AdmonitionKind` type

View Source
const (
	// Fenced a fenced block
	Fenced string = "fenced"
	// Listing a listing block
	Listing string = "listing"
	// Example an example block
	Example string = "example"
	// Comment a comment block
	Comment string = "comment"
	// Quote a quote block
	Quote string = "quote"
	// MarkdownCode a code block in the Markdown style
	MarkdownCode string = "markdown-code"
	// MarkdownQuote a quote block in the Markdown style
	MarkdownQuote string = "markdown-quote"
	// Open an Open block
	Open string = "open"
	// Verse a verse block
	Verse string = "verse"
	// Sidebar a sidebar block
	Sidebar string = "sidebar"
	// Literal a literal block
	Literal string = "literal"
	// LiteralParagraph a literal parsgraph
	LiteralParagraph = "literal_paragraph"
	// Source a source block
	Source string = "source"
	// Passthrough a passthrough block
	Passthrough string = "pass"
)

TODO: use custom `BlockKind` type

View Source
const (
	// SingleQuoteBold bold quoted text (wrapped with '*')
	SingleQuoteBold = QuotedTextKind("*")
	// DoubleQuoteBold bold quoted text (wrapped with '**')
	DoubleQuoteBold = QuotedTextKind("**")
	// SingleQuoteItalic italic quoted text (wrapped with '_')
	SingleQuoteItalic = QuotedTextKind("_")
	// DoubleQuoteItalic italic quoted text (wrapped with '__')
	DoubleQuoteItalic = QuotedTextKind("__")
	// SingleQuoteMarked text highlighter (wrapped with '#')
	SingleQuoteMarked = QuotedTextKind("#")
	// DoubleQuoteMarked text highlighter (wrapped '##')
	DoubleQuoteMarked = QuotedTextKind("##")
	// SingleQuoteMonospace monospace quoted text (wrapped with '`')
	SingleQuoteMonospace = QuotedTextKind("`")
	// DoubleQuoteMonospace monospace quoted text (wrapped with '“')
	DoubleQuoteMonospace = QuotedTextKind("``")
	// SingleQuoteSubscript subscript quoted text (wrapped with '~')
	SingleQuoteSubscript = QuotedTextKind("~")
	// SingleQuoteSuperscript superscript quoted text (wrapped with '^')
	SingleQuoteSuperscript = QuotedTextKind("^")
)
View Source
const (
	// SinglePlusPassthrough a passthrough with a single `+` punctuation
	SinglePlusPassthrough = PassthroughKind("+")
	// TriplePlusPassthrough a passthrough with a triple `+++` punctuation
	TriplePlusPassthrough = PassthroughKind("+++")
	// PassthroughMacro a passthrough with the `pass:[]` macro
	PassthroughMacro = PassthroughKind("pass:[]")
)
View Source
const (
	// InvalidFootnoteReference a constant to mark the footnote reference as invalid
	InvalidFootnoteReference int = -1
)

Variables

View Source
var EqualOperand = func(left, right interface{}) bool {
	if log.IsLevelEnabled(log.DebugLevel) {
		log.Debugf("comparing %v==%v", left, right)
	}

	if left, ok := left.(string); ok {
		if right, ok := right.(string); ok {
			return left == right
		}
	}

	if left, ok := left.(float64); ok {
		if right, ok := right.(float64); ok {
			return left == right
		}
	}

	if left, ok := left.(int); ok {
		if right, ok := right.(int); ok {
			return left == right
		}
	}
	return false
}
View Source
var GreaterOrEqualOperand = func(left, right interface{}) bool {
	if log.IsLevelEnabled(log.DebugLevel) {
		log.Debugf("comparing %v>=%v", left, right)
	}

	if left, ok := left.(string); ok {
		if right, ok := right.(string); ok {
			return left >= right
		}
	}

	if left, ok := left.(float64); ok {
		if right, ok := right.(float64); ok {
			return left >= right
		}
	}

	if left, ok := left.(int); ok {
		if right, ok := right.(int); ok {
			return left >= right
		}
	}
	return false
}
View Source
var GreaterThanOperand = func(left, right interface{}) bool {
	if log.IsLevelEnabled(log.DebugLevel) {
		log.Debugf("comparing %v>%v", left, right)
	}

	if left, ok := left.(string); ok {
		if right, ok := right.(string); ok {
			return left > right
		}
	}

	if left, ok := left.(float64); ok {
		if right, ok := right.(float64); ok {
			return left > right
		}
	}

	if left, ok := left.(int); ok {
		if right, ok := right.(int); ok {
			return left > right
		}
	}
	return false
}
View Source
var LessOrEqualOperand = func(left, right interface{}) bool {
	if log.IsLevelEnabled(log.DebugLevel) {
		log.Debugf("comparing %v<=%v", left, right)
	}

	if left, ok := left.(string); ok {
		if right, ok := right.(string); ok {
			return left <= right
		}
	}

	if left, ok := left.(float64); ok {
		if right, ok := right.(float64); ok {
			return left <= right
		}
	}

	if left, ok := left.(int); ok {
		if right, ok := right.(int); ok {
			return left <= right
		}
	}
	return false
}
View Source
var LessThanOperand = func(left, right interface{}) bool {
	if log.IsLevelEnabled(log.DebugLevel) {
		log.Debugf("comparing %v<%v", left, right)
	}

	if left, ok := left.(string); ok {
		if right, ok := right.(string); ok {
			return left < right
		}
	}

	if left, ok := left.(float64); ok {
		if right, ok := right.(float64); ok {
			return left < right
		}
	}

	if left, ok := left.(int); ok {
		if right, ok := right.(int); ok {
			return left < right
		}
	}
	return false
}
View Source
var NotEqualOperand = func(left, right interface{}) bool {
	if log.IsLevelEnabled(log.DebugLevel) {
		log.Debugf("comparing %v!=%v", left, right)
	}

	if left, ok := left.(string); ok {
		if right, ok := right.(string); ok {
			return left != right
		}
	}

	if left, ok := left.(float64); ok {
		if right, ok := right.(float64); ok {
			return left != right
		}
	}

	if left, ok := left.(int); ok {
		if right, ok := right.(int); ok {
			return left != right
		}
	}
	return false
}

Functions

func AllNilEntries added in v0.7.0

func AllNilEntries(elements []interface{}) bool

AllNilEntries returns true if all the entries in the given `elements` are `nil`

func Append added in v0.7.0

func Append(elements ...interface{}) ([]interface{}, error)

Append appends all given elements. If an element is an `[]interface{}`, then it appends its content

func Apply added in v0.3.0

func Apply(source string, fs ...applyFunc) string

Apply applies the given funcs to transform the given input

func Flatten added in v0.7.0

func Flatten(elements []interface{}) []interface{}

Flatten

func HasAttributeWithValue added in v0.6.0

func HasAttributeWithValue(attributes interface{}, key string, value interface{}) bool

HasAttributeWithValue checks that there is an entry for the given key/value pair

func HasNotAttribute added in v0.6.0

func HasNotAttribute(attributes interface{}, key string) bool

HasNotAttribute checks that there is no entry for the given key

func InsertAt added in v0.7.0

func InsertAt(elements []interface{}, element interface{}, index int) []interface{}

InsertAt inserts the given element in the target at the given index (thus moving all following elements by 1)

func NewAttributeReference added in v0.8.0

func NewAttributeReference(name, rawText string) (interface{}, error)

NewAttributeReference initializes a new Attribute Reference

func NewEscapedQuotedText

func NewEscapedQuotedText(backslashes string, marker string, content interface{}) ([]interface{}, error)

NewEscapedQuotedText returns a new []interface{} where the nested elements are preserved (ie, substituted as expected)

func NewInlineElements

func NewInlineElements(elements ...interface{}) ([]interface{}, error)

NewInlineElements initializes a new `InlineElements` from the given values

func Reduce added in v0.5.0

func Reduce(elements interface{}, opts ...ReduceOption) interface{}

Reduce merges and returns a string if the given elements only contain a single StringElement (ie, return its `Content`), otherwise return the given elements or empty string if the elements is `nil` or an empty `[]interface{}`

func ReplaceNonAlphanumerics added in v0.3.0

func ReplaceNonAlphanumerics(content interface{}, prefix, separator string) (string, error)

ReplaceNonAlphanumerics replace all non alpha numeric characters with the given `replacement`

func SplitElementsPerLine added in v0.7.0

func SplitElementsPerLine(elements []interface{}) [][]interface{}

func TrimTrailingSpaces added in v0.8.0

func TrimTrailingSpaces(content []interface{}) []interface{}

TrimTrailingSpaces trims trailing spaces on the last element (if applicable)

Types

type Attribute added in v0.6.0

type Attribute struct {
	Key   string
	Value interface{}
}

Attribute is a key/value pair wrapper

func NewIDAttribute added in v0.6.0

func NewIDAttribute(value interface{}) (*Attribute, error)

NewIDAttribute initializes a new attribute map with a single entry for the ID using the given value

func NewNamedAttribute added in v0.6.0

func NewNamedAttribute(key string, value interface{}) (*Attribute, error)

NewNamedAttribute a named (or positional) element

func NewOptionAttribute added in v0.6.0

func NewOptionAttribute(option interface{}) (*Attribute, error)

NewOptionAttribute sets a boolean option.

func NewRoleAttribute added in v0.6.0

func NewRoleAttribute(value interface{}) (*Attribute, error)

NewRoleAttribute initializes a new attribute map with a single entry for the title using the given value

func NewTitleAttribute added in v0.6.0

func NewTitleAttribute(value interface{}) (*Attribute, error)

NewTitleAttribute initializes a new attribute map with a single entry for the title using the given value

type AttributeDeclaration added in v0.5.0

type AttributeDeclaration struct {
	Name  string
	Value interface{}
	// contains filtered or unexported fields
}

AttributeDeclaration the type for Document Attribute Declarations

func NewAttributeDeclaration added in v0.5.0

func NewAttributeDeclaration(name string, value interface{}, rawText string) (*AttributeDeclaration, error)

NewAttributeDeclaration initializes a new AttributeDeclaration with the given name and optional value

func (*AttributeDeclaration) RawText added in v0.7.0

func (a *AttributeDeclaration) RawText() string

type AttributeReference added in v0.7.0

type AttributeReference struct {
	Name string
	// contains filtered or unexported fields
}

AttributeReference the type for AttributeReference

type AttributeReset added in v0.5.0

type AttributeReset struct {
	Name string
	// contains filtered or unexported fields
}

AttributeReset the type for AttributeReset

func NewAttributeReset added in v0.5.0

func NewAttributeReset(attrName string, rawText string) (*AttributeReset, error)

NewAttributeReset initializes a new Document Attribute Resets.

func (*AttributeReset) RawText added in v0.7.0

func (a *AttributeReset) RawText() string

type Attributes added in v0.5.0

type Attributes map[string]interface{}

Attributes the element attributes a map[string]interface{} with some utility methods

func MergeAttributes added in v0.7.0

func MergeAttributes(attributes ...interface{}) (Attributes, error)

func NewAttributes added in v0.5.0

func NewAttributes(attributes ...interface{}) (Attributes, error)

NewAttributes retrieves the ElementID, ElementTitle and ElementInlineLink from the given slice of attributes

func (Attributes) AddAll added in v0.7.0

func (a Attributes) AddAll(others Attributes) Attributes

NilIfEmpty returns `nil` if this `attributes` is empty

func (Attributes) Clone added in v0.7.0

func (a Attributes) Clone() Attributes

func (Attributes) GetAsBoolWithDefault added in v0.7.0

func (a Attributes) GetAsBoolWithDefault(key string, defaultValue bool) bool

GetAsBoolWithDefault gets the bool value for the given key , or default if none was found,

func (Attributes) GetAsIntWithDefault added in v0.7.0

func (a Attributes) GetAsIntWithDefault(key string, defaultValue int) int

GetAsIntWithDefault gets the int value for the given key , or default if none was found,

func (Attributes) GetAsString added in v0.5.0

func (a Attributes) GetAsString(k string) (string, bool)

GetAsString gets the string value for the given key (+ `true`), or empty string (+ `false`) if none was found

func (Attributes) GetAsStringWithDefault added in v0.5.0

func (a Attributes) GetAsStringWithDefault(key, defaultValue string) string

GetAsStringWithDefault gets the string value for the given key, or returns the given default value

func (Attributes) Has added in v0.5.0

func (a Attributes) Has(key string) bool

Has returns the true if an entry with the given key exists

func (Attributes) HasOption added in v0.5.0

func (a Attributes) HasOption(key string) bool

HasOption returns true if the option is set.

func (Attributes) Set added in v0.5.0

func (a Attributes) Set(key string, value interface{}) Attributes

Set adds the given attribute to the current ones with some `key` replacements/grouping (Role->Roles and Option->Options) returns the new `Attributes` if the current instance was `nil`

func (Attributes) SetAll added in v0.6.0

func (a Attributes) SetAll(attr interface{}) Attributes

SetAll adds the given attributes to the current ones

func (Attributes) Unset added in v0.8.0

func (a Attributes) Unset(key string)

type BlankLine

type BlankLine struct {
}

BlankLine the structure for the empty lines, which are used to separate logical blocks

func NewBlankLine

func NewBlankLine() (*BlankLine, error)

NewBlankLine initializes a new `BlankLine`

type BlockDelimiter added in v0.7.0

type BlockDelimiter struct {
	Kind       string
	Length     int
	Attributes Attributes
	// contains filtered or unexported fields
}

func NewBlockDelimiter added in v0.7.0

func NewBlockDelimiter(kind string, length int, rawText string) (*BlockDelimiter, error)

func NewMarkdownCodeBlockDelimiter added in v0.7.0

func NewMarkdownCodeBlockDelimiter(language, rawText string) (*BlockDelimiter, error)

func (*BlockDelimiter) RawText added in v0.7.0

func (b *BlockDelimiter) RawText() string

type Callout added in v0.5.0

type Callout struct {
	Ref int
}

Callout a reference at the end of a line in a delimited block with verbatim content (eg: listing, source code)

func NewCallout added in v0.5.0

func NewCallout(ref int) (*Callout, error)

NewCallout returns a new Callout with the given reference

type CalloutListElement added in v0.7.0

type CalloutListElement struct {
	Attributes Attributes
	Ref        int
	Elements   []interface{}
}

CalloutListElement the description of a call out which will appear as an ordered list item after the delimited block

func NewCalloutListElement added in v0.7.0

func NewCalloutListElement(ref int, content *Paragraph) (*CalloutListElement, error)

NewCalloutListElement returns a new CalloutListElement

func (*CalloutListElement) AddAttributes added in v0.7.0

func (e *CalloutListElement) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*CalloutListElement) AddElement added in v0.7.0

func (e *CalloutListElement) AddElement(element interface{}) error

AddElement add an element to this UnorderedListElement

func (*CalloutListElement) AdjustStyle added in v0.7.0

func (e *CalloutListElement) AdjustStyle(l *List)

func (*CalloutListElement) GetAttributes added in v0.7.0

func (e *CalloutListElement) GetAttributes() Attributes

GetAttributes returns the attributes of this element

func (*CalloutListElement) GetElements added in v0.7.0

func (e *CalloutListElement) GetElements() []interface{}

GetElements returns this CalloutListElement's elements

func (*CalloutListElement) LastElement added in v0.7.0

func (e *CalloutListElement) LastElement() interface{}

func (*CalloutListElement) ListKind added in v0.7.0

func (e *CalloutListElement) ListKind() ListKind

ListKind returns the kind of list to which this element shall be attached

func (*CalloutListElement) Reference added in v0.7.0

func (e *CalloutListElement) Reference(refs ElementReferences)

func (*CalloutListElement) SetAttributes added in v0.7.0

func (e *CalloutListElement) SetAttributes(attributes Attributes)

SetAttributes sets the attributes of this element

func (*CalloutListElement) SetElements added in v0.7.0

func (e *CalloutListElement) SetElements(elements []interface{}) error

SetElements sets this CalloutListElement's elements

func (*CalloutListElement) SubstituteFootnotes added in v0.7.0

func (e *CalloutListElement) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the list element with footnote references. The footnotes are stored in the given 'notes' param

type ConcealedIndexTerm added in v0.3.0

type ConcealedIndexTerm struct {
	Term1 interface{}
	Term2 interface{}
	Term3 interface{}
}

ConcealedIndexTerm a concealed index term, with 1 required and 2 optional terms

func NewConcealedIndexTerm added in v0.3.0

func NewConcealedIndexTerm(term1, term2, term3 interface{}) (*ConcealedIndexTerm, error)

NewConcealedIndexTerm returns a new ConcealedIndexTerm

type ConditionalInclusion added in v0.7.0

type ConditionalInclusion interface {
	Eval(attributes map[string]interface{}) bool
	SingleLineContent() (string, bool)
}

type ContentStyle added in v0.7.0

type ContentStyle string
const (
	AsciidocStyle  ContentStyle = "a"
	DefaultStyle   ContentStyle = "d"
	EmphasisStyle  ContentStyle = "e"
	HeaderStyle    ContentStyle = "h"
	LiteralStyle   ContentStyle = "l"
	MonospaceStyle ContentStyle = "m"
	StrongStyle    ContentStyle = "s"
)

type CounterSubstitution added in v0.5.0

type CounterSubstitution struct {
	Name   string
	Hidden bool
	Value  interface{} // may be a byte for character
	// contains filtered or unexported fields
}

CounterSubstitution is a counter, that may increment when it is substituted. If Increment is set, then it will increment before being expanded.

func NewCounterSubstitution added in v0.5.0

func NewCounterSubstitution(name string, hidden bool, val interface{}, rawText string) (*CounterSubstitution, error)

NewCounterSubstitution returns a counter substitution.

type CurrentRanges added in v0.3.0

type CurrentRanges map[string]*CurrentTagRange

CurrentRanges the current ranges, ie, as they are "discovered" while processing one line at a time in the file to include

type CurrentTagRange added in v0.3.0

type CurrentTagRange struct {
	StartLine int
	EndLine   int
}

CurrentTagRange a tag range found while processing a document. When the 'start' tag is found, the `EndLine` is still unknown and thus its value is set to `-1`.

type DelimitedBlock

type DelimitedBlock struct {
	Kind       string
	Attributes Attributes
	Elements   []interface{}
}

DelimitedBlock the structure for the Listing blocks

func NewDelimitedBlock

func NewDelimitedBlock(kind string, elements []interface{}) (*DelimitedBlock, error)

func (*DelimitedBlock) AddAttributes

func (b *DelimitedBlock) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*DelimitedBlock) GetAttributes added in v0.7.0

func (b *DelimitedBlock) GetAttributes() Attributes

GetAttributes returns the attributes of this paragraph so that substitutions can be applied onto them

func (*DelimitedBlock) GetElements added in v0.7.0

func (b *DelimitedBlock) GetElements() []interface{}

GetElements returns this paragraph's elements (or lines)

func (*DelimitedBlock) Reference added in v0.7.0

func (b *DelimitedBlock) Reference(refs ElementReferences)

func (*DelimitedBlock) SetAttributes added in v0.7.0

func (b *DelimitedBlock) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*DelimitedBlock) SetElements added in v0.7.0

func (b *DelimitedBlock) SetElements(elements []interface{}) error

SetElements sets this block's elements

type Document

type Document struct {
	Elements          []interface{}
	ElementReferences ElementReferences
	Footnotes         []*Footnote
	TableOfContents   *TableOfContents
}

Document the top-level structure for a document

func (*Document) AddElement added in v0.7.0

func (d *Document) AddElement(element interface{}) error

func (*Document) BodyElements added in v0.7.0

func (d *Document) BodyElements() []interface{}

BodyElements returns the elements to render in the body

func (*Document) FrontMatter added in v0.8.0

func (d *Document) FrontMatter() *FrontMatter

FrontMatter returns the FrontMatter element if it is in the first position in the document, `nil` otherwise.

func (*Document) Header added in v0.3.0

func (d *Document) Header() (*DocumentHeader, int)

Header returns the header, i.e., the section with level 0 if it found as the first element of the document For manpage documents, this also includes the first section (`Name` along with its first paragraph) also returns the position of the DocumentHeader element in the Document's Elements (in case there's a FrontMatter before, for example)

func (*Document) SectionNumbers added in v0.8.0

func (d *Document) SectionNumbers() (SectionNumbers, error)

type DocumentAuthor

type DocumentAuthor struct {
	*DocumentAuthorFullName
	Email string
}

DocumentAuthor a document author

func NewDocumentAuthor

func NewDocumentAuthor(fullName, email interface{}) (*DocumentAuthor, error)

NewDocumentAuthor initializes a new DocumentAuthor

type DocumentAuthorFullName added in v0.7.0

type DocumentAuthorFullName struct {
	FirstName  string
	MiddleName string
	LastName   string
}

func NewDocumentAuthorFullName added in v0.7.0

func NewDocumentAuthorFullName(part1 string, part2, part3 interface{}) (*DocumentAuthorFullName, error)

func (*DocumentAuthorFullName) FullName added in v0.7.0

func (n *DocumentAuthorFullName) FullName() string

func (*DocumentAuthorFullName) Initials added in v0.7.0

func (n *DocumentAuthorFullName) Initials() string

type DocumentAuthors added in v0.7.0

type DocumentAuthors []*DocumentAuthor

func NewDocumentAuthors

func NewDocumentAuthors(authors ...interface{}) (DocumentAuthors, error)

NewDocumentAuthors converts the given authors into an array of `DocumentAuthor`

func (DocumentAuthors) Expand added in v0.7.0

func (authors DocumentAuthors) Expand() Attributes

Expand returns a map of attributes for the given authors. those attributes can be used in attribute substitutions in the document

type DocumentAuthorsAndRevision added in v0.7.0

type DocumentAuthorsAndRevision struct {
	Authors  DocumentAuthors
	Revision *DocumentRevision
}

func NewDocumentAuthorsAndRevision added in v0.7.0

func NewDocumentAuthorsAndRevision(authors DocumentAuthors, revision interface{}) (*DocumentAuthorsAndRevision, error)

type DocumentElement

type DocumentElement interface {
	GetAttributes() Attributes
}

DocumentElement a document element can have attributes

type DocumentFragment added in v0.7.0

type DocumentFragment struct {
	Position Position
	Elements []interface{}
	Error    error
}

DocumentFragment a single fragment of document

func NewDocumentFragment added in v0.7.0

func NewDocumentFragment(p Position, elements ...interface{}) DocumentFragment

func NewErrorFragment added in v0.7.0

func NewErrorFragment(p Position, err error) DocumentFragment

type DocumentHeader

type DocumentHeader struct {
	Title      []interface{}
	Attributes Attributes
	Elements   []interface{}
}

func NewDocumentHeader

func NewDocumentHeader(title []interface{}, ar interface{}, extraAttrs []interface{}) (*DocumentHeader, error)

func (*DocumentHeader) AddAttributes added in v0.7.0

func (h *DocumentHeader) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this CalloutListElement

func (*DocumentHeader) Authors added in v0.7.0

func (h *DocumentHeader) Authors() DocumentAuthors

func (*DocumentHeader) GetAttributes added in v0.7.0

func (h *DocumentHeader) GetAttributes() Attributes

func (*DocumentHeader) GetElements added in v0.7.0

func (h *DocumentHeader) GetElements() []interface{}

func (*DocumentHeader) GetTitle added in v0.7.0

func (h *DocumentHeader) GetTitle() []interface{}

func (*DocumentHeader) IsEmpty added in v0.7.0

func (h *DocumentHeader) IsEmpty() bool

func (*DocumentHeader) Revision added in v0.7.0

func (h *DocumentHeader) Revision() *DocumentRevision

func (*DocumentHeader) SetAttributes added in v0.7.0

func (h *DocumentHeader) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*DocumentHeader) SetElements added in v0.7.0

func (h *DocumentHeader) SetElements(elements []interface{}) error

func (*DocumentHeader) SetTitle added in v0.7.0

func (h *DocumentHeader) SetTitle(title []interface{})

type DocumentRevision

type DocumentRevision struct {
	Revnumber string
	Revdate   string
	Revremark string
}

DocumentRevision a document revision

func NewDocumentRevision

func NewDocumentRevision(revnumber, revdate, revremark interface{}) (*DocumentRevision, error)

NewDocumentRevision intializes a new DocumentRevision

func (*DocumentRevision) Expand added in v0.7.0

func (r *DocumentRevision) Expand() Attributes

Expand returns a map of attributes for the given revision. those attributes can be used in attribute substitutions in the document

type ElementPlaceHolder added in v0.5.0

type ElementPlaceHolder struct {
	Ref string
}

ElementPlaceHolder a placeholder for elements which may have been parsed during previous substitution, and which are substituted with a placeholder while serializing the content to parse with the "macros" substitution

func NewElementPlaceHolder added in v0.5.0

func NewElementPlaceHolder(ref string) (*ElementPlaceHolder, error)

NewElementPlaceHolder returns a new ElementPlaceHolder with the given reference.

func (*ElementPlaceHolder) String added in v0.5.0

func (p *ElementPlaceHolder) String() string

type ElementReferences

type ElementReferences map[string]interface{}

ElementReferences the element references in the document

type EndOfCondition added in v0.7.0

type EndOfCondition struct{}

func NewEndOfCondition added in v0.7.0

func NewEndOfCondition() (*EndOfCondition, error)

type ExternalCrossReference added in v0.3.0

type ExternalCrossReference struct {
	Location   *Location
	Attributes Attributes
}

ExternalCrossReference the struct for Cross References

func NewExternalCrossReference added in v0.3.0

func NewExternalCrossReference(location *Location, attributes interface{}) (*ExternalCrossReference, error)

NewExternalCrossReference initializes a new `InternalCrossReference` from the given ID

func (*ExternalCrossReference) AddAttributes added in v0.7.0

func (x *ExternalCrossReference) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this CalloutListElement

func (*ExternalCrossReference) GetAttributes added in v0.7.0

func (x *ExternalCrossReference) GetAttributes() Attributes

GetAttributes returns the attributes of this paragraph so that substitutions can be applied onto them

func (*ExternalCrossReference) GetLocation added in v0.7.0

func (x *ExternalCrossReference) GetLocation() *Location

func (*ExternalCrossReference) SetAttributes added in v0.7.0

func (x *ExternalCrossReference) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

type FileInclusion added in v0.3.0

type FileInclusion struct {
	Attributes Attributes
	Location   *Location
	RawText    string
}

FileInclusion the structure for the file inclusions

func NewFileInclusion added in v0.3.0

func NewFileInclusion(location *Location, attributes interface{}, rawText string) (*FileInclusion, error)

NewFileInclusion initializes a new inline `FileInclusion`

func (*FileInclusion) AddAttributes added in v0.7.0

func (f *FileInclusion) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this CalloutListElement

func (*FileInclusion) GetAttributes added in v0.7.0

func (f *FileInclusion) GetAttributes() Attributes

GetAttributes returns this elements's attributes

func (*FileInclusion) GetLocation added in v0.7.0

func (f *FileInclusion) GetLocation() *Location

func (*FileInclusion) SetAttributes added in v0.7.0

func (f *FileInclusion) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

type Filterable added in v0.7.0

type Filterable interface {
	IsEmpty() bool
}

type Footnote

type Footnote struct {
	// ID is only set during document processing
	ID int
	// Ref the optional reference
	Ref string
	// the footnote content (can be "rich")
	Elements []interface{}
}

Footnote a foot note, without or without explicit reference (an explicit reference is used to refer multiple times to the same footnote across the document)

func NewFootnote

func NewFootnote(ref interface{}, elements []interface{}) (*Footnote, error)

NewFootnote returns a new Footnote with the given content

type FootnoteReference added in v0.4.0

type FootnoteReference struct {
	ID        int
	Ref       string // the user-specified reference (optional)
	Duplicate bool   // indicates if this reference targets an already-existing footnote // TODO: find a better name?
}

FootnoteReference a footnote reference. Substitutes the actual footnote in the document, and only contains a generated, sequential ID (which will be displayed)

type Footnotes

type Footnotes struct {
	Notes []*Footnote
	// contains filtered or unexported fields
}

Footnotes the footnotes of a document. Footnotes are "collected" during the parsing phase and displayed at the bottom of the document during the rendering.

func NewFootnotes added in v0.4.0

func NewFootnotes() *Footnotes

NewFootnotes initializes a new Footnotes

func (*Footnotes) Reference added in v0.4.0

func (f *Footnotes) Reference(note *Footnote) *FootnoteReference

Reference adds the given footnote and returns a FootnoteReference in replacement

type FrontMatter

type FrontMatter struct {
	Attributes map[string]interface{}
}

FrontMatter the structure for document front-matter

func NewYamlFrontMatter

func NewYamlFrontMatter(content string) (*FrontMatter, error)

NewYamlFrontMatter initializes a new FrontMatter from the given `content`

type HAlign added in v0.7.0

type HAlign string
const (
	HAlignDefault HAlign = HAlignLeft
	HAlignLeft    HAlign = "<" // default
	HAlignRight   HAlign = ">"
	HAlignCenter  HAlign = "^"
)

type Icon added in v0.5.0

type Icon struct {
	Class      string
	Attributes Attributes
}

Icon an icon

func NewIcon added in v0.5.0

func NewIcon(class string, attributes interface{}) (*Icon, error)

NewIcon initializes a new `Icon`

type IfdefCondition added in v0.7.0

type IfdefCondition struct {
	Name         string
	Substitution string
}

func NewIfdefCondition added in v0.7.0

func NewIfdefCondition(name string, attr interface{}) (*IfdefCondition, error)

func (*IfdefCondition) Eval added in v0.7.0

func (c *IfdefCondition) Eval(attributes map[string]interface{}) bool

func (*IfdefCondition) SingleLineContent added in v0.7.0

func (c *IfdefCondition) SingleLineContent() (string, bool)

type IfevalCondition added in v0.7.0

type IfevalCondition struct {
	Left    interface{}
	Right   interface{}
	Operand IfevalOperand
}

func NewIfevalCondition added in v0.7.0

func NewIfevalCondition(left, right interface{}, operand IfevalOperand) (*IfevalCondition, error)

func (*IfevalCondition) Eval added in v0.7.0

func (c *IfevalCondition) Eval(attributes map[string]interface{}) bool

func (*IfevalCondition) SingleLineContent added in v0.7.0

func (c *IfevalCondition) SingleLineContent() (string, bool)

type IfevalOperand added in v0.7.0

type IfevalOperand func(left, right interface{}) bool

func NewEqualOperand added in v0.7.0

func NewEqualOperand() (IfevalOperand, error)

func NewGreaterOrEqualOperand added in v0.7.0

func NewGreaterOrEqualOperand() (IfevalOperand, error)

func NewGreaterThanOperand added in v0.7.0

func NewGreaterThanOperand() (IfevalOperand, error)

func NewLessOrEqualOperand added in v0.7.0

func NewLessOrEqualOperand() (IfevalOperand, error)

func NewLessThanOperand added in v0.7.0

func NewLessThanOperand() (IfevalOperand, error)

func NewNotEqualOperand added in v0.7.0

func NewNotEqualOperand() (IfevalOperand, error)

type IfndefCondition added in v0.7.0

type IfndefCondition struct {
	Name         string
	Substitution string
}

func NewIfndefCondition added in v0.7.0

func NewIfndefCondition(name string, attr interface{}) (*IfndefCondition, error)

func (*IfndefCondition) Eval added in v0.7.0

func (c *IfndefCondition) Eval(attributes map[string]interface{}) bool

func (*IfndefCondition) SingleLineContent added in v0.7.0

func (c *IfndefCondition) SingleLineContent() (string, bool)

type ImageBlock

type ImageBlock struct {
	Location   *Location
	Attributes Attributes
}

ImageBlock the structure for the block images

func NewImageBlock

func NewImageBlock(location *Location, inlineAttributes Attributes) (*ImageBlock, error)

NewImageBlock initializes a new `ImageBlock`

func (*ImageBlock) AddAttributes

func (i *ImageBlock) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this CalloutListElement

func (*ImageBlock) GetAttributes added in v0.7.0

func (i *ImageBlock) GetAttributes() Attributes

GetAttributes returns this element's attributes

func (*ImageBlock) GetLocation added in v0.7.0

func (i *ImageBlock) GetLocation() *Location

func (*ImageBlock) Reference added in v0.8.0

func (i *ImageBlock) Reference(refs ElementReferences)

func (*ImageBlock) SetAttributes added in v0.7.0

func (i *ImageBlock) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

type IncludedFileEndTag added in v0.3.0

type IncludedFileEndTag struct {
	Value string
}

IncludedFileEndTag the type for the `end::` macro

func NewIncludedFileEndTag added in v0.3.0

func NewIncludedFileEndTag(tag string) (IncludedFileEndTag, error)

NewIncludedFileEndTag returns a new IncludedFileEndTag

type IncludedFileLine added in v0.3.0

type IncludedFileLine []interface{}

IncludedFileLine a line, containing rawText text and inclusion tags

func NewIncludedFileLine added in v0.3.0

func NewIncludedFileLine(content []interface{}) (IncludedFileLine, error)

NewIncludedFileLine returns a new IncludedFileLine

func (IncludedFileLine) GetEndTag added in v0.3.0

func (l IncludedFileLine) GetEndTag() (IncludedFileEndTag, bool)

GetEndTag returns the first IncludedFileEndTag found in the line // TODO: support multiple tags on the same line ?

func (IncludedFileLine) GetStartTag added in v0.3.0

func (l IncludedFileLine) GetStartTag() (IncludedFileStartTag, bool)

GetStartTag returns the first IncludedFileStartTag found in the line // TODO: support multiple tags on the same line ?

func (IncludedFileLine) HasTag added in v0.3.0

func (l IncludedFileLine) HasTag() bool

HasTag returns true if the line has at least one inclusion tag (start or end), false otherwise

type IncludedFileStartTag added in v0.3.0

type IncludedFileStartTag struct {
	Value string
}

IncludedFileStartTag the type for the `tag::` macro

func NewIncludedFileStartTag added in v0.3.0

func NewIncludedFileStartTag(tag string) (IncludedFileStartTag, error)

NewIncludedFileStartTag returns a new IncludedFileStartTag

type IndexTerm added in v0.3.0

type IndexTerm struct {
	Term []interface{}
}

IndexTerm a index term, with a single term

func NewIndexTerm added in v0.3.0

func NewIndexTerm(term []interface{}) (*IndexTerm, error)

NewIndexTerm returns a new IndexTerm

type InlineButton added in v0.7.0

type InlineButton struct {
	Attributes Attributes
}

InlineButton a button (requires `experimental` doc attribute to be set)

func NewInlineButton added in v0.7.0

func NewInlineButton(attrs Attributes) (*InlineButton, error)

NewInlineButton initializes a new `InlineButton`

type InlineImage

type InlineImage struct {
	Location   *Location
	Attributes Attributes
}

InlineImage the structure for the inline image macros

func NewInlineImage

func NewInlineImage(location *Location, attributes interface{}) (*InlineImage, error)

NewInlineImage initializes a new `InlineImage` (similar to ImageBlock, but without attributes)

func (*InlineImage) AddAttributes

func (i *InlineImage) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*InlineImage) GetAttributes added in v0.7.0

func (i *InlineImage) GetAttributes() Attributes

GetAttributes returns this inline image's attributes

func (*InlineImage) GetLocation added in v0.7.0

func (i *InlineImage) GetLocation() *Location

func (*InlineImage) SetAttributes added in v0.7.0

func (i *InlineImage) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

type InlineLink struct {
	Attributes Attributes
	Location   *Location
}

InlineLink the structure for the external links

func NewEmailAddressLink(address string) (*InlineLink, error)

NewEmailAddressLink creates a new link from an email address

func NewInlineAnchor added in v0.7.0

func NewInlineAnchor(id string) (*InlineLink, error)

NewInlineAnchor initializes a new InlineLink map with a single entry for the ID using the given value

func NewInlineLink(url *Location, attributes interface{}) (*InlineLink, error)

NewInlineLink initializes a new inline `InlineLink`

func (*InlineLink) AddAttributes added in v0.7.0

func (l *InlineLink) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*InlineLink) GetAttributes added in v0.7.0

func (l *InlineLink) GetAttributes() Attributes

GetAttributes returns this link's attributes

func (*InlineLink) GetLocation added in v0.7.0

func (l *InlineLink) GetLocation() *Location

func (*InlineLink) SetAttributes added in v0.7.0

func (l *InlineLink) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

type InlineMenu added in v0.7.0

type InlineMenu struct {
	Path []string
}

InlineMenu a menu with optional subpaths defined in its attributes (requires `experimental` doc attribute to be set)

func NewInlineMenu added in v0.7.0

func NewInlineMenu(id string, attrs Attributes) (*InlineMenu, error)

NewInlineMenu initializes a new `InlineMenu`

type InlinePassthrough added in v0.5.0

type InlinePassthrough struct {
	Kind     PassthroughKind
	Elements []interface{} // TODO: refactor to `Content string` ?
}

InlinePassthrough the structure for Passthroughs

func NewInlinePassthrough added in v0.5.0

func NewInlinePassthrough(kind PassthroughKind, elements []interface{}) (*InlinePassthrough, error)

NewInlinePassthrough returns a new passthrough

type InternalCrossReference added in v0.3.0

type InternalCrossReference struct {
	ID    interface{}
	Label interface{}
}

InternalCrossReference the struct for Cross References

func NewInternalCrossReference added in v0.3.0

func NewInternalCrossReference(id, label interface{}) (*InternalCrossReference, error)

NewInternalCrossReference initializes a new `InternalCrossReference` from the given ID

func (*InternalCrossReference) ResolveID added in v0.8.0

func (x *InternalCrossReference) ResolveID(attrs Attributes) error

type LabeledListElement added in v0.7.0

type LabeledListElement struct {
	Term       []interface{}
	Attributes Attributes
	Style      LabeledListElementStyle
	Elements   []interface{}
}

LabeledListElement an item in a labeled

func NewLabeledListElement added in v0.7.0

func NewLabeledListElement(level int, term, description interface{}) (*LabeledListElement, error)

NewLabeledListElement initializes a new LabeledListElement

func (*LabeledListElement) AddAttributes added in v0.7.0

func (e *LabeledListElement) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*LabeledListElement) AddElement added in v0.7.0

func (e *LabeledListElement) AddElement(element interface{}) error

AddElement add an element to this LabeledListElement

func (*LabeledListElement) AdjustStyle added in v0.7.0

func (e *LabeledListElement) AdjustStyle(l *List)

func (*LabeledListElement) GetAttributes added in v0.7.0

func (e *LabeledListElement) GetAttributes() Attributes

GetAttributes returns this element's attributes

func (*LabeledListElement) GetElements added in v0.7.0

func (e *LabeledListElement) GetElements() []interface{}

GetElements returns this LabeledListElement's elements

func (*LabeledListElement) LastElement added in v0.7.0

func (e *LabeledListElement) LastElement() interface{}

func (*LabeledListElement) ListKind added in v0.7.0

func (e *LabeledListElement) ListKind() ListKind

ListKind returns the kind of list to which this element shall be attached

func (*LabeledListElement) Reference added in v0.7.0

func (e *LabeledListElement) Reference(refs ElementReferences)

func (*LabeledListElement) SetAttributes added in v0.7.0

func (e *LabeledListElement) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*LabeledListElement) SetElements added in v0.7.0

func (e *LabeledListElement) SetElements(elements []interface{}) error

SetElements sets this LabeledListElement's elements

func (*LabeledListElement) SubstituteFootnotes added in v0.7.0

func (e *LabeledListElement) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the list element with footnote references. The footnotes are stored in the given 'notes' param

type LabeledListElementStyle added in v0.7.0

type LabeledListElementStyle string
const (
	DoubleColons    LabeledListElementStyle = "::"
	TripleColons    LabeledListElementStyle = ":::"
	QuadrupleColons LabeledListElementStyle = "::::"
)

type LineBreak

type LineBreak struct{}

LineBreak an explicit line break in a paragraph

func NewLineBreak

func NewLineBreak() (*LineBreak, error)

NewLineBreak returns a new line break, that's all.

type LineRange added in v0.3.0

type LineRange struct {
	StartLine int
	EndLine   int
}

LineRange the range of lines of the child doc to include in the master doc `Start` and `End` are the included limits of the child document - if there's a single line to include, then `End = Start` - if there is all remaining content after a given line (included), then `End = -1`

func NewLineRange added in v0.3.0

func NewLineRange(start, end int) (LineRange, error)

NewLineRange returns a new line range

type LineRanges added in v0.3.0

type LineRanges []LineRange

LineRanges the ranges of lines of the child doc to include in the master doc

func NewLineRanges added in v0.3.0

func NewLineRanges(ranges interface{}) LineRanges

NewLineRanges returns a slice of line ranges attribute for a file inclusion.

func (LineRanges) Len added in v0.3.0

func (r LineRanges) Len() int

func (LineRanges) Less added in v0.3.0

func (r LineRanges) Less(i, j int) bool

func (LineRanges) Match added in v0.3.0

func (r LineRanges) Match(line int) bool

Match checks if the given line number matches one of the line ranges

func (LineRanges) Swap added in v0.3.0

func (r LineRanges) Swap(i, j int)

type List

type List struct {
	Kind       ListKind
	Attributes Attributes
	Elements   []ListElement
}

func NewList

func NewList(element ListElement) (*List, error)

func (*List) AddAttributes added in v0.7.0

func (l *List) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*List) AddElement added in v0.7.0

func (l *List) AddElement(element interface{}) error

AddElement adds the given element `e` in the target list or sublist (depending on its type)

func (*List) CanAddElement added in v0.7.0

func (l *List) CanAddElement(element interface{}) bool

CanAddElement checks if the given element can be added

func (*List) GetAttributes added in v0.7.0

func (l *List) GetAttributes() Attributes

GetAttributes returns the attributes of this element

func (*List) GetElements added in v0.7.0

func (l *List) GetElements() []interface{}

func (*List) LastElement added in v0.7.0

func (l *List) LastElement() ListElement

func (*List) Reference added in v0.7.0

func (l *List) Reference(refs ElementReferences)

func (*List) SetAttributes added in v0.7.0

func (l *List) SetAttributes(attributes Attributes)

SetAttributes sets the attributes of this element

func (*List) SetElements added in v0.7.0

func (l *List) SetElements(elements []interface{}) error

type ListContinuation added in v0.8.0

type ListContinuation struct {
	Offset  int
	Element interface{}
}

func NewListContinuation added in v0.8.0

func NewListContinuation(offset int, Element interface{}) (*ListContinuation, error)

func (*ListContinuation) AddElement added in v0.8.0

func (c *ListContinuation) AddElement(element interface{}) error

type ListElement added in v0.7.0

type ListElement interface {
	WithElements
	WithElementAddition
	LastElement() interface{}
	ListKind() ListKind
	AdjustStyle(*List)
	// contains filtered or unexported methods
}

ListElement a list item

type ListElements added in v0.7.0

type ListElements struct {
	Elements []interface{}
}

func NewListElements added in v0.7.0

func NewListElements(elements []interface{}) (*ListElements, error)

func (*ListElements) AddAttributes added in v0.7.0

func (l *ListElements) AddAttributes(attrs Attributes)

func (*ListElements) GetAttributes added in v0.7.0

func (l *ListElements) GetAttributes() Attributes

func (*ListElements) GetElements added in v0.7.0

func (l *ListElements) GetElements() []interface{}

GetElements returns the elements

func (*ListElements) SetAttributes added in v0.7.0

func (l *ListElements) SetAttributes(Attributes)

func (*ListElements) SetElements added in v0.7.0

func (l *ListElements) SetElements(elements []interface{}) error

SetElements set the elements

func (*ListElements) SubstituteFootnotes added in v0.7.0

func (l *ListElements) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the list element with footnote references. The footnotes are stored in the given 'notes' param

type ListKind added in v0.7.0

type ListKind string
const (
	LabeledListKind   ListKind = "labeled_list"
	OrderedListKind   ListKind = "ordered_list"
	UnorderedListKind ListKind = "unordered_list"
	CalloutListKind   ListKind = "callout_list"
)

type Location added in v0.3.0

type Location struct {
	Scheme string
	Path   interface{}
}

Location a Location contains characters and optionaly, document attributes

func NewLocation added in v0.3.0

func NewLocation(scheme interface{}, path []interface{}) (*Location, error)

NewLocation return a new location with the given elements

func (*Location) SetPath added in v0.7.0

func (l *Location) SetPath(path interface{})

func (*Location) SetPathPrefix added in v0.7.0

func (l *Location) SetPathPrefix(p interface{})

SetPathPrefix adds the given prefix to the path if this latter is NOT an absolute path and if there is no defined scheme

func (*Location) ToDisplayString added in v0.8.0

func (l *Location) ToDisplayString() string

ToDisplayString returns a string representation of the location or empty string if the location is nil, but does not include the `mailto:` scheme if the link refers to an email address

func (*Location) ToString added in v0.8.0

func (l *Location) ToString() string

ToString returns a string representation of the location or empty string if the location is nil

func (*Location) TrimAngleBracketSuffix added in v0.7.0

func (l *Location) TrimAngleBracketSuffix() (bool, error)

type MacroKind added in v0.3.0

type MacroKind string

MacroKind the type of user macro

const (
	// InlineMacro a inline user macro
	InlineMacro MacroKind = "inline"
	// BlockMacro a block user macro
	BlockMacro MacroKind = "block"
)

type Metadata added in v0.3.0

type Metadata struct {
	Title           string
	LastUpdated     string
	TableOfContents *TableOfContents
	Authors         []*DocumentAuthor
	Revision        DocumentRevision
}

Metadata the document metadata returned after the rendering

type Options added in v0.7.0

type Options []interface{} // more explicit than `[]interface{}`, and to bypass the `Reduce` func that would merge all roles into a single string :/

type OrderedListElement added in v0.7.0

type OrderedListElement struct {
	Attributes Attributes
	Style      string // TODO: rename to `OrderedListElementNumberingStyle`? TODO: define as an attribute instead?
	Elements   []interface{}
}

OrderedListElement the structure for the ordered list items

func NewOrderedListElement added in v0.7.0

func NewOrderedListElement(prefix OrderedListElementPrefix, content interface{}) (*OrderedListElement, error)

NewOrderedListElement initializes a new `orderedListItem` from the given content

func (*OrderedListElement) AddAttributes added in v0.7.0

func (e *OrderedListElement) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*OrderedListElement) AddElement added in v0.7.0

func (e *OrderedListElement) AddElement(element interface{}) error

AddElement add an element to this UnorderedListElement

func (*OrderedListElement) AdjustStyle added in v0.7.0

func (e *OrderedListElement) AdjustStyle(l *List)

func (*OrderedListElement) GetAttributes added in v0.7.0

func (e *OrderedListElement) GetAttributes() Attributes

GetAttributes returns this element's attributes

func (*OrderedListElement) GetElements added in v0.7.0

func (e *OrderedListElement) GetElements() []interface{}

GetElements returns this item's elements

func (*OrderedListElement) LastElement added in v0.7.0

func (e *OrderedListElement) LastElement() interface{}

func (*OrderedListElement) ListKind added in v0.7.0

func (e *OrderedListElement) ListKind() ListKind

ListKind returns the kind of list to which this element shall be attached

func (*OrderedListElement) Reference added in v0.7.0

func (e *OrderedListElement) Reference(refs ElementReferences)

func (*OrderedListElement) SetAttributes added in v0.7.0

func (e *OrderedListElement) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*OrderedListElement) SetElements added in v0.7.0

func (e *OrderedListElement) SetElements(elements []interface{}) error

SetElements sets this OrderedListElement's elements

func (*OrderedListElement) SubstituteFootnotes added in v0.7.0

func (e *OrderedListElement) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the list element with footnote references. The footnotes are stored in the given 'notes' param

type OrderedListElementPrefix added in v0.7.0

type OrderedListElementPrefix struct {
	Style string
}

OrderedListElementPrefix the prefix used to construct an OrderedListElement

func NewOrderedListElementPrefix added in v0.7.0

func NewOrderedListElementPrefix(s string) (OrderedListElementPrefix, error)

NewOrderedListElementPrefix initializes a new OrderedListElementPrefix

type Paragraph

type Paragraph struct {
	Attributes Attributes
	Elements   []interface{}
}

Paragraph the structure for the paragraphs

func NewParagraph

func NewParagraph(style interface{}, elements ...interface{}) (*Paragraph, error)

NewParagraph initializes a new `Paragraph`

func (*Paragraph) AddAttributes

func (p *Paragraph) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*Paragraph) AddElement added in v0.7.0

func (p *Paragraph) AddElement(e interface{}) error

func (*Paragraph) GetAttributes added in v0.7.0

func (p *Paragraph) GetAttributes() Attributes

GetAttributes returns the attributes of this paragraph so that substitutions can be applied onto them

func (*Paragraph) GetElements added in v0.7.0

func (p *Paragraph) GetElements() []interface{}

GetElements returns this paragraph's elements (or lines)

func (*Paragraph) Reference added in v0.7.0

func (p *Paragraph) Reference(refs ElementReferences)

func (*Paragraph) SetAttributes added in v0.7.0

func (p *Paragraph) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*Paragraph) SetElements added in v0.7.0

func (p *Paragraph) SetElements(elements []interface{}) error

SetElements sets this paragraph's elements

func (*Paragraph) SubstituteFootnotes added in v0.6.0

func (p *Paragraph) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the paragraph lines with footnote references. The footnotes are stored in the given 'notes' param

type PassthroughKind

type PassthroughKind string

PassthroughKind the kind of passthrough

type Position added in v0.7.0

type Position struct {
	Start int
	End   int
}

type PositionalAttribute added in v0.6.0

type PositionalAttribute struct {
	Index int
	Value interface{}
}

PositionalAttribute an attribute whose key will be determined by its position, and which depends on the element it applies to.

func NewPositionalAttribute added in v0.6.0

func NewPositionalAttribute(value interface{}) (*PositionalAttribute, error)

NewPositionalAttribute returns a new attribute who key is the position in the group

func (*PositionalAttribute) Key added in v0.6.0

func (a *PositionalAttribute) Key() string

Key returns the "temporary" key, based on the attribute index.

type Preamble

type Preamble struct {
	Elements        []interface{}
	TableOfContents *TableOfContents
}

Preamble the structure for document Preamble

func (*Preamble) HasContent added in v0.3.0

func (p *Preamble) HasContent() bool

HasContent returns `true` if this Preamble has at least one element which is neither a BlankLine nor a AttributeDeclaration

type PredefinedAttribute added in v0.5.0

type PredefinedAttribute AttributeReference

PredefinedAttribute a special kind of attribute substitution, which uses a predefined attribute

type QuotedText

type QuotedText struct {
	Kind       QuotedTextKind
	Elements   []interface{}
	Attributes Attributes
}

QuotedText the structure for quoted text

func NewQuotedText

func NewQuotedText(kind QuotedTextKind, elements ...interface{}) (*QuotedText, error)

NewQuotedText initializes a new `QuotedText` from the given kind and content

func (*QuotedText) AddAttributes added in v0.7.0

func (t *QuotedText) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*QuotedText) GetAttributes added in v0.7.0

func (t *QuotedText) GetAttributes() Attributes

GetAttributes returns the attributes of this element

func (*QuotedText) GetElements added in v0.7.0

func (t *QuotedText) GetElements() []interface{}

GetElements returns this QuotedText's elements

func (*QuotedText) SetAttributes added in v0.7.0

func (t *QuotedText) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*QuotedText) SetElements added in v0.7.0

func (t *QuotedText) SetElements(elements []interface{}) error

SetElements sets this QuotedText's elements

func (*QuotedText) WithAttributes added in v0.6.0

func (t *QuotedText) WithAttributes(attributes interface{}) (*QuotedText, error)

WithAttributes returns a _new_ QuotedText with the given attributes (with some mapping)

type QuotedTextKind

type QuotedTextKind string

QuotedTextKind the type for

type RawLine added in v0.5.0

type RawLine struct {
	Content string
}

------------------------------------------------------------------------------------- Raw Line -------------------------------------------------------------------------------------

func NewRawLine added in v0.5.0

func NewRawLine(content string) (*RawLine, error)

NewRawLine returns a new RawLine wrapper for the given string

func (*RawLine) Append added in v0.8.0

func (r *RawLine) Append(s string)

func (*RawLine) Contains added in v0.8.0

func (r *RawLine) Contains(substr string) bool

func (*RawLine) HasSuffix added in v0.8.0

func (r *RawLine) HasSuffix(suffix string) bool

type RawSection added in v0.6.0

type RawSection struct {
	Level   int
	RawText string
}

RawSection the structure for a rawText section, using during preparsing (needed to support level offsets)

func NewRawSection added in v0.6.0

func NewRawSection(level int, rawText string) (*RawSection, error)

func (*RawSection) OffsetLevel added in v0.7.0

func (s *RawSection) OffsetLevel(offset int)

func (*RawSection) Stringify added in v0.6.0

func (s *RawSection) Stringify() string

type ReduceOption added in v0.6.0

type ReduceOption func(string) string

ReduceOption an option to apply on the reduced content when it is a `string`

type Referencable added in v0.7.0

type Referencable interface {
	Reference(refs ElementReferences)
}

type Roles added in v0.7.0

type Roles []interface{} // more explicit than `[]interface{}`, and to bypass the `Reduce` func that would merge all roles into a single string :/

type Section

type Section struct {
	Level      int
	Attributes Attributes
	Title      []interface{}
	Elements   []interface{}
}

Section the structure for a section

func NewSection

func NewSection(level int, title []interface{}) (*Section, error)

NewSection returns a new Section

func (*Section) AddAttributes

func (s *Section) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*Section) AddElement added in v0.3.0

func (s *Section) AddElement(e interface{}) error

AddElement adds the given child element to this section

func (*Section) GetAttributes added in v0.7.0

func (s *Section) GetAttributes() Attributes

GetAttributes returns this section's attributes

func (*Section) GetElements added in v0.7.0

func (s *Section) GetElements() []interface{}

GetElements returns this Section's elements

func (*Section) GetID added in v0.7.0

func (s *Section) GetID() string

func (*Section) GetTitle added in v0.7.0

func (s *Section) GetTitle() []interface{}

GetTitle returns this section's title

func (*Section) Reference added in v0.7.0

func (s *Section) Reference(refs ElementReferences)

func (*Section) ResolveID added in v0.3.0

func (s *Section) ResolveID(attrs Attributes, refs ElementReferences) error

ResolveID resolves/updates the "ID" attribute in the section (in case the title changed after some document attr substitution)

func (*Section) SetAttributes added in v0.7.0

func (s *Section) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*Section) SetElements added in v0.7.0

func (s *Section) SetElements(elements []interface{}) error

SetElements sets this Sections's elements

func (*Section) SetTitle added in v0.7.0

func (s *Section) SetTitle(title []interface{})

SetTitle sets this section's title

func (*Section) SubstituteFootnotes added in v0.6.0

func (s *Section) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the section title with footnote references. The footnotes are stored in the given 'notes' param

type SectionNumbers added in v0.8.0

type SectionNumbers map[string]string // assigned number by section id

type SinglelineComment added in v0.8.0

type SinglelineComment struct {
	Content string
}

SinglelineComment a single line comment

func NewSinglelineComment added in v0.8.0

func NewSinglelineComment(content string) (*SinglelineComment, error)

NewSinglelineComment initializes a new single line content

type SpecialCharacter added in v0.5.0

type SpecialCharacter struct {
	Name string
}

SpecialCharacter a special character, which may get a special treatment later during rendering Eg `<`, `>`, `&`

func NewSpecialCharacter added in v0.5.0

func NewSpecialCharacter(name string) (*SpecialCharacter, error)

NewSpecialCharacter return a new SpecialCharacter

type StringElement

type StringElement struct {
	Content string
}

StringElement the structure for strings

func NewStringElement

func NewStringElement(content string) (*StringElement, error)

NewStringElement initializes a new `StringElement` from the given content

func (StringElement) RawText added in v0.6.0

func (s StringElement) RawText() (string, error)

RawText returns the rawText text representation of this element as it was (supposedly) written in the source document

type Symbol added in v0.7.0

type Symbol struct {
	Name string
}

Symbol a sequence of characters, which may get a special treatment later during rendering Eg: `(C)`, `(TM)`, `...`, etc.

func NewSymbol added in v0.7.0

func NewSymbol(name string) (*Symbol, error)

NewSymbol return a new Symbol

type Table

type Table struct {
	Attributes Attributes
	Header     *TableRow
	Footer     *TableRow
	Rows       []*TableRow
}

Table the structure for the tables

func NewTable

func NewTable(lines []interface{}) (*Table, error)

func (*Table) AddAttributes

func (t *Table) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this CalloutListElement

func (*Table) Columns added in v0.5.0

func (t *Table) Columns() ([]*TableColumn, error)

func (*Table) GetAttributes added in v0.7.0

func (t *Table) GetAttributes() Attributes

func (*Table) GetElements added in v0.7.0

func (t *Table) GetElements() []interface{}

return the optional header line and the cell lines

func (*Table) Reference added in v0.7.0

func (t *Table) Reference(refs ElementReferences)

func (*Table) SetAttributes added in v0.7.0

func (t *Table) SetAttributes(attributes Attributes)

SetAttributes sets the attributes in this element

func (*Table) SetColumnDefinitions added in v0.8.0

func (t *Table) SetColumnDefinitions(cols []interface{})

func (*Table) SetElements added in v0.7.0

func (t *Table) SetElements(elements []interface{}) error

type TableCell added in v0.7.0

type TableCell struct {
	Format   string
	Elements []interface{}
}

func NewInlineTableCell added in v0.8.0

func NewInlineTableCell(content *RawLine) (*TableCell, error)

func NewMultilineTableCell added in v0.8.0

func NewMultilineTableCell(elements []interface{}, format interface{}) (*TableCell, error)

func (*TableCell) AddAttributes added in v0.7.0

func (c *TableCell) AddAttributes(_ Attributes)

func (*TableCell) GetAttributes added in v0.7.0

func (c *TableCell) GetAttributes() Attributes

func (*TableCell) GetElements added in v0.7.0

func (c *TableCell) GetElements() []interface{}

func (*TableCell) SetAttributes added in v0.7.0

func (c *TableCell) SetAttributes(_ Attributes)

func (*TableCell) SetElements added in v0.7.0

func (c *TableCell) SetElements(elements []interface{}) error

type TableColumn added in v0.5.0

type TableColumn struct {
	Multiplier int
	HAlign     HAlign
	VAlign     VAlign
	Weight     int
	Width      string // computed value
	Style      ContentStyle
	Autowidth  bool
}

func NewTableColumn added in v0.7.0

func NewTableColumn(multiplier, halign, valign, weight, style interface{}) (*TableColumn, error)

type TableOfContents added in v0.3.0

type TableOfContents struct {
	MaxDepth int
	Sections []*ToCSection
}

TableOfContents the table of contents

func NewTableOfContents added in v0.7.0

func NewTableOfContents(maxDepth int) *TableOfContents

func (*TableOfContents) Add added in v0.7.0

func (t *TableOfContents) Add(s *Section)

Add adds a ToCSection associated with the given Section

type TableOfContentsPlaceHolder added in v0.3.0

type TableOfContentsPlaceHolder struct {
}

TableOfContentsPlaceHolder a place holder for Table of Contents, so the renderer knows when to render it.

type TableRow added in v0.7.0

type TableRow struct {
	Cells []*TableCell
}

TableRow a table line is made of columns, each column being a group of []interface{} (to support quoted text, etc.)

func NewTableRow added in v0.7.0

func NewTableRow(elements []interface{}) (*TableRow, error)

func (*TableRow) AddAttributes added in v0.7.0

func (r *TableRow) AddAttributes(_ Attributes)

AddAttributes adds the attributes of this CalloutListElement

func (*TableRow) GetAttributes added in v0.7.0

func (r *TableRow) GetAttributes() Attributes

func (*TableRow) GetElements added in v0.7.0

func (r *TableRow) GetElements() []interface{}

func (*TableRow) SetAttributes added in v0.7.0

func (r *TableRow) SetAttributes(_ Attributes)

func (*TableRow) SetElements added in v0.7.0

func (r *TableRow) SetElements(elements []interface{}) error

type TagRange added in v0.3.0

type TagRange struct {
	Name     string
	Included bool
}

TagRange the range to include or exclude from the file inclusion. The range is excluded if it is prefixed with '!' Also, '*' and '**' have a special meaning: - '*' means that all tag ranges are included (except the lines having the start and end ranges) - '**' means that all content is included, regardless of whether it is in a tag or not (except the lines having the start and end ranges)

func NewTagRange added in v0.3.0

func NewTagRange(name string, included bool) (TagRange, error)

NewTagRange returns a new TagRange

type TagRanges added in v0.3.0

type TagRanges []TagRange

TagRanges the ranges of tags of the child doc to include in the master doc

func NewTagRanges added in v0.3.0

func NewTagRanges(ranges interface{}) TagRanges

NewTagRanges returns a slice of tag ranges attribute for a file inclusion.

func (TagRanges) Match added in v0.3.0

func (tr TagRanges) Match(line int, currentRanges CurrentRanges) bool

Match checks if the given tag matches one of the range

type ThematicBreak added in v0.5.0

type ThematicBreak struct{}

ThematicBreak a thematic break

func NewThematicBreak added in v0.5.0

func NewThematicBreak() (*ThematicBreak, error)

NewThematicBreak returns a new ThematicBreak

type ToCSection added in v0.3.0

type ToCSection struct {
	ID       string
	Level    int
	Title    string // the title as it was rendered in HTML
	Number   string // the number assigned during rendering, if the `sectnums` attribute was set
	Children []*ToCSection
}

ToCSection a section in the table of contents

type UnorderedListElement added in v0.7.0

type UnorderedListElement struct {
	BulletStyle UnorderedListElementBulletStyle
	CheckStyle  UnorderedListElementCheckStyle
	Attributes  Attributes
	Elements    []interface{}
}

UnorderedListElement the structure for the unordered list items

func NewUnorderedListElement added in v0.7.0

func NewUnorderedListElement(prefix UnorderedListElementPrefix, checkstyle interface{}, content interface{}) (*UnorderedListElement, error)

NewUnorderedListElement initializes a new `UnorderedListElement` from the given content

func (*UnorderedListElement) AddAttributes added in v0.7.0

func (e *UnorderedListElement) AddAttributes(attributes Attributes)

AddAttributes adds the attributes of this element

func (*UnorderedListElement) AddElement added in v0.7.0

func (e *UnorderedListElement) AddElement(element interface{}) error

AddElement add an element to this UnorderedListElement

func (*UnorderedListElement) AdjustStyle added in v0.7.0

func (e *UnorderedListElement) AdjustStyle(l *List)

func (*UnorderedListElement) GetAttributes added in v0.7.0

func (e *UnorderedListElement) GetAttributes() Attributes

GetAttributes returns this element's attributes

func (*UnorderedListElement) GetElements added in v0.7.0

func (e *UnorderedListElement) GetElements() []interface{}

GetElements returns this UnorderedListElement's elements

func (*UnorderedListElement) LastElement added in v0.7.0

func (e *UnorderedListElement) LastElement() interface{}

func (*UnorderedListElement) ListKind added in v0.7.0

func (e *UnorderedListElement) ListKind() ListKind

ListKind returns the kind of list to which this element shall be attached

func (*UnorderedListElement) Reference added in v0.7.0

func (e *UnorderedListElement) Reference(refs ElementReferences)

func (*UnorderedListElement) SetAttributes added in v0.7.0

func (e *UnorderedListElement) SetAttributes(attributes Attributes)

SetAttributes replaces the attributes in this element

func (*UnorderedListElement) SetElements added in v0.7.0

func (e *UnorderedListElement) SetElements(elements []interface{}) error

SetElements sets this UnorderedListElement's elements

func (*UnorderedListElement) SubstituteFootnotes added in v0.7.0

func (e *UnorderedListElement) SubstituteFootnotes(notes *Footnotes)

SubstituteFootnotes replaces the footnotes in the list element with footnote references. The footnotes are stored in the given 'notes' param

type UnorderedListElementBulletStyle added in v0.7.0

type UnorderedListElementBulletStyle string

UnorderedListElementBulletStyle the type of bullet for items in an unordered list

const (
	// Dash an unordered item can begin with a single dash
	Dash UnorderedListElementBulletStyle = "dash"
	// OneAsterisk an unordered item marked with a single asterisk
	OneAsterisk UnorderedListElementBulletStyle = "1asterisk"
	// TwoAsterisks an unordered item marked with two asterisks
	TwoAsterisks UnorderedListElementBulletStyle = "2asterisks"
	// ThreeAsterisks an unordered item marked with three asterisks
	ThreeAsterisks UnorderedListElementBulletStyle = "3asterisks"
	// FourAsterisks an unordered item marked with four asterisks
	FourAsterisks UnorderedListElementBulletStyle = "4asterisks"
	// FiveAsterisks an unordered item marked with five asterisks
	FiveAsterisks UnorderedListElementBulletStyle = "5asterisks"
)

func NewUnorderedListElementBulletStyle added in v0.8.0

func NewUnorderedListElementBulletStyle(style string) (UnorderedListElementBulletStyle, error)

type UnorderedListElementCheckStyle added in v0.7.0

type UnorderedListElementCheckStyle string

UnorderedListElementCheckStyle the check style that applies on an unordered list item

const (
	// Checked when the unordered list item is checked
	Checked UnorderedListElementCheckStyle = "checked"
	// CheckedInteractive when the unordered list item is checked (with an interactive checkbox)
	CheckedInteractive UnorderedListElementCheckStyle = "checked-interactive"
	// Unchecked when the unordered list item is not checked
	Unchecked UnorderedListElementCheckStyle = "unchecked"
	// UncheckedInteractive when the unordered list item is not checked (with an interactive checkbox)
	UncheckedInteractive UnorderedListElementCheckStyle = "unchecked-interactive"
	// NoCheck when the unodered list item has no specific check annotation
	NoCheck UnorderedListElementCheckStyle = "nocheck"
)

type UnorderedListElementPrefix added in v0.7.0

type UnorderedListElementPrefix struct {
	BulletStyle UnorderedListElementBulletStyle
}

UnorderedListElementPrefix the prefix used to construct an UnorderedListElement

func NewUnorderedListElementPrefix added in v0.7.0

func NewUnorderedListElementPrefix(style string) (UnorderedListElementPrefix, error)

NewUnorderedListElementPrefix initializes a new UnorderedListElementPrefix

type UserMacro added in v0.3.0

type UserMacro struct {
	Kind       MacroKind
	Name       string
	Value      string
	Attributes Attributes
	RawText    string
}

UserMacro the structure for User Macro

func NewInlineUserMacro added in v0.3.0

func NewInlineUserMacro(name, value string, attributes Attributes, rawText string) (*UserMacro, error)

NewInlineUserMacro returns an UserMacro

func NewUserMacroBlock added in v0.3.0

func NewUserMacroBlock(name string, value string, attributes Attributes, rawText string) (*UserMacro, error)

NewUserMacroBlock returns an UserMacro

type VAlign added in v0.7.0

type VAlign string
const (
	VAlignDefault VAlign = VAlignTop
	VAlignTop     VAlign = "<" // default
	VAlignBottom  VAlign = ">"
	VAlignMiddle  VAlign = "^"
)

type WithAttributes

type WithAttributes interface {
	GetAttributes() Attributes
	AddAttributes(Attributes)
	SetAttributes(Attributes)
}

WithAttributes base interface for types on which attributes can be substituted

type WithElementAddition added in v0.7.0

type WithElementAddition interface {
	AddElement(interface{}) error
}

type WithElements added in v0.7.0

type WithElements interface {
	WithAttributes
	GetElements() []interface{}
	SetElements([]interface{}) error
}

type WithFootnotes added in v0.7.0

type WithFootnotes interface {
	SubstituteFootnotes(existing *Footnotes)
}

WithFootnotes interface for all types which may contain footnotes

type WithLocation added in v0.7.0

type WithLocation interface {
	WithAttributes
	GetLocation() *Location
}

type WithTitle added in v0.7.0

type WithTitle interface {
	WithAttributes
	GetTitle() []interface{}
	SetTitle([]interface{})
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL