@emdaer/plugin-import
An emdaer plugin that imports content from another file
importPlugin
Import content into your readme
Content can be imported in a few ways, as long as it’s a string
- a local path to a markdown file, a partial of your readme. ex: .emdaer/README/USAGE.md.
- a path to a node module that contains markdown files in its pacakge. ex: moduleName/lib/file.md.
- a path to a node module exporting a string. ex: moduleName/lib/todo.js
- a path to a node module exporting a function that takes arguments and returns/resolves to a string ex: module
Parameters
options any
options.path string? The filename to require.
options.args array? An array of args to pass to the exported function at the required path.
options.runEmdaer boolean? Whether or not to run emdaer on the content.
Returns Promise<string> The contents at the path or the execution results
getMarkdownPaths
Gets a list of possible paths for the given file
This may be a relative path, check that first, then check in node modules.
Parameters
filePath string
path string the node module or relative path to append to the possible directories.
Returns Array<string> list of possible paths for the given file