Class utils
Class defined in:lib/utils.js:6
Utilities Class
escapeHTML
( html
)
lib/utils.js:24
Escapes HTML characters in html.
Parameters:-
html
<String> String to escape.
getLayouts
( dir
)
lib/utils.js:58
Like getPages()
, but returns only the files under the layout/
subdirectory
of the specified dir.
-
dir
<String> Directory path.
getPage
( pagePath
)
lib/utils.js:71
Loads and returns the content of the specified page file.
Parameters:-
pagePath
<String> Path to a single.handlebars
page.
null
if not found.getPages
( dir
)
lib/utils.js:84
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.
-
dir
<String> Directory path.
getPartials
( dir
)
lib/utils.js:115
Like getPages()
, but returns only the files under the partial/
subdirectory
of the specified dir.
-
dir
<String> Directory path.
getProjectData
( [dir=process.cwd()]
)
lib/utils.js:214
Walk the directory tree to locate the yuidoc.json file.
Parameters:-
[dir=process.cwd()]
<Path> The directory to start from
prepare
( inDir, options, callback
)
lib/utils.js:129
Mix/merge/munge data into the template.
Parameters:unindent
( content
) /* private method */
lib/utils.js:37
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:-
content
<String> Text to unindent.
validatePaths
( paths, [ignore=false]
)
lib/utils.js:244
Make sure all the paths passed are directories and that they are not in the ignore list.
Parameters: