0.1.0 • Published 10 years ago
task-registry-file-layout v0.1.0
task-registry-file-layout 
- Apply a layout to the file contents.
- Register a layout to the system.
- add the layout search path for directory.
Usage
Task = require 'task-registry'
require 'task-registry-file-layout'
layout = Task 'layout'
# register the layout as 'main' layout
# the name is optional, the file base name is the name if no name.
layout.executeSync path: 'main.layout', isDefaultLayout: true, overwrite: true
# apply the layout to the file contents.
# the layout could be a name or a file path.
layout.executeSync path: 'hi.md', layout: 'main'API
executeSync(aFile)orexecute(aFile, done):- the
aFileshould be a json object or the File object.pathString: the file path- apply the layout to the file contents
layoutString: apply the layout to the file
- the file contents as a layout to register
nameString: the layout name to register (optional). the file basename is the layout name unless exists.isDefaultLayoutBoolean: whether this is the default layout. defaults to false.overwriteBoolean: whether overwrite if the layout name has already exists. defaults to false.layoutBaseString: this layoutBase will wrap(nest) the layout.layoutTagString: the name of the placeholder tag. defaults to 'body'layoutDelimsArray of String|Regex: the placeholder delimiters to use. This can be a regex, like/\{{([^}]+)\}}/, or an array of delimiter strings, like['{{', '}}']. defaults to{% body %}is used as the placeholder (insertion point) for content.
- the
TODO
License
MIT