Universal generator module to create directories files and template based contents
Methods
(static) convertMarkdown(doc) → {Object}
Convert each markdown-format fields of the object to HTML
Parameters:
Name | Type | Description |
---|---|---|
doc |
Object | The document |
Returns:
- A copy of the original document with processed markdown field values
- Type
- Object
(static) copyDir(opts)
Copy directories
Parameters:
Name | Type | Description |
---|---|---|
opts |
Object | The options of the copy operation. An object which has the following properties:
|
(static) copyFile(fileName, sourceBaseDir, targetBaseDir)
Copy one file
Parameters:
Name | Type | Description |
---|---|---|
fileName |
String | The name of the file to copy |
sourceBaseDir |
String | The source directory |
targetBaseDir |
String | The target directory |
(static) processTemplate(context, opts)
Process a Handlebars template and extrapolates with the given context data, and write into a file.
Parameters:
Name | Type | Description |
---|---|---|
context |
Object | The context data to fill into the template |
opts |
Object | The template options:
|
(inner) loadPartials(basePath) → {Object}
Load template partial files
The function loads every file in the given folder, as a text file, then
then hangs them to an object, as properties.
The property names will be the filenames, of the original partial files, without the full path.
Parameters:
Name | Type | Description |
---|---|---|
basePath |
String | The path to the directory which contains the partials |
Returns:
- An object, which contains the partials.
- Type
- Object