Documentation ¶
Overview ¶
Package gen is the packeg of internal gen
Index ¶
Constants ¶
const ( // ImportIdent is import directive identifier ImportIdent = "import" // Root is the List key for root, starting point of resolving Root = "_" )
Variables ¶
var ( // ErrRootNotFound is returned when root is not found ErrRootNotFound = errors.New("Root is not found") // ErrVariableNotFound is returned when variable is not found ErrVariableNotFound = errors.New("No such variable ident") )
Functions ¶
func ExpandEach ¶
Types ¶
type Gen ¶
type Gen struct { BasePath string // must be absolute SrcPath string // must be relative DstPath string // must be relative }
Gen is the struct for gen cmd
type List ¶
List is all Variable list. map key is the key to access Variable
type Loader ¶
Loader is the interface that provides the way to get Variables from document.
Ext returns file extension, e.g. md, html. If the given file is matched to this, then the loader will be used to resolve.
Load is the function to get Variables from document.
type Node ¶
type Node struct { Key string Content Variables Deps []string // contains filtered or unexported fields }
Node is the deps tree node.
type Variables ¶
type Variables map[string]interface{}
Variables is the type expressing front matters
func MapToVariables ¶
func Resolve ¶
Resolve resolves th given list into Variables aling with the key "_" Internally, this uses ResolveKey with key = Root
func ResolveKey ¶
ResolveKey resolves the given list into Variables along with the given key as root.
func (Variables) ContainsImports ¶
ContainsImports checks Variable imports or not.