API functions

Functions#

buildCategoryTopics(bulletList, [options])Array.Object

Build list of topics and subcategories in a category.

buildHeaders(bulletlist, [level])Array

Build headers as template variables

buildSectionCategories(bulletList, [options])object

Build items of navigation section.

buildTopicPage(title, [options])string

Create topic documentation topic in Markdown.

getDocumentParts(sourceFile)

Get document parts in specified file

saveDocumentParts(sourceFile, program)

Create parts files for a specified topic document

getSidebars(sourceFilename)object

Extract sidebar title and sidebar outline from a Markdown file.

getTopicHeaders(bulletlist, Command)Array

Build topic top headers

getUniqueName(name)string

Return a variant string

hasHeaders(topicItem)boolean

Checks whether the topic has headers

isSingleTopic(topicItem)boolean

Checks whether a topic has children topics

makeid(length)string

Return a random string with digital characters of specified length

parseTitle(topicTitle)object

Extract topic title to extract relevant information

saveDocument(fileName, content)

Create a text file in utf-8 format from specified name and content

slug(source)string

Convert specified string into a slug.

Converts spaces, tabs, and visible special characters into dashes (-) -- except backslash (). Compresses sequence of dashes or special characters into a single dash. Removes heading or trailing dashes or special characters from the specified string.

buildCategoryTopics(bulletList, [options]) ⇒ Array.Object#

Build list of topics and subcategories in a category.

Kind: global function
Returns: Array.Object - List of topics and categories.

ParamTypeDefaultDescription
bulletListArrayThe bullet list internal representation.
[options]object{ 'parent': './', 'prefix': '' }Options for building topic slug and folders

buildHeaders(bulletlist, [level]) ⇒ Array#

Build headers as template variables

Kind: global function
Returns: Array - Array of objects where each object is a set of template variables
Opts: object Command line options passed as properties

ParamTypeDefaultDescription
bulletlistArrayRepresentation of list in Markdown abstract tree
[level]number2Heading level for Markdown notation

buildSectionCategories(bulletList, [options]) ⇒ object#

Build items of navigation section.

Kind: global function
Returns: object - Key-value where key is category title and value is a list of items or subcategories.

ParamTypeDefaultDescription
bulletListArrayThe bullet list internal representation.
[options]object{ 'parent': './' }Options for building section slug

buildTopicPage(title, [options]) ⇒ string#

Create topic documentation topic in Markdown.

Kind: global function
Returns: string - Topic unique slug

ParamTypeDefaultDescription
titlestringTopic title
[options]object{ 'headers': [], 'parent': './', 'prefix': '' }Options for creating topic file.

getDocumentParts(sourceFile)#

Get document parts in specified file

Kind: global function

ParamTypeDescription
sourceFilestringPath to documentation file @ @returns {Array.{targetPath: string, content: string}} Array of part object, each part has targetPath and content properties

saveDocumentParts(sourceFile, program)#

Create parts files for a specified topic document

Kind: global function

ParamTypeDescription
sourceFilestringPath to topic document
programobjectOptions passed on command

getSidebars(sourceFilename) ⇒ object#

Extract sidebar title and sidebar outline from a Markdown file.

Kind: global function
Returns: object - Key-value where key is the sidebar title and value is bullet list tree.

ParamTypeDescription
sourceFilenamestringFilename of a Markdown file with outline

getTopicHeaders(bulletlist, Command) ⇒ Array#

Build topic top headers

Kind: global function
Returns: Array - Headers in markdown notation

ParamTypeDescription
bulletlistArrayHeader list represented in Markdown abstrat tree
Commandobjectline options passed as properties

getUniqueName(name) ⇒ string#

Return a variant string

Kind: global function
Returns: string - Original string with suffixed text

ParamTypeDescription
namestringThe name to check for uniqueness

hasHeaders(topicItem) ⇒ boolean#

Checks whether the topic has headers

Kind: global function
Returns: boolean - true if topic has headers, false otherwise.

ParamTypeDescription
topicItemobjectTopic to test whether it has headers

isSingleTopic(topicItem) ⇒ boolean#

Checks whether a topic has children topics

Kind: global function
Returns: boolean - true if single topic, false otherwise

ParamTypeDescription
topicItemobjectTopic to test whether it is single topic

makeid(length) ⇒ string#

Return a random string with digital characters of specified length

Kind: global function
Returns: string - Randomly chosen characters of specified length

ParamTypeDescription
lengthnumberThe length of string to return.

parseTitle(topicTitle) ⇒ object#

Extract topic title to extract relevant information

Kind: global function
Returns: object - Properties extracted from title

ParamTypeDescription
topicTitleobjectTopic title to parse.

saveDocument(fileName, content)#

Create a text file in utf-8 format from specified name and content

Kind: global function

ParamTypeDescription
fileNamestringName of the file to create.
contentstringString to place in the file.

slug(source) ⇒ string#

Convert specified string into a slug.

Converts spaces, tabs, and visible special characters into dashes (-) -- except backslash (). Compresses sequence of dashes or special characters into a single dash. Removes heading or trailing dashes or special characters from the specified string.

Kind: global function
Returns: string - Trimmed, lowercase string with dashes(-)

ParamTypeDescription
sourcestringString to covert to slug.