Documentation ¶
Index ¶
- Variables
- type Block
- type Blocks
- type CodeBlock
- func (b *CodeBlock) Attributes() map[string]string
- func (b *CodeBlock) Content() string
- func (b *CodeBlock) Executable() string
- func (b *CodeBlock) Intro() string
- func (b *CodeBlock) Line(idx int) string
- func (b *CodeBlock) LineCount() int
- func (b *CodeBlock) Lines() (result []string)
- func (b *CodeBlock) MapLines(fn func(string) (string, error)) error
- func (b *CodeBlock) MarshalJSON() ([]byte, error)
- func (b *CodeBlock) Name() string
- func (b *CodeBlock) SetExtracted(val bool)
- func (b *CodeBlock) Start() int
- func (b *CodeBlock) Stop() int
- type CodeBlocks
- type MarkdownBlock
- type NameResolver
- type ParsedSource
- type Source
- type Updater
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIndexOutOfRange = errors.New("block index out of range")
Functions ¶
This section is empty.
Types ¶
type Blocks ¶
type Blocks []Block
func (Blocks) CodeBlocks ¶
func (b Blocks) CodeBlocks() (result CodeBlocks)
type CodeBlock ¶
type CodeBlock struct {
// contains filtered or unexported fields
}
func (*CodeBlock) Attributes ¶
Attributes returns code block attributes detected in the first line. They are of a form: "sh { attr=value }".
func (*CodeBlock) Executable ¶
Executable returns an identifier of a program to execute the block.
func (*CodeBlock) Intro ¶
Intro returns a normalized description of the code block based on the preceding paragraph.
func (*CodeBlock) MarshalJSON ¶
func (*CodeBlock) SetExtracted ¶ added in v0.3.0
type CodeBlocks ¶
type CodeBlocks []*CodeBlock
func (CodeBlocks) Lookup ¶
func (b CodeBlocks) Lookup(name string) *CodeBlock
func (CodeBlocks) Names ¶
func (b CodeBlocks) Names() (result []string)
type MarkdownBlock ¶
type MarkdownBlock struct {
// contains filtered or unexported fields
}
func (*MarkdownBlock) Content ¶
func (b *MarkdownBlock) Content() string
func (*MarkdownBlock) MarshalJSON ¶
func (b *MarkdownBlock) MarshalJSON() ([]byte, error)
func (*MarkdownBlock) SetExtracted ¶ added in v0.3.0
func (b *MarkdownBlock) SetExtracted(val bool)
func (*MarkdownBlock) Start ¶ added in v0.3.0
func (b *MarkdownBlock) Start() int
func (*MarkdownBlock) Stop ¶ added in v0.3.0
func (b *MarkdownBlock) Stop() int
type NameResolver ¶ added in v0.3.0
type ParsedSource ¶
type ParsedSource struct {
// contains filtered or unexported fields
}
func (*ParsedSource) Blocks ¶
func (s *ParsedSource) Blocks() Blocks
func (*ParsedSource) Root ¶
func (s *ParsedSource) Root() ast.Node
func (*ParsedSource) Source ¶
func (s *ParsedSource) Source() []byte
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) Parse ¶
func (s *Source) Parse() *ParsedSource
type Updater ¶ added in v0.3.0
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶ added in v0.3.0
func NewUpdater(parsed *ParsedSource) *Updater
func NewUpdaterWithSource ¶ added in v0.3.0
func (*Updater) Parsed ¶ added in v0.3.0
func (u *Updater) Parsed() *ParsedSource
func (*Updater) UpdateBlock ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.