Documentation ¶
Index ¶
- Variables
- func CountTrailingLineBreaks(source []byte, lineBreak []byte) int
- func DetectLineBreak(source []byte) []byte
- type Attributes
- type Block
- type BlockKind
- type Blocks
- type CodeBlock
- func (b *CodeBlock) Attributes() map[string]string
- func (b *CodeBlock) Background() bool
- func (b *CodeBlock) Categories() []string
- func (b *CodeBlock) Clone() *CodeBlock
- func (b *CodeBlock) Content() []byte
- func (b *CodeBlock) Cwd() string
- func (b *CodeBlock) Document() *Document
- func (b *CodeBlock) ExcludeFromRunAll() bool
- func (b *CodeBlock) FirstLine() string
- func (b *CodeBlock) ID() string
- func (b *CodeBlock) Interactive() bool
- func (b *CodeBlock) Interpreter() string
- func (b *CodeBlock) Intro() string
- func (b *CodeBlock) IsUnknown() bool
- func (b *CodeBlock) IsUnnamed() bool
- func (CodeBlock) Kind() BlockKind
- func (b *CodeBlock) Language() string
- func (b *CodeBlock) Lines() []string
- func (b *CodeBlock) MarshalJSON() ([]byte, error)
- func (b *CodeBlock) Name() string
- func (b *CodeBlock) PromptEnv() bool
- func (b *CodeBlock) SetLine(p int, v string)
- func (b *CodeBlock) TextRange() (textRange TextRange)
- func (b *CodeBlock) Unwrap() ast.Node
- func (b *CodeBlock) Value() []byte
- type CodeBlocks
- type Document
- type Frontmatter
- type InnerBlock
- type MarkdownBlock
- type Node
- type ParsedSections
- type RunmeMetadata
- type RunmeMetadataDocument
- type RunmeMetadataSession
- type TextRange
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAttributeParser = newFailoverAttributeParser(
[]attributeParser{
&jsonParser{},
&babikMLParser{},
},
&jsonParser{},
)
View Source
var ErrFrontmatterInvalid = stderrors.New("invalid frontmatter")
Functions ¶
func CountTrailingLineBreaks ¶
func DetectLineBreak ¶
Types ¶
type Attributes ¶
type CodeBlock ¶
type CodeBlock struct {
// contains filtered or unexported fields
}
func (*CodeBlock) Attributes ¶
func (*CodeBlock) Background ¶
func (*CodeBlock) Categories ¶
func (*CodeBlock) ExcludeFromRunAll ¶
func (*CodeBlock) Interactive ¶
func (*CodeBlock) Interpreter ¶
func (*CodeBlock) MarshalJSON ¶ added in v3.2.5
type CodeBlocks ¶
type CodeBlocks []*CodeBlock
func CollectCodeBlocks ¶
func CollectCodeBlocks(node *Node) (result CodeBlocks)
func (CodeBlocks) Names ¶
func (b CodeBlocks) Names() (result []string)
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func (*Document) ContentOffset ¶
ContentOffset returns the position of source from which the actual content starts. If a value <0 is returned, it means that the source is not parsed yet.
Frontmatter is not a part of the content.
func (*Document) Frontmatter ¶
func (d *Document) Frontmatter() (*Frontmatter, error)
func (*Document) TrailingLineBreaksCount ¶
type Frontmatter ¶
type Frontmatter struct { Runme RunmeMetadata `yaml:"runme,omitempty"` Shell string `yaml:"shell"` Cwd string `yaml:"cwd"` Category string `yaml:"category"` SkipPrompts bool `yaml:"skipPrompts,omitempty"` // contains filtered or unexported fields }
func ParseFrontmatter ¶
func ParseFrontmatter(raw []byte) (*Frontmatter, error)
TODO(adamb): it should be removed when the complete refactoring of the project is finished.
type InnerBlock ¶
type InnerBlock struct {
// contains filtered or unexported fields
}
InnerBlock represents a non-leaf block. It helps to handle nested fenced code blocks for block quotes and list items.
func (InnerBlock) Kind ¶
func (InnerBlock) Kind() BlockKind
func (*InnerBlock) Unwrap ¶
func (b *InnerBlock) Unwrap() ast.Node
func (*InnerBlock) Value ¶
func (b *InnerBlock) Value() []byte
type MarkdownBlock ¶
type MarkdownBlock struct {
// contains filtered or unexported fields
}
func (MarkdownBlock) Kind ¶
func (MarkdownBlock) Kind() BlockKind
func (*MarkdownBlock) Unwrap ¶
func (b *MarkdownBlock) Unwrap() ast.Node
func (*MarkdownBlock) Value ¶
func (b *MarkdownBlock) Value() []byte
type ParsedSections ¶
func ParseSections ¶
func ParseSections(source []byte) (result ParsedSections, _ error)
type RunmeMetadata ¶
type RunmeMetadata struct { ID string `yaml:"id,omitempty" json:"id,omitempty" toml:"id,omitempty"` Version string `yaml:"version,omitempty" json:"version,omitempty" toml:"version,omitempty"` Document RunmeMetadataDocument `yaml:"document,omitempty" json:"document,omitempty" toml:"document,omitempty"` Session RunmeMetadataSession `yaml:"session,omitempty" json:"session,omitempty" toml:"session,omitempty"` }
type RunmeMetadataDocument ¶
type RunmeMetadataDocument struct {
RelativePath string `yaml:"relativePath,omitempty" json:"relativePath,omitempty" toml:"relativePath,omitempty"`
}
type RunmeMetadataSession ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.