Documentation ¶
Index ¶
- Constants
- func ExtractGithubRepoName(n string) (string, string, error)
- func SmellsLikeGithubCloneArg(arg string) bool
- type BlockBase
- type DataSet
- type DataSource
- func (d *DataSource) AbsPath() FilePath
- func (d *DataSource) Display() string
- func (d *DataSource) GithubCloneArg() string
- func (d *DataSource) Href() string
- func (d *DataSource) IsGithub() bool
- func (d *DataSource) Raw() string
- func (d *DataSource) RelPath() FilePath
- func (d *DataSource) SetAbsPath(arg string)
- type FilePath
- func (n FilePath) Base() string
- func (n FilePath) IsDesirableDir() bool
- func (n FilePath) IsDesirableFile() bool
- func (n FilePath) IsEmpty() bool
- func (n FilePath) IsOrderFile() bool
- func (n FilePath) Join(e os.DirEntry) FilePath
- func (n FilePath) Read() (string, error)
- func (n FilePath) ReadDir() ([]os.DirEntry, error)
- type Label
- type MdProse
- type OpaqueCode
Constants ¶
const ( // WildCardLabel matches any label. WildCardLabel = Label(`__wildcard__`) // AnonLabel may be used as a label placeholder when a label is needed but not specified. AnonLabel = Label(`__anonymous__`) // SleepLabel indicates the author wants a sleep after the block in a test context // where there is no natural human-caused pause. SleepLabel = Label(`sleep`) )
Variables ¶
This section is empty.
Functions ¶
func ExtractGithubRepoName ¶
ExtractGithubRepoName parses strings like git@github.com:monopole/mdrip.git or https://github.com/monopole/mdrip, extracting the repository name and the path inside the repository.
func SmellsLikeGithubCloneArg ¶
SmellsLikeGithubCloneArg returns true if the argument seems like it could be GitHub url or `git clone` argument.
Types ¶
type BlockBase ¶
type BlockBase struct {
// contains filtered or unexported fields
}
BlockBase groups OpaqueCode with prose commentary.
type DataSet ¶
type DataSet struct {
// contains filtered or unexported fields
}
DataSet indicates the origin of multiple markdown sources.
func NewDataSet ¶
NewDataSet makes a dataset from the given args.
func (*DataSet) FirstArg ¶
func (d *DataSet) FirstArg() *DataSource
FirstArg is, uh, the first member of the dataset - sometimes special.
type DataSource ¶
type DataSource struct {
// contains filtered or unexported fields
}
DataSource is where markdown came from.
func (*DataSource) AbsPath ¶
func (d *DataSource) AbsPath() FilePath
AbsPath is the absolute file system path of the datasource.
func (*DataSource) Display ¶
func (d *DataSource) Display() string
Display is a string intended for display.
func (*DataSource) GithubCloneArg ¶
func (d *DataSource) GithubCloneArg() string
GithubCloneArg returns the data source in a form suitable for `git clone`.
func (*DataSource) Href ¶
func (d *DataSource) Href() string
Href returns a browser url compatible form of the datasource.
func (*DataSource) IsGithub ¶
func (d *DataSource) IsGithub() bool
IsGithub is true if the datasource was GitHub.
func (*DataSource) RelPath ¶
func (d *DataSource) RelPath() FilePath
RelPath is the relative file system path of the datasource.
func (*DataSource) SetAbsPath ¶
func (d *DataSource) SetAbsPath(arg string)
SetAbsPath changes the path.
type FilePath ¶
type FilePath string
FilePath holds a file path and offers mdrip specific methods on it.
func (FilePath) IsDesirableDir ¶
IsDesirableDir returns true if the directory should be processed.
func (FilePath) IsDesirableFile ¶
IsDesirableFile returns true if the filepath seems like markdown.
func (FilePath) IsOrderFile ¶
IsOrderFile returns true if the file appears to be a "reorder" file specifying how to re-order the files in the directory in some fashion other than directory order.
type Label ¶
type Label string
Label is used to select code blocks, and group them into categories, e.g. run these blocks under test, run these blocks to do setup, etc.
type MdProse ¶
type MdProse []byte
MdProse is documentation (plain text or markdown) for OpaqueCode.
type OpaqueCode ¶
type OpaqueCode string
OpaqueCode is an opaque, uninterpreted, unknown block of text that is presumably shell commands parsed from markdown. Fed into a shell interpreter, the entire thing either succeeds or fails.
func NoCode ¶
func NoCode() OpaqueCode
NoCode is a constructor for NoCode - easy to search for usage.