Utils Class
Utilities Class
Item Index
Methods
escapeHTML
-
html
Escapes HTML characters in html.
Parameters:
-
htmlStringString to escape.
Returns:
fixType
-
t
Takes a type string and converts it to a "First letter upper cased" type. e.g. (string -> String, object -> Object)
Parameters:
-
tStringThe type string to convert
Returns:
getDirs
-
dir
Walks the tree from this dir and returns all the subdirs
Parameters:
-
dirStringThe dir to begin at
Returns:
getLayouts
-
dir
Like getPages(), but returns only the files under the layout/ subdirectory
of the specified dir.
Parameters:
-
dirStringDirectory path.
Returns:
getPage
-
pagePath
Loads and returns the content of the specified page file.
Parameters:
-
pagePathStringPath to a single
.handlebarspage.
Returns:
null if not found.
getPages
-
dir
Loads pages (files with a .handlebars extension) in the specified directory and
returns an object containing a mapping of page names (the part of the filename)
preceding the .handlebars extension) to page content.
Parameters:
-
dirStringDirectory path.
Returns:
getPartials
-
dir
Like getPages(), but returns only the files under the partial/ subdirectory
of the specified dir.
Parameters:
-
dirStringDirectory path.
Returns:
getProjectData
-
[dir=process.cwd()]
Walk the directory tree to locate the yuidoc.json file.
Parameters:
-
[dir=process.cwd()]Path optionalThe directory to start from
prepare
-
inDir -
options -
callback
Mix/merge/munge data into the template.
unindent
-
content
Normalizes the initial indentation of the given content so that the first line is unindented, and all other lines are unindented to the same degree as the first line. So if the first line has four spaces at the beginning, then all lines will be unindented four spaces.
Parameters:
-
contentStringText to unindent.
