Skip to content

Parse Vitepress Comment

Functions

parseComment(fileContent)object

Parses the content of a file to search for a @vitepress comment block and extracts the frontmatter data.

parseVitepressFileHeader(content, file)string

Parses the content of a file and constructs a structured markdown header based on the @vitepress comment block.

parseComment(fileContent) ⇒ object

Parses the content of a file to search for a @vitepress comment block and extracts the frontmatter data.

Kind: global function
Returns: object - - An object containing the extracted frontmatter data and attributes.
Throws:

  • Error - Returns an object with null values if parsing fails.
ParamTypeDescription
fileContentstringThe content of the file to be parsed.

parseVitepressFileHeader(content, file) ⇒ string

Parses the content of a file and constructs a structured markdown header based on the @vitepress comment block.

Kind: global function
Returns: string - - A structured markdown header.

ParamTypeDescription
contentstringThe content of the file.
fileDirectoryFileThe file object containing details like name and extension.

Released under the MIT License.