Documentation ¶
Index ¶
- func FilterCodeBlocks[T FileCodeBlock](blocks []T, allowUnknown bool, allowUnnamed bool) (result []T)
- func Format(files []string, basePath string, flatten bool, formatJSON bool, write bool, ...) error
- func GetCodeBlocks(filepath string, fs billy.Basic) (document.CodeBlocks, error)
- func GetCodeBlocksAndParseFrontmatter(filepath string, fs billy.Basic) (document.CodeBlocks, document.Frontmatter, error)
- func GetCurrentGitEmail(cwd string) (string, error)
- func IsCodeBlockNotFoundError(err error) bool
- func LoadProjectFiles(proj Project) ([]string, error)
- func ReadMarkdownFile(filepath string, fs billy.Basic) ([]byte, error)
- func WriteMarkdownFile(filename string, fs billy.Basic, data []byte) error
- type Branch
- type CodeBlock
- type CodeBlockFS
- type CodeBlocks
- func (blocks CodeBlocks) Lookup(queryName string) []CodeBlock
- func (blocks CodeBlocks) LookupByFile(queryFile string) ([]CodeBlock, error)
- func (blocks CodeBlocks) LookupByID(query string) ([]CodeBlock, error)
- func (blocks CodeBlocks) LookupWithFile(queryFile string, queryName string) ([]CodeBlock, error)
- func (blocks CodeBlocks) Names() []string
- type DirectoryProject
- func (p *DirectoryProject) Dir() string
- func (p *DirectoryProject) EnvLoadOrder() []string
- func (p *DirectoryProject) LoadEnvs() (map[string]string, error)
- func (p *DirectoryProject) LoadTasks(filesOnly bool, channel chan<- interface{})
- func (p *DirectoryProject) SetEnvLoadOrder(envLoadOrder []string)
- func (p *DirectoryProject) SetRespectGitignore(respectGitignore bool)
- type DirectoryProjectMatcher
- type ErrCodeBlockFileNotFound
- type ErrCodeBlockNameNotFound
- type FileCodeBlock
- type LoadTaskError
- type LoadTaskFoundFile
- type LoadTaskFoundTask
- type LoadTaskParsingFile
- type LoadTaskSearchingFolder
- type LoadTaskStatusParsingFiles
- type LoadTaskStatusSearchingFiles
- type Project
- type ProjectLoader
- type Resolver
- type SingleFileProject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterCodeBlocks ¶
func FilterCodeBlocks[T FileCodeBlock](blocks []T, allowUnknown bool, allowUnnamed bool) (result []T)
func GetCodeBlocks ¶
func GetCodeBlocks(filepath string, fs billy.Basic) (document.CodeBlocks, error)
func GetCodeBlocksAndParseFrontmatter ¶
func GetCodeBlocksAndParseFrontmatter(filepath string, fs billy.Basic) (document.CodeBlocks, document.Frontmatter, error)
func GetCurrentGitEmail ¶
func LoadProjectFiles ¶
Load files, blocking until all projects are loaded
func ReadMarkdownFile ¶
func WriteMarkdownFile ¶
Types ¶
type CodeBlock ¶
type CodeBlock struct { Block *document.CodeBlock /// Relative to `project.Root()` File string Frontmatter document.Frontmatter // contains filtered or unexported fields }
func (CodeBlock) GetFileRel ¶
func (CodeBlock) GetFrontmatter ¶
func (b CodeBlock) GetFrontmatter() document.Frontmatter
type CodeBlockFS ¶
type CodeBlockFS interface { billy.Basic billy.Chroot }
type CodeBlocks ¶
type CodeBlocks []CodeBlock
func LoadProjectTasks ¶
func LoadProjectTasks(proj Project) (CodeBlocks, error)
Load tasks, blocking until all projects are loaded
func (CodeBlocks) Lookup ¶
func (blocks CodeBlocks) Lookup(queryName string) []CodeBlock
func (CodeBlocks) LookupByFile ¶
func (blocks CodeBlocks) LookupByFile(queryFile string) ([]CodeBlock, error)
func (CodeBlocks) LookupByID ¶
func (blocks CodeBlocks) LookupByID(query string) ([]CodeBlock, error)
func (CodeBlocks) LookupWithFile ¶
func (blocks CodeBlocks) LookupWithFile(queryFile string, queryName string) ([]CodeBlock, error)
func (CodeBlocks) Names ¶
func (blocks CodeBlocks) Names() []string
type DirectoryProject ¶
type DirectoryProject struct {
// contains filtered or unexported fields
}
func NewDirectoryProject ¶
func (*DirectoryProject) Dir ¶
func (p *DirectoryProject) Dir() string
func (*DirectoryProject) EnvLoadOrder ¶
func (p *DirectoryProject) EnvLoadOrder() []string
func (*DirectoryProject) LoadEnvs ¶
func (p *DirectoryProject) LoadEnvs() (map[string]string, error)
func (*DirectoryProject) LoadTasks ¶
func (p *DirectoryProject) LoadTasks(filesOnly bool, channel chan<- interface{})
func (*DirectoryProject) SetEnvLoadOrder ¶
func (p *DirectoryProject) SetEnvLoadOrder(envLoadOrder []string)
func (*DirectoryProject) SetRespectGitignore ¶
func (p *DirectoryProject) SetRespectGitignore(respectGitignore bool)
type DirectoryProjectMatcher ¶
type DirectoryProjectMatcher struct {
// contains filtered or unexported fields
}
TODO(mxs): support `.runmeignore` file
type ErrCodeBlockFileNotFound ¶
type ErrCodeBlockFileNotFound struct {
// contains filtered or unexported fields
}
func (ErrCodeBlockFileNotFound) Error ¶
func (e ErrCodeBlockFileNotFound) Error() string
func (ErrCodeBlockFileNotFound) FailedFileQuery ¶
func (e ErrCodeBlockFileNotFound) FailedFileQuery() string
type ErrCodeBlockNameNotFound ¶
type ErrCodeBlockNameNotFound struct {
// contains filtered or unexported fields
}
func (ErrCodeBlockNameNotFound) Error ¶
func (e ErrCodeBlockNameNotFound) Error() string
func (ErrCodeBlockNameNotFound) FailedNameQuery ¶
func (e ErrCodeBlockNameNotFound) FailedNameQuery() string
type FileCodeBlock ¶
type LoadTaskError ¶
type LoadTaskError struct {
Err error
}
type LoadTaskFoundFile ¶
type LoadTaskFoundFile struct {
Filename string
}
type LoadTaskFoundTask ¶
type LoadTaskFoundTask struct {
Task CodeBlock
}
type LoadTaskParsingFile ¶
type LoadTaskParsingFile struct {
Filename string
}
type LoadTaskSearchingFolder ¶
type LoadTaskSearchingFolder struct {
Folder string
}
type LoadTaskStatusParsingFiles ¶
type LoadTaskStatusParsingFiles struct{}
type LoadTaskStatusSearchingFiles ¶
type LoadTaskStatusSearchingFiles struct{}
type Project ¶
type Project interface { // Loads tasks in project, sending details to provided channel. Will block, but is thread-safe. // // Received messages for the channel will be of type `project.LoadTask*`. The // channel will be closed on finish or error. // // Use `filesOnly` to just find files, skipping markdown parsing LoadTasks(filesOnly bool, channel chan<- interface{}) LoadEnvs() (map[string]string, error) EnvLoadOrder() []string Dir() string }
type ProjectLoader ¶
type ProjectLoader struct {
// contains filtered or unexported fields
}
func (ProjectLoader) LoadTasks ¶
func (pl ProjectLoader) LoadTasks(proj Project, allowUnknown bool, allowUnnamed bool, filter bool) (CodeBlocks, error)
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
type SingleFileProject ¶
type SingleFileProject struct {
// contains filtered or unexported fields
}
func NewSingleFileProject ¶
func NewSingleFileProject(file string, allowUnknown bool, allowUnnamed bool) *SingleFileProject
func (*SingleFileProject) Dir ¶
func (p *SingleFileProject) Dir() string
func (*SingleFileProject) EnvLoadOrder ¶
func (p *SingleFileProject) EnvLoadOrder() []string
func (*SingleFileProject) LoadEnvs ¶
func (p *SingleFileProject) LoadEnvs() (map[string]string, error)
func (*SingleFileProject) LoadTasks ¶
func (p *SingleFileProject) LoadTasks(filesOnly bool, channel chan<- interface{})
Click to show internal directories.
Click to hide internal directories.