Global

Methods

clone(files, path, newPath)

Source:

Clone a specific Definition.

Parameters:
Name Type Description
files Dictionary
path string

Find a Definition with this path

newPath string

The path for the cloned Definition

copy(files, destination)

Source:

Copy every Definition to a destination directory.

Parameters:
Name Type Description
files Dictionary
destination string

filter(fn, condition)

Source:

Higher-order function that applies a filter to a part of a sequence.

Parameters:
Name Type Description
fn function

Sequential function to execute on the filtered items

condition function

Filter condition

forkDefinition(path, def)

Source:

Build a Definition based on another Definition. Does not transfer additional properties.

Parameters:
Name Type Description
path string

The path for the new Definition

def Definition

Existing Definition

frontmatter(files, optionsopt)

Source:

Parses the frontmatter of every Definition, using the gray-matter library. Note that if you want to use something else than yaml, you have to pass along the parser like so { parser: toml.parse, lang: 'toml' }.

Parameters:
Name Type Attributes Description
files Dictionary
options Object <optional>

Options to pass to gray-matter

metadata(files, data, optionsopt)

Source:

Add data to every Definition.

Parameters:
Name Type Attributes Description
files Dictionary
data Object
options Object <optional>
Properties
Name Type Description
path string

parentPath(files)

Source:

Add parentPath to every Definition. Or in other words, the path for the parent directory. Does not define this property if there is no parent directory.

Parameters:
Name Type Description
files Dictionary

pathToRoot(files, additionalLevelsopt)

Source:

Add pathToRoot to every Definition. For example, the pathToRoot value will be ../ for a definition with dirname example.

Parameters:
Name Type Attributes Default Description
files Dictionary
additionalLevels int <optional>
0
Source:

Convert the path of every Definition to the format dirname/index.extname. Does not change definitions that already have the basename 'index'.

Parameters:
Name Type Description
files Dictionary

read(files)

Source:

Read the content of every Definition.

Parameters:
Name Type Description
files Dictionary

rename(files, oldPath, newPath)

Source:

Change the path of a specific Definition.

Parameters:
Name Type Description
files Dictionary
oldPath string

Find a Definition with this path

newPath string

The new path for the matched Definition

renameExt(files, replaceWith)

Source:

Change the extension/extname of every Definition.

Parameters:
Name Type Description
files Dictionary
replaceWith string

The next extension (e.g. .html)

store(src, obj, pathopt)

Source:

Clone source object and then copy in another object at a certain path or root.

Parameters:
Name Type Attributes Description
src Object

Source object

obj Object

Another object

path string <optional>

Path in the source object

svgSprite(files, config)

Source:

Make a svg sprite consisting out of the given Definitions.

Parameters:
Name Type Description
files Dictionary
config string

Configuration object for svg-sprite

templates(files, renderer, optionsopt)

Source:

Render templates and/or layouts.

Parameters:
Name Type Attributes Description
files Dictionary
renderer Renderer
options Object <optional>
Properties
Name Type Description
layouts string

Or options.layout

onlyApplyLayout string

webpack(files, config)

Source:

Execute a Webpack configuration, and make a Dictionary.

Parameters:
Name Type Description
files Dictionary
config Object

Webpack config object

write(files, destination)

Source:

Write the content of every Definition to disk.

Parameters:
Name Type Description
files Dictionary
destination string

Type Definitions

Renderer

Source: