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 Version = "0.0.0-dev"

overridden via linker flags

func ErrorPage Uses

func ErrorPage(err error, w http.ResponseWriter)

func RegisterPlugin Uses

func RegisterPlugin(name string, factory PluginFactory)

type AmbiguousReferenceError Uses

type AmbiguousReferenceError struct {
    TagName          string
    DefinedLocations []ErrorLocation

    ErrorLocation
}

func (AmbiguousReferenceError) Error Uses

func (err AmbiguousReferenceError) Error() string

func (AmbiguousReferenceError) PrettyHTML Uses

func (err AmbiguousReferenceError) PrettyHTML(out io.Writer) error

func (AmbiguousReferenceError) PrettyPrint Uses

func (err AmbiguousReferenceError) PrettyPrint(out io.Writer)

type AnnotationData Uses

type AnnotationData struct {
    FilePath                  string
    EOF                       bool
    Lineno                    string
    Prefix, Annotated, Suffix string
}

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 ErrorLocation Uses

type ErrorLocation struct {
    FilePath     string
    NodeLocation ast.Location
    Length       int
}

func (ErrorLocation) Annotate Uses

func (loc ErrorLocation) Annotate(msg string, args ...interface{}) string

func (ErrorLocation) AnnotateLocation Uses

func (loc ErrorLocation) AnnotateLocation(out io.Writer) error

func (ErrorLocation) AnnotatedHTML Uses

func (loc ErrorLocation) AnnotatedHTML(out io.Writer) error

type FailedFunctionError Uses

type FailedFunctionError struct {
    Function string
    Err      error

    ErrorLocation
}

func (FailedFunctionError) Error Uses

func (err FailedFunctionError) Error() string

func (FailedFunctionError) PrettyHTML Uses

func (err FailedFunctionError) PrettyHTML(out io.Writer) error

func (FailedFunctionError) PrettyPrint Uses

func (err FailedFunctionError) PrettyPrint(out io.Writer)

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 ParseError Uses

type ParseError struct {
    Err error

    ErrorLocation
}

func (ParseError) Error Uses

func (err ParseError) Error() string

func (ParseError) PrettyHTML Uses

func (err ParseError) PrettyHTML(out io.Writer) error

func (ParseError) PrettyPrint Uses

func (err ParseError) PrettyPrint(out io.Writer)

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 PrettyError Uses

type PrettyError interface {
    PrettyPrint(io.Writer)
    PrettyHTML(io.Writer) error
}

type Reference Uses

type Reference struct {
    TagName string
    Content Content

    Tag *Tag

    // original location of the reference
    Location ast.Location
}

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

    Processor       SectionProcessor
    PluginFactories []PluginFactory
    Plugins         []Plugin

    Location       ast.Location
    InvokeLocation ast.Location
}

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) FilePath Uses

func (con *Section) FilePath() string

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) Next Uses

func (con *Section) Next() *Section

func (*Section) NextSibling Uses

func (con *Section) NextSibling() *Section

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) Prev Uses

func (con *Section) Prev() *Section

func (*Section) SetPartial Uses

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

func (*Section) SetTag Uses

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

func (*Section) SetTagAnchored Uses

func (con *Section) SetTagAnchored(name string, title Content, loc ast.Location, content Content, anchor string)

func (*Section) SetTitle Uses

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

func (*Section) SimilarTags Uses

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

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 SectionProcessor Uses

type SectionProcessor interface {
    EvaluateFile(*Section, string, []PluginFactory) (*Section, error)
    EvaluateNode(*Section, ast.Node, []PluginFactory) (*Section, 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
    Location ast.Location
    Anchor   string

    Content Content
}

type Target Uses

type Target struct {
    TagName  string
    Location ast.Location
    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 UndefinedFunctionError Uses

type UndefinedFunctionError struct {
    Function string

    ErrorLocation
}

func (UndefinedFunctionError) Error Uses

func (err UndefinedFunctionError) Error() string

func (UndefinedFunctionError) PrettyHTML Uses

func (err UndefinedFunctionError) PrettyHTML(out io.Writer) error

func (UndefinedFunctionError) PrettyPrint Uses

func (err UndefinedFunctionError) PrettyPrint(out io.Writer)

type UnknownTagError Uses

type UnknownTagError struct {
    TagName string

    SimilarTags []Tag

    ErrorLocation
}

func (UnknownTagError) Error Uses

func (err UnknownTagError) Error() string

func (UnknownTagError) PrettyHTML Uses

func (err UnknownTagError) PrettyHTML(out io.Writer) error

func (UnknownTagError) PrettyPrint Uses

func (err UnknownTagError) PrettyPrint(out io.Writer)

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
chroma
chroma/plugin
errhtmlCode generated for package errhtml by go-bindata DO NOT EDIT.
load
render
render/htmlCode generated for package html by go-bindata DO NOT EDIT.
render/textCode generated for package text by go-bindata DO NOT EDIT.
stages
tests
tests/fixtures/arbitrary-style-plugin
tests/fixtures/erroring-plugin
tests/fixtures/partials-style-plugin
tests/fixtures/set-partials-plugin
tests/fixtures/stringer-plugin

Package booklit imports 14 packages (graph) and is imported by 13 packages. Updated 2020-10-06. Refresh now. Tools for package owners.