- FSAccessError ⇐
Error
Filesystem access error, providing the inaccessible path in the error message.
- HLJSHighlightAutoError ⇐
HLJSHighlightError
Represents an error encountered when automatically highlighting an input string with
highlight.js
.- HLJSHighlightError ⇐
Error
Represents an error encountered when highlighting an input string with an explicit language via
highlight.js
.
- VALID_MARKDOWN_EXTENSIONS :
Array.<string>
Valid markdown extensions. Currently .md and .markdown are considered.
- renderCommandHandler([args])
Renders markdown files to HTML based on passed parameters.
- renderFile([args]) ⇒
Promise.<RenderableFile>
Renders a single markdown file to HTML.
- ensurePath([dirPath]) ⇒
Promise
Ensures the specified path is accessible.
- getFilesInDirectoryByExts([args]) ⇒
Promise.<Array.<string>>
Returns all markdown files in the specified directory as fs nodes. By default considers files with '.md' or '.markdown' extensions.
- getMdFilesInDirectory([args]) ⇒
Promise.<Array.<string>>
Returns markdown files in the requested directory. Optionally recurses.
- getNodesInDirectory([args]) ⇒
Promise.<DirectoryNodes>
Returns an array of filenames in the specified directory.
Filesystem access error, providing the inaccessible path in the error message.
Kind: global class
Extends: Error
- FSAccessError ⇐
Error
Creates a new error object.
Param | Type | Description |
---|---|---|
path | string |
path that was deemed inaccessible |
origError | Error |
original error, if any |
Returns the inaccessible path.
Kind: instance method of FSAccessError
Returns: string
- path - path that was deemed inaccessible
HLJSHighlightAutoError ⇐ HLJSHighlightError
Represents an error encountered when automatically highlighting an input
string with highlight.js
.
Kind: global class
Extends: HLJSHighlightError
Creates a new HLJSHighlightAutoError object.
Param | Type | Description |
---|---|---|
lang | string |
source language |
str | string |
source |
origError | Error |
original error, if any |
Returns the string that triggered the error.
Kind: instance method of HLJSHighlightAutoError
Overrides: getString
Returns: string
- str
Represents an error encountered when highlighting an input string with an
explicit language via highlight.js
.
Kind: global class
Extends: Error
- HLJSHighlightError ⇐
Error
Creates a new HLJSHighlightAutoError object.
Param | Type | Description |
---|---|---|
lang | string |
source language |
str | string |
source |
origError | Error |
original error, if any |
Returns the string that triggered the error.
Kind: instance method of HLJSHighlightError
Returns: string
- str
Valid markdown extensions. Currently .md and .markdown are considered.
Renders markdown files to HTML based on passed parameters.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
[args] | object |
{} |
arguments |
[args.overwrite] | boolean |
false |
if true, existing files are overwritten |
[args.hidden] | boolean |
true |
if false, hidden files (names starting with a '.') will not be rendered |
args.dest | string |
destination directory to write HTML output too | |
args.src | string |
source path to read markdown files from | |
args.recursive | string |
if directories are to be searched for further renderable files. |
renderFile([args]) ⇒ Promise.<RenderableFile>
Renders a single markdown file to HTML.
Kind: global function
Returns: Promise.<RenderableFile>
- p
Param | Type | Default | Description |
---|---|---|---|
[args] | Object |
{} |
args |
args.file | FSFile |
file to render | |
args.srcPath | string |
source path | |
args.destPath | string |
destination path | |
args.overwrite | boolean |
overwrite existing files |
Ensures the specified path is accessible.
Kind: global function
Returns: Promise
- p - resolves on success
Throws:
FSAccessError
if the path is not accessible.
Param | Type | Default | Description |
---|---|---|---|
[dirPath] | string |
"''" |
path to check |
Returns all markdown files in the specified directory as fs nodes. By default considers files with '.md' or '.markdown' extensions.
Kind: global function
Returns: Promise.<Array.<string>>
- p
Throws:
Error
if the directory is not accessible.
Param | Type | Default | Description |
---|---|---|---|
[args] | object |
{} |
args - args |
[args.dirPath] | string |
"''" |
path to search for markdown files in |
[args.allowHidden] | boolean |
false |
if true, includes hidden files (prefixed with a '.') in results. |
[args.exts] | Array.<string> |
extensions to filter for | |
[args.recursive] | boolean |
if true, recurses into subdirectories |
Returns markdown files in the requested directory. Optionally recurses.
Kind: global function
Returns: Promise.<Array.<string>>
- p
See: getFilesInDirectoryByExts
Todo
- add a typedef for the shared arguments
Param | Type | Default | Description |
---|---|---|---|
[args] | object |
{} |
args, @see getFilesInDirectoryByExts |
getNodesInDirectory([args]) ⇒ Promise.<DirectoryNodes>
Returns an array of filenames in the specified directory.
Kind: global function
Returns: Promise.<DirectoryNodes>
- p
Throws:
FSAccessError
if the directory is not accessible.
Param | Type | Default | Description |
---|---|---|---|
[args] | object |
{} |
args |
[args.dirPath] | string |
"''" |
directory to read |
[args.recursive] | boolean |
false |
if true, recurses into subdirectories |
[args.files] | boolean |
true |
allows files in res |
[args.directories] | boolean |
true |
allows directories in res |
[args.allowHidden] | boolean |
false |
if true, includes hidden files (prefixed with a '.') in res. |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
filePath | string |
path for the source file |
fileDestPath | string |
path for the rendered file |
fileSourceMD | string |
source file markdown content |
fileHTML | string |
rendered file HTML content |
fileRenderDurationMTS | number |
milliseconds to render |
fileRendered | boolean |
true if the destination file was written |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
dirPath | string |
base path for all file & directory names |
[files] | Array.<string> |
array of filenames |
[directories] | Array.<string> |
array of directory names |