markdown-serve/resolver

Markdown file resolver

Description:
  • Markdown file resolver

Source:
Author:
License:
  • MIT License

(require("markdown-serve/resolver"))(urlPath, rootDir, optionsopt) → {string}

Description:
  • File resolver utility

Source:
Parameters:
Name Type Attributes Description
urlPath string

Relative URL path to file to try to resolve. Must start with a / and do not include the file extension

rootDir string

Full path to root folder on file system that contains files to resolve

options resolverOptions <optional>

Optional options to specify default page name and file extension

Properties
Name Type Attributes Default Description
defaultPageName string <optional>
index

Name of default document

fileExtension string <optional>
md

File extension of Markdown files

useExtensionInUrl boolean <optional>
false

If true, the file extension will not be removed from the url when resolving it

Returns:

Full path to Markdown file if it exists, otherwise null

Type
string

Requires

  • module:path
  • module:fs

Methods

module:markdown-serve/resolver(urlPath, rootDir, optionsopt) → {string}

Description:
  • File resolver utility

Source:
Parameters:
Name Type Attributes Description
urlPath string

Relative URL path to file to try to resolve. Must start with a / and do not include the file extension

rootDir string

Full path to root folder on file system that contains files to resolve

options resolverOptions <optional>

Optional options to specify default page name and file extension

Properties
Name Type Attributes Default Description
defaultPageName string <optional>
index

Name of default document

fileExtension string <optional>
md

File extension of Markdown files

useExtensionInUrl boolean <optional>
false

If true, the file extension will not be removed from the url when resolving it

Returns:

Full path to Markdown file if it exists, otherwise null

Type
string