Defined in: lib/AssetUtils.js
A bunch of utilities for dealing with asset files.
Do not instantiate this factory directly, instead, use the compiler's instance.
| String | getAssetPath(String) |
| String | getRelativeAssetPath(String) |
| void | writeAsset(String, String|Buffer) |
| void | writeTmpFile() |
| Array.<String> | globAndFilter(String|Array.<String>, Array.<String>|Array.<RegExp>) |
config | Objectmegadoc's runtime config. |
Convert a relative asset path into an absolute path.
relativePath | String |
String |
Example
getAssetPath("doc/*.md");
// => "/path/to/project/doc/*.md"Convert a full asset path into one relative to the asset root.
absolutePath | String |
String |
Example
getRelativeAssetPath("/path/to/project/doc/something.md");
// => "doc/something.md"Glob a bunch of (relative) source paths for files and optionally filter them.
sourcePatterns | String|Array.<String>Minimatch-style patterns of source files. These paths are expected to be relative to the assetRoot. See AssetUtils#getAssetPath. |
rawFilters | Array.<String>|Array.<RegExp>Patterns to filter the globbed file paths by. |
Array.<String>A list of matched files. |
Copy a local file into the destination output directory.
fileName | StringRelative path to the output file. For example, if this is a JS
script you need to require, this will be relative to
|
contents | String|BufferThe contents of the file. |
Made with ♥ using megadoc.