booklit: github.com/vito/booklit Index | Files | Directories

package booklit

import "github.com/vito/booklit"

Index

Package Files

append.go aux_.go content.go definitions.go errors.go image.go link.go list.go paragraph.go plugin.go preformatted.go reference.go section.go sequence.go string.go styled.go table.go target.go toc.go version.go

Variables

var ErrBrokenReference = errors.New("broken reference")
var Version = "0.0.0-dev"

overridden via linker flags

func RegisterPlugin Uses

func RegisterPlugin(name string, factory PluginFactory)

type Aux Uses

type Aux struct {
    Content
}

type Content Uses

type Content interface {
    String() string

    IsFlow() bool

    Visit(Visitor) error
}

func Append Uses

func Append(first Content, rest ...Content) Content

func StripAux Uses

func StripAux(content Content) Content

type Definition Uses

type Definition struct {
    Subject    Content
    Definition Content
}

type Definitions Uses

type Definitions []Definition

func (Definitions) IsFlow Uses

func (con Definitions) IsFlow() bool

func (Definitions) String Uses

func (con Definitions) String() string

func (Definitions) Visit Uses

func (con Definitions) Visit(visitor Visitor) error

type Image Uses

type Image struct {
    Path        string
    Description string
}

func (Image) IsFlow Uses

func (con Image) IsFlow() bool

func (Image) String Uses

func (con Image) String() string

func (Image) Visit Uses

func (con Image) Visit(visitor Visitor) error
type Link struct {
    Content

    Target string
}

func (Link) Visit Uses

func (con Link) Visit(visitor Visitor) error

type List Uses

type List struct {
    Items []Content

    Ordered bool
}

func (List) IsFlow Uses

func (con List) IsFlow() bool

func (List) String Uses

func (con List) String() string

func (List) Visit Uses

func (con List) Visit(visitor Visitor) error

type Paragraph Uses

type Paragraph []Content

func (Paragraph) IsFlow Uses

func (con Paragraph) IsFlow() bool

func (Paragraph) String Uses

func (con Paragraph) String() string

func (Paragraph) Visit Uses

func (con Paragraph) Visit(visitor Visitor) error

type Partials Uses

type Partials map[string]Content

type Plugin Uses

type Plugin interface {
}

type PluginFactory Uses

type PluginFactory func(*Section) Plugin

func LookupPlugin Uses

func LookupPlugin(name string) (PluginFactory, bool)

type Preformatted Uses

type Preformatted []Content

func (Preformatted) IsFlow Uses

func (con Preformatted) IsFlow() bool

func (Preformatted) String Uses

func (con Preformatted) String() string

func (Preformatted) Visit Uses

func (con Preformatted) Visit(visitor Visitor) error

type Reference Uses

type Reference struct {
    TagName string
    Content Content

    Tag *Tag
}

func (*Reference) Display Uses

func (con *Reference) Display() Content

func (*Reference) IsFlow Uses

func (con *Reference) IsFlow() bool

func (*Reference) String Uses

func (con *Reference) String() string

func (*Reference) Visit Uses

func (con *Reference) Visit(visitor Visitor) error

type Section Uses

type Section struct {
    Path string

    Title Content
    Body  Content

    PrimaryTag Tag
    Tags       []Tag

    Parent   *Section
    Children []*Section

    Style    string
    Partials Partials

    SplitSections        bool
    PreventSplitSections bool

    ResetDepth bool

    OmitChildrenFromTableOfContents bool

    PluginFactories []PluginFactory
    Plugins         []Plugin
}

func (*Section) AnchorTags Uses

func (con *Section) AnchorTags() []Tag

func (*Section) Contains Uses

func (con *Section) Contains(sub *Section) bool

func (*Section) Depth Uses

func (con *Section) Depth() int

func (*Section) FindTag Uses

func (con *Section) FindTag(tagName string) []Tag

func (*Section) HasAnchors Uses

func (con *Section) HasAnchors() bool

func (*Section) IsFlow Uses

func (con *Section) IsFlow() bool

func (*Section) IsOrHasChild Uses

func (con *Section) IsOrHasChild(sub *Section) bool

func (*Section) Number Uses

func (con *Section) Number() string

func (*Section) PageDepth Uses

func (con *Section) PageDepth() int

func (*Section) Partial Uses

func (con *Section) Partial(name string) Content

func (*Section) SetPartial Uses

func (con *Section) SetPartial(name string, value Content)

func (*Section) SetTag Uses

func (con *Section) SetTag(name string, title Content, optionalAnchor ...string)

func (*Section) SetTagAnchored Uses

func (con *Section) SetTagAnchored(name string, title Content, content Content, anchor string)

func (*Section) SetTitle Uses

func (con *Section) SetTitle(title Content, tags ...string)

func (*Section) SplitSectionsPrevented Uses

func (con *Section) SplitSectionsPrevented() bool

func (*Section) String Uses

func (con *Section) String() string

func (*Section) Top Uses

func (con *Section) Top() *Section

func (*Section) UsePlugin Uses

func (con *Section) UsePlugin(pf PluginFactory)

func (*Section) Visit Uses

func (con *Section) Visit(visitor Visitor) error

type Sequence Uses

type Sequence []Content

func (Sequence) Contents Uses

func (con Sequence) Contents() []Content

func (Sequence) IsFlow Uses

func (con Sequence) IsFlow() bool

func (Sequence) String Uses

func (con Sequence) String() string

func (Sequence) Visit Uses

func (con Sequence) Visit(visitor Visitor) error

type String Uses

type String string
var Empty String

func (String) IsFlow Uses

func (str String) IsFlow() bool

func (String) String Uses

func (str String) String() string

func (String) Visit Uses

func (str String) Visit(visitor Visitor) error

type Style Uses

type Style string
const (
    StyleVerbatim    Style = "verbatim"
    StyleItalic      Style = "italic"
    StyleBold        Style = "bold"
    StyleLarger      Style = "larger"
    StyleSmaller     Style = "smaller"
    StyleStrike      Style = "strike"
    StyleSuperscript Style = "superscript"
    StyleSubscript   Style = "subscript"
    StyleInset       Style = "inset"
    StyleAside       Style = "aside"
)

type Styled Uses

type Styled struct {
    Style Style
    Block bool

    Content  Content
    Partials Partials
}

func (Styled) IsFlow Uses

func (con Styled) IsFlow() bool

func (Styled) Partial Uses

func (con Styled) Partial(name string) Content

func (Styled) String Uses

func (con Styled) String() string

func (Styled) Visit Uses

func (con Styled) Visit(visitor Visitor) error

type Table Uses

type Table struct {
    Rows [][]Content
}

func (Table) IsFlow Uses

func (con Table) IsFlow() bool

func (Table) String Uses

func (con Table) String() string

func (Table) Visit Uses

func (con Table) Visit(visitor Visitor) error

type TableOfContents Uses

type TableOfContents struct {
    Section *Section
}

func (TableOfContents) IsFlow Uses

func (con TableOfContents) IsFlow() bool

func (TableOfContents) String Uses

func (con TableOfContents) String() string

func (TableOfContents) Visit Uses

func (con TableOfContents) Visit(visitor Visitor) error

type Tag Uses

type Tag struct {
    Name  string
    Title Content

    Section *Section
    Anchor  string

    Content Content
}

type Target Uses

type Target struct {
    TagName string
    Title   Content
    Content Content
}

func (Target) IsFlow Uses

func (con Target) IsFlow() bool

func (Target) String Uses

func (con Target) String() string

func (Target) Visit Uses

func (con Target) Visit(visitor Visitor) error

type Visitor Uses

type Visitor interface {
    VisitString(String) error
    VisitSequence(Sequence) error
    VisitReference(*Reference) error
    VisitLink(Link) error
    VisitSection(*Section) error
    VisitParagraph(Paragraph) error
    VisitTableOfContents(TableOfContents) error
    VisitPreformatted(Preformatted) error
    VisitStyled(Styled) error
    VisitTarget(Target) error
    VisitImage(Image) error
    VisitList(List) error
    VisitTable(Table) error
    VisitDefinitions(Definitions) error
}

Directories

PathSynopsis
ast
baselit
booklitcmd
booklitdoc
chroma
load
render
stages
tests
tests/fixtures/arbitrary-style-plugin
tests/fixtures/partials-style-plugin
tests/fixtures/set-partials-plugin
tests/fixtures/stringer-plugin

Package booklit imports 4 packages (graph) and is imported by 12 packages. Updated 2018-11-09. Refresh now. Tools for package owners.