Documentation ¶
Index ¶
- Constants
- type Blockquote
- type BlockquoteBuilder
- type Codeblock
- type CodeblockBuilder
- type CodeblockSyntax
- type Column
- type ColumnAlignment
- type ColumnBuilder
- type Document
- type DocumentBuilder
- type Element
- type ElementType
- type EmphasisSyntax
- type Header
- type HeaderBuilder
- type HeaderLevel
- type HeaderSyntax
- type HtmlRef
- type HtmlRefBuilder
- type Image
- type ImageBuilder
- type Link
- type LinkBuilder
- type List
- type ListBuilder
- type ListEntry
- type ListEntryBuilder
- type ListSyntax
- type OrderedSafeElement
- type Paragraph
- type ParagraphBuilder
- type Row
- type RowBuilder
- type Rule
- type RuleBuilder
- type RuleSyntax
- type Section
- type SectionBuilder
- type Table
- type TableBuilder
- type Text
- type TextBuilder
- type TextEmphasis
Constants ¶
const CodeblockBackticksDelimiter = "```"
const CodeblockTildasDelimiter = "~~~"
const ColumnAlignmentCenterDelimiter = ":----:"
const ColumnAlignmentLeftDelimiter = ":---"
ColumnAlignmentLeftDelimiter TODO: Implement alignment
const ColumnAlignmentRightDelimiter = "---:"
const EmphasisBoldAsterisksDelimiter = "**"
const EmphasisBoldItalicAsteriskDelimiter = "***"
const EmphasisBoldItalicUnderscoresDelimiter = "___"
const EmphasisBoldUnderscoresDelimiter = "__"
const EmphasisItalicAsteriskDelimiter = "*"
const HeaderDelimiterBasic = "#"
const HeaderDelimiterDashes = "-"
const HeaderDelimiterEquals = "="
const ListAsteriskDelimiter = "*"
const ListDashDelimiter = "-"
const ListPlusDelimiter = "+"
const RuleAsterisksDelimiter = "***"
const RuleDashesDelimiter = "---"
const RuleUnderscoresDelimiter = "___"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockquote ¶
type Blockquote struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Blockquote) AddElement ¶
func (b *Blockquote) AddElement(element Element)
func (*Blockquote) GetElements ¶
func (b *Blockquote) GetElements() []Element
func (Blockquote) GetType ¶
func (b Blockquote) GetType() ElementType
type BlockquoteBuilder ¶
type BlockquoteBuilder struct {
// contains filtered or unexported fields
}
BlockquoteBuilder Blockquote builder pattern code
func NewBlockquoteBuilder ¶
func NewBlockquoteBuilder() *BlockquoteBuilder
func (*BlockquoteBuilder) Build ¶
func (b *BlockquoteBuilder) Build() *Blockquote
func (*BlockquoteBuilder) Elements ¶
func (b *BlockquoteBuilder) Elements(elements ...Element) *BlockquoteBuilder
func (*BlockquoteBuilder) Index ¶
func (b *BlockquoteBuilder) Index(index int) *BlockquoteBuilder
type Codeblock ¶
type Codeblock struct { OrderedSafeElement // contains filtered or unexported fields }
func (Codeblock) GetType ¶
func (c Codeblock) GetType() ElementType
type CodeblockBuilder ¶
type CodeblockBuilder struct {
// contains filtered or unexported fields
}
CodeblockBuilder Codeblock builder pattern code
func NewCodeblockBuilder ¶
func NewCodeblockBuilder() *CodeblockBuilder
func (*CodeblockBuilder) Build ¶
func (b *CodeblockBuilder) Build() *Codeblock
func (*CodeblockBuilder) Index ¶
func (b *CodeblockBuilder) Index(index int) *CodeblockBuilder
func (*CodeblockBuilder) Text ¶
func (b *CodeblockBuilder) Text(text string) *CodeblockBuilder
type CodeblockSyntax ¶
type CodeblockSyntax int
const ( CodeblockSyntaxBackticks CodeblockSyntax = iota CodeblockSyntaxTildas )
type Column ¶
type Column struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Column) GetAlignment ¶
func (c *Column) GetAlignment() ColumnAlignment
func (*Column) SetAlignment ¶
func (c *Column) SetAlignment(alignment ColumnAlignment)
type ColumnAlignment ¶
type ColumnAlignment int
const ( ColumnAlignmentLeft ColumnAlignment = iota ColumnAlignmentCenter ColumnAlignmentRight )
type ColumnBuilder ¶
type ColumnBuilder struct {
// contains filtered or unexported fields
}
ColumnBuilder Column builder pattern code
func NewColumnBuilder ¶
func NewColumnBuilder() *ColumnBuilder
func (*ColumnBuilder) Alignment ¶
func (b *ColumnBuilder) Alignment(alignment ColumnAlignment) *ColumnBuilder
func (*ColumnBuilder) Build ¶
func (b *ColumnBuilder) Build() *Column
func (*ColumnBuilder) Index ¶
func (b *ColumnBuilder) Index(index int) *ColumnBuilder
func (*ColumnBuilder) Name ¶
func (b *ColumnBuilder) Name(name string) *ColumnBuilder
func (*ColumnBuilder) Rows ¶
func (b *ColumnBuilder) Rows(rows ...Row) *ColumnBuilder
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func (*Document) AddSection ¶
func (*Document) GetSections ¶
type DocumentBuilder ¶
type DocumentBuilder struct {
// contains filtered or unexported fields
}
DocumentBuilder Document builder pattern code
func NewDocumentBuilder ¶
func NewDocumentBuilder() *DocumentBuilder
func (*DocumentBuilder) Build ¶
func (b *DocumentBuilder) Build() *Document
func (*DocumentBuilder) Sections ¶
func (b *DocumentBuilder) Sections(sections ...Section) *DocumentBuilder
type Element ¶
type Element interface { GetType() ElementType GetIndex() int SetIndex(index int) }
type ElementType ¶
type ElementType int
const ( ElementTypeHeader ElementType = iota ElementTypeParagraph ElementTypeText ElementTypeBlockquote ElementTypeList ElementTypeListEntry ElementTypeCodeblock ElementTypeImage ElementTypeRule ElementTypeLink ElementTypeTable ElementTypeRow ElementTypeHtmlRef )
type EmphasisSyntax ¶
type EmphasisSyntax int
const ( EmphasisSyntaxAsterisks EmphasisSyntax = iota EmphasisSyntaxUnderscores )
type Header ¶
type Header struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Header) GetLevel ¶
func (h *Header) GetLevel() HeaderLevel
func (Header) GetType ¶
func (h Header) GetType() ElementType
func (*Header) SetLevel ¶
func (h *Header) SetLevel(level HeaderLevel)
type HeaderBuilder ¶
type HeaderBuilder struct {
// contains filtered or unexported fields
}
HeaderBuilder Header builder pattern code
func NewHeaderBuilder ¶
func NewHeaderBuilder() *HeaderBuilder
func (*HeaderBuilder) Build ¶
func (b *HeaderBuilder) Build() *Header
func (*HeaderBuilder) Index ¶
func (b *HeaderBuilder) Index(index int) *HeaderBuilder
func (*HeaderBuilder) Level ¶
func (b *HeaderBuilder) Level(level HeaderLevel) *HeaderBuilder
func (*HeaderBuilder) Text ¶
func (b *HeaderBuilder) Text(text string) *HeaderBuilder
type HeaderLevel ¶
type HeaderLevel int
const ( HeaderLevelOne HeaderLevel = iota + 1 HeaderLevelTwo HeaderLevelThree HeaderLevelFour HeaderLevelFive HeaderLevelSix )
type HeaderSyntax ¶
type HeaderSyntax int
const ( HeaderSyntaxNumberSigns HeaderSyntax = iota HeaderSyntaxUnderlined )
type HtmlRef ¶
type HtmlRef struct { OrderedSafeElement // contains filtered or unexported fields }
func (HtmlRef) GetType ¶
func (r HtmlRef) GetType() ElementType
type HtmlRefBuilder ¶
type HtmlRefBuilder struct {
// contains filtered or unexported fields
}
HtmlRefBuilder HtmlRef builder pattern code
func NewHtmlRefBuilder ¶
func NewHtmlRefBuilder() *HtmlRefBuilder
func (*HtmlRefBuilder) Build ¶
func (b *HtmlRefBuilder) Build() *HtmlRef
func (*HtmlRefBuilder) Name ¶
func (b *HtmlRefBuilder) Name(name string) *HtmlRefBuilder
type Image ¶
type Image struct { OrderedSafeElement // contains filtered or unexported fields }
func (Image) GetType ¶
func (i Image) GetType() ElementType
type ImageBuilder ¶
type ImageBuilder struct {
// contains filtered or unexported fields
}
ImageBuilder Image builder pattern code
func NewImageBuilder ¶
func NewImageBuilder() *ImageBuilder
func (*ImageBuilder) Build ¶
func (b *ImageBuilder) Build() *Image
func (*ImageBuilder) Index ¶
func (b *ImageBuilder) Index(index int) *ImageBuilder
func (*ImageBuilder) Text ¶
func (b *ImageBuilder) Text(text string) *ImageBuilder
func (*ImageBuilder) Title ¶
func (b *ImageBuilder) Title(title string) *ImageBuilder
func (*ImageBuilder) Url ¶
func (b *ImageBuilder) Url(url string) *ImageBuilder
type Link ¶
type Link struct { OrderedSafeElement // contains filtered or unexported fields }
func (Link) GetType ¶
func (l Link) GetType() ElementType
type LinkBuilder ¶
type LinkBuilder struct {
// contains filtered or unexported fields
}
LinkBuilder Link builder pattern code
func NewLinkBuilder ¶
func NewLinkBuilder() *LinkBuilder
func (*LinkBuilder) Build ¶
func (b *LinkBuilder) Build() *Link
func (*LinkBuilder) Index ¶
func (b *LinkBuilder) Index(index int) *LinkBuilder
func (*LinkBuilder) Text ¶
func (b *LinkBuilder) Text(text string) *LinkBuilder
func (*LinkBuilder) Url ¶
func (b *LinkBuilder) Url(url string) *LinkBuilder
type List ¶
type List struct { OrderedSafeElement // contains filtered or unexported fields }
func (*List) GetEntries ¶
func (List) GetType ¶
func (l List) GetType() ElementType
func (*List) SetOrdered ¶
type ListBuilder ¶
type ListBuilder struct {
// contains filtered or unexported fields
}
ListBuilder List builder pattern code
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
func (*ListBuilder) Build ¶
func (b *ListBuilder) Build() *List
func (*ListBuilder) Entries ¶
func (b *ListBuilder) Entries(entries ...ListEntry) *ListBuilder
func (*ListBuilder) Index ¶
func (b *ListBuilder) Index(index int) *ListBuilder
func (*ListBuilder) Ordered ¶
func (b *ListBuilder) Ordered(ordered bool) *ListBuilder
type ListEntry ¶
type ListEntry struct { OrderedSafeElement // contains filtered or unexported fields }
func (*ListEntry) AddElement ¶
func (*ListEntry) AddSublist ¶
func (*ListEntry) GetElement ¶
func (*ListEntry) GetElements ¶
func (ListEntry) GetType ¶
func (l ListEntry) GetType() ElementType
func (*ListEntry) SetElement ¶
type ListEntryBuilder ¶
type ListEntryBuilder struct {
// contains filtered or unexported fields
}
ListEntryBuilder ListEntry builder pattern code
func NewListEntryBuilder ¶
func NewListEntryBuilder(list *List) *ListEntryBuilder
func (*ListEntryBuilder) Build ¶
func (b *ListEntryBuilder) Build() *ListEntry
func (*ListEntryBuilder) Element ¶
func (b *ListEntryBuilder) Element(element Element) *ListEntryBuilder
func (*ListEntryBuilder) Elements ¶
func (b *ListEntryBuilder) Elements(elements ...Element) *ListEntryBuilder
func (*ListEntryBuilder) Index ¶
func (b *ListEntryBuilder) Index(index int) *ListEntryBuilder
type ListSyntax ¶
type ListSyntax int
const ( ListSyntaxAsterisk ListSyntax = iota ListSyntaxDash ListSyntaxPlus )
type OrderedSafeElement ¶
type OrderedSafeElement struct {
// contains filtered or unexported fields
}
func (*OrderedSafeElement) Block ¶
func (o *OrderedSafeElement) Block()
Block blocks the element... was element is blocked implementations are responsible for blocking any mutable operations on the element.
func (*OrderedSafeElement) GetIndex ¶
func (o *OrderedSafeElement) GetIndex() int
func (*OrderedSafeElement) SetIndex ¶
func (o *OrderedSafeElement) SetIndex(index int)
type Paragraph ¶
type Paragraph struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Paragraph) AddElement ¶
func (*Paragraph) GetElements ¶
func (Paragraph) GetType ¶
func (p Paragraph) GetType() ElementType
type ParagraphBuilder ¶
type ParagraphBuilder struct {
// contains filtered or unexported fields
}
ParagraphBuilder Paragraph builder pattern code
func NewParagraphBuilder ¶
func NewParagraphBuilder() *ParagraphBuilder
func (*ParagraphBuilder) Build ¶
func (b *ParagraphBuilder) Build() *Paragraph
func (*ParagraphBuilder) Elements ¶
func (b *ParagraphBuilder) Elements(elements ...Element) *ParagraphBuilder
func (*ParagraphBuilder) Index ¶
func (b *ParagraphBuilder) Index(index int) *ParagraphBuilder
type Row ¶
type Row struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Row) AddCodeblock ¶
func (*Row) GetElements ¶
func (Row) GetType ¶
func (r Row) GetType() ElementType
type RowBuilder ¶
type RowBuilder struct {
// contains filtered or unexported fields
}
RowBuilder Row builder pattern code
func NewRowBuilder ¶
func NewRowBuilder() *RowBuilder
func (*RowBuilder) Build ¶
func (b *RowBuilder) Build() *Row
func (*RowBuilder) Elements ¶
func (b *RowBuilder) Elements(elements ...Element) *RowBuilder
func (*RowBuilder) Index ¶
func (b *RowBuilder) Index(index int) *RowBuilder
type Rule ¶
type Rule struct {
OrderedSafeElement
}
func (Rule) GetType ¶
func (r Rule) GetType() ElementType
type RuleBuilder ¶
type RuleBuilder struct {
// contains filtered or unexported fields
}
RuleBuilder Rule builder pattern code
func NewRuleBuilder ¶
func NewRuleBuilder() *RuleBuilder
func (*RuleBuilder) Build ¶
func (b *RuleBuilder) Build() *Rule
func (*RuleBuilder) Index ¶
func (b *RuleBuilder) Index(index int) *RuleBuilder
type RuleSyntax ¶
type RuleSyntax int
const ( RuleSyntaxAsterisks RuleSyntax = iota RuleSyntaxUnderscores RuleSyntaxDashes )
type Section ¶
type Section struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Section) AddElement ¶
func (*Section) GetElements ¶
type SectionBuilder ¶
type SectionBuilder struct {
// contains filtered or unexported fields
}
SectionBuilder Section builder pattern code
func NewSectionBuilder ¶
func NewSectionBuilder() *SectionBuilder
func (*SectionBuilder) Build ¶
func (b *SectionBuilder) Build() *Section
func (*SectionBuilder) Elements ¶
func (b *SectionBuilder) Elements(elements ...Element) *SectionBuilder
func (*SectionBuilder) Index ¶
func (b *SectionBuilder) Index(index int) *SectionBuilder
type Table ¶
type Table struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Table) GetColumns ¶
func (Table) GetType ¶
func (t Table) GetType() ElementType
type TableBuilder ¶
type TableBuilder struct {
// contains filtered or unexported fields
}
TableBuilder Table builder pattern code
func NewTableBuilder ¶
func NewTableBuilder() *TableBuilder
func (*TableBuilder) Build ¶
func (b *TableBuilder) Build() *Table
func (*TableBuilder) Columns ¶
func (b *TableBuilder) Columns(columns ...Column) *TableBuilder
func (*TableBuilder) Index ¶
func (b *TableBuilder) Index(index int) *TableBuilder
func (*TableBuilder) Rows ¶
func (b *TableBuilder) Rows(rows int) *TableBuilder
type Text ¶
type Text struct { OrderedSafeElement // contains filtered or unexported fields }
func (*Text) GetEmphasis ¶
func (t *Text) GetEmphasis() TextEmphasis
func (Text) GetType ¶
func (t Text) GetType() ElementType
func (*Text) SetEmphasis ¶
func (t *Text) SetEmphasis(emphasis TextEmphasis)
type TextBuilder ¶
type TextBuilder struct {
// contains filtered or unexported fields
}
TextBuilder Text builder pattern code
func NewTextBuilder ¶
func NewTextBuilder() *TextBuilder
func (*TextBuilder) Build ¶
func (b *TextBuilder) Build() *Text
func (*TextBuilder) Emphasis ¶
func (b *TextBuilder) Emphasis(emphasis TextEmphasis) *TextBuilder
func (*TextBuilder) Index ¶
func (b *TextBuilder) Index(index int) *TextBuilder
func (*TextBuilder) Text ¶
func (b *TextBuilder) Text(text string) *TextBuilder
type TextEmphasis ¶
type TextEmphasis int
const ( TextEmphasisNormal TextEmphasis = iota TextEmphasisBold TextEmphasisItalic TextEmphasisBoldItalic )