DocBuilder Class
Takes the JSON
data from the DocParser
class, creates and parses markdown and handlebars
based templates to generate static HTML content
Item Index
Methods
- _addHelpers
- _inlineCode
- _mixExternal
- _parseCode
- _parseCrossLink
- addFoundAt
- augmentData
- compile
- filterFileName
- getProjectMeta
- hasProperty
- makeDirs
- markdown
- mergeExtends
- mixExternal
- nameSort
- populateClasses
- populateElements
- populateFiles
- populateModules
- render
- renderAPIMeta
- renderClass
- renderElement
- renderFile
- renderIndex
- renderModule
- writeAPIMeta
- writeComponents
- writeFiles
- writeIndex
- writeModules
Properties
Methods
_addHelpers
-
helpers
Register a Y.Handlebars
helper method
Parameters:
-
helpers
ObjectObject containing a hash of names and functions
_inlineCode
-
html
Ported from Selleck, this handles `
's in fields
that are not parsed by the Markdown parser.
Parameters:
-
html
HTMLThe HTML to parse
Returns:
The parsed HTML
_mixExternal
()
private
Mixes the various external data soures together into the local data, augmenting it with flags.
_parseCode
-
html
Parses <pre><code>
tags and adds the prettyprint className
to them
Parameters:
-
html
HTMLThe HTML to parse
Returns:
The parsed HTML
_parseCrossLink
-
item
-
[raw=false]
-
[content]
Parse the item to be cross linked and return an HREF linked to the item
addFoundAt
-
a
Parses file and line number from an item object and build's an HREF
Parameters:
-
a
ObjectThe item to parse
Returns:
The parsed HREF
augmentData
-
o
Augments the DocParser meta data to provide default values for certain keys as well as parses all descriptions
with the Markdown Parser
Parameters:
-
o
ObjectThe object to recurse and augment
Returns:
The augmented object
compile
-
cb
Compiles the templates from the meta-data provided by DocParser
Parameters:
-
cb
CallbackThe callback to execute after it's completed
filterFileName
-
f
Normalizes a file path to a writable filename:
var path = 'lib/file.js'; returns 'lib_file.js';
Parameters:
-
f
StringThe filename to normalize
Returns:
The filtered file path
getProjectMeta
()
Object
Prep the meta data to be fed to Selleck
Returns:
The project metadata
hasProperty
-
a
-
b
Checks an array of items (class items) to see if an item is in that list
Returns:
Boolean
makeDirs
-
cb
Makes the default directories needed
Parameters:
-
cb
CallbackThe callback to execute after it's completed
markdown
-
data
Wrapper around the Markdown parser so it can be normalized or even side stepped
Parameters:
-
data
StringThe Markdown string to parse
Returns:
The rendered HTML
mergeExtends
-
info
-
classItems
-
first
Merge superclass data into a child class
mixExternal
-
cb
Fetches the remote data and fires the callback when it's all complete
Parameters:
-
cb
CallbackThe callback to execute when complete
nameSort
-
a
-
b
Sort method of array of objects with a property called name
Returns:
1, -1 or 0 for sorting.
populateClasses
-
opts
Populate the meta data for classes
Parameters:
-
opts
ObjectThe original options
Returns:
The modified options
populateElements
-
opts
Populate the meta data for elements
Parameters:
-
opts
ObjectThe original options
Returns:
The modified options
populateFiles
-
opts
Populate the meta data for files
Parameters:
-
opts
ObjectThe original options
Returns:
The modified options
populateModules
-
opts
Populate the meta data for modules
Parameters:
-
opts
ObjectThe original options
Returns:
The modified options
render
-
source
-
view
-
[layout=null]
-
[partials={}]
-
callback
Ported from Selleck Renders the handlebars templates with the default View class.
renderAPIMeta
-
cb
Render the API meta and return the JavaScript
Parameters:
-
cb
CallbackThe callback
-
apijs
StringThe JavaScript code to write API meta data
-
renderClass
-
cb
Render the class file
renderElement
-
cb
Render the element file
renderFile
-
cb
Render the source file
renderIndex
-
cb
Render the index file
renderModule
-
cb
Render a module
writeAPIMeta
-
cb
Write the API meta data used for the AutoComplete widget
Parameters:
-
cb
CallbackThe callback to execute when complete
writeComponents
-
type
-
cb
Generates the class or element files under "out"/classes/ or "out"/elements/
writeFiles
-
cb
Generates the syntax files under "out"/files/
writeIndex
-
cb
Generates the index.html file