hoast-transform
Transform the content of files based on the extension.
As the name suggest this is a hoast module. The module has been based of metalsmith-in-place.
Usage
Install hoast-transform using npm.
$ npm install hoast-transform
Parameters
options
: Options given to the JSTransformer.- Type:
Object
- Default:
{}
- Default:
- Type:
patterns
: Glob patterns to match file paths with. If the engine function is set it will only give the function any files matching the pattern.- Type:
String
orArray of strings
- Required:
no
- Required:
- Type:
patternOptions
: Options for the glob pattern matching. See planckmatch options for more details on the pattern options.- Type:
Object
- Default:
{}
- Type:
patternOptions.all
: This options is added topatternOptions
, and determines whether all patterns need to match instead of only one.- Type:
Boolean
- Default:
false
- Type:
Example
CLI
Script
const Hoast = ;const read = Hoastread transform = ; ;
In the examples the markdown files will be transformed to HTML.
Troubleshooting
If you are having problems with the module please enable debugging to have a closer look.
File not valid for processing.
- The file is not utf-8 encoded.
- The file path does not match any of the patterns.
No valid transformer found for extension .
- Check if the JSTransformer associated with the extension is installed.