API Docs for: 0.10.0
Show:

DocBuilder Class

Defined in: lib/builder.js:15
Module: yuidoc

Takes the JSON data from the DocParser class, creates and parses markdown and handlebars based templates to generate static HTML content

Methods

_addHelpers

(
  • helpers
)

Defined in lib/builder.js:126

Register a Y.Handlebars helper method

Parameters:

  • helpers Object

    Object containing a hash of names and functions

_inlineCode

(
  • html
)
HTML private

Defined in lib/builder.js:768

Ported from Selleck, this handles `'s in fields that are not parsed by the Markdown parser.

Parameters:

  • html HTML

    The HTML to parse

Returns:

HTML:

The parsed HTML

_mixExternal

() private

Defined in lib/builder.js:297

Mixes the various external data soures together into the local data, augmenting it with flags.

_parseCode

(
  • html
)
HTML private

Defined in lib/builder.js:755

Parses <pre><code> tags and adds the prettyprint className to them

Parameters:

  • html HTML

    The HTML to parse

Returns:

HTML:

The parsed HTML

addFoundAt

(
  • a
)
String

Defined in lib/builder.js:626

Parses file and line number from an item object and build's an HREF

Parameters:

Returns:

String:

The parsed HREF

augmentData

(
  • o
)
Object

Defined in lib/builder.js:642

Augments the DocParser meta data to provide default values for certain keys as well as parses all descriptions with the Markdown Parser

Parameters:

  • o Object

    The object to recurse and augment

Returns:

Object:

The augmented object

compile

(
  • cb
)

Defined in lib/builder.js:1738

Compiles the templates from the meta-data provided by DocParser

Parameters:

  • cb Callback

    The callback to execute after it's completed

filterFileName

(
  • f
)
String

Defined in lib/builder.js:1725

Normalizes a file path to a writable filename:

var path = 'lib/file.js'; returns 'lib_file.js';

Parameters:

  • f String

    The filename to normalize

Returns:

String:

The filtered file path

getProjectMeta

() Object

Defined in lib/builder.js:434

Prep the meta data to be fed to Selleck

Returns:

Object:

The project metadata

hasProperty

(
  • a
  • b
)

Defined in lib/builder.js:1056

Checks an array of items (class items) to see if an item is in that list

Parameters:

  • a Array

    The Array of items to check

  • b Object

    The object to find

Returns:

Boolean

makeDirs

(
  • cb
)

Defined in lib/builder.js:702

Makes the default directories needed

Parameters:

  • cb Callback

    The callback to execute after it's completed

markdown

(
  • data
)
HTML private

Defined in lib/builder.js:144

Wrapper around the Markdown parser so it can be normalized or even side stepped

Parameters:

  • data String

    The Markdown string to parse

Returns:

HTML:

The rendered HTML

mergeExtends

(
  • info
  • classItems
  • first
)

Defined in lib/builder.js:1080

Merge superclass data into a child class

Parameters:

  • info Object

    The item to extend

  • classItems Array

    The list of items to merge in

  • first Boolean

    Set for the first call

mixExternal

(
  • cb
)
async

Defined in lib/builder.js:345

Fetches the remote data and fires the callback when it's all complete

Parameters:

  • cb Callback

    The callback to execute when complete

nameSort

(
  • a
  • b
)
Number

Defined in lib/builder.js:1546

Sort method of array of objects with a property called name

Parameters:

  • a Object

    First object to compare

  • b Object

    Second object to compare

Returns:

Number:

1, -1 or 0 for sorting.

populateClasses

(
  • opts
)
Object

Defined in lib/builder.js:477

Populate the meta data for classes

Parameters:

  • opts Object

    The original options

Returns:

Object:

The modified options

populateElements

(
  • opts
)
Object

Defined in lib/builder.js:501

Populate the meta data for elements

Parameters:

  • opts Object

    The original options

Returns:

Object:

The modified options

populateFiles

(
  • opts
)
Object

Defined in lib/builder.js:569

Populate the meta data for files

Parameters:

  • opts Object

    The original options

Returns:

Object:

The modified options

populateModules

(
  • opts
)
Object

Defined in lib/builder.js:523

Populate the meta data for modules

Parameters:

  • opts Object

    The original options

Returns:

Object:

The modified options

render

(
  • source
  • view
  • [layout=null]
  • [partials={}]
  • callback
)

Defined in lib/builder.js:787

Ported from Selleck Renders the handlebars templates with the default View class.

Parameters:

  • source HTML

    The default template to parse

  • view Class

    The default view handler

  • [layout=null] HTML optional

    The HTML from the layout to use.

  • [partials={}] Object optional

    List of partials to include in this template

  • callback Callback
    • err Error
    • html HTML

      The assembled template markup

renderAPIMeta

(
  • cb
)
async

Defined in lib/builder.js:1691

Render the API meta and return the JavaScript

Parameters:

  • cb Callback

    The callback

    • apijs String

      The JavaScript code to write API meta data

renderClass

(
  • cb
)

Defined in lib/builder.js:1132

Render the class file

Parameters:

  • cb Function

    The callback fired when complete

    • html String

      The HTML to render this view

    • view Object

      The View Data

renderElement

(
  • cb
)

Defined in lib/builder.js:1425

Render the element file

Parameters:

  • cb Function

    The callback fired when complete

    • html String

      The HTML to render this view

    • view Object

      The View Data

renderFile

(
  • cb
)

Defined in lib/builder.js:1619

Render the source file

Parameters:

  • cb Function

    The callback fired when complete

    • html String

      The HTML to render this view

    • view Object

      The View Data

renderIndex

(
  • cb
)

Defined in lib/builder.js:843

Render the index file

Parameters:

  • cb Function

    The callback fired when complete

    • html String

      The HTML to render this view

    • view Object

      The View Data

renderModule

(
  • cb
)

Defined in lib/builder.js:905

Render a module

Parameters:

  • cb Function

    The callback fired when complete

    • html String

      The HTML to render this view

    • view Object

      The View Data

writeAPIMeta

(
  • cb
)
async

Defined in lib/builder.js:1678

Write the API meta data used for the AutoComplete widget

Parameters:

  • cb Callback

    The callback to execute when complete

writeComponents

(
  • type
  • cb
)

Defined in lib/builder.js:1502

Generates the class or element files under "out"/classes/ or "out"/elements/

Parameters:

  • type String

    The component type, "classes" or "elements"

  • cb Callback

    The callback to execute after it's completed

    • html String

      The HTML to write class view

    • view Object

      The View Data

writeFiles

(
  • cb
)

Defined in lib/builder.js:1569

Generates the syntax files under "out"/files/

Parameters:

  • cb Callback

    The callback to execute after it's completed

    • html String

      The HTML to write file view

    • view Object

      The View Data

writeIndex

(
  • cb
)

Defined in lib/builder.js:879

Generates the index.html file

Parameters:

  • cb Callback

    The callback to execute after it's completed

    • html String

      The HTML to write index view

    • view Object

      The View Data

writeModules

(
  • cb
)

Defined in lib/builder.js:1013

Generates the module files under "out"/modules/

Parameters:

  • cb Callback

    The callback to execute after it's completed

    • html String

      The HTML to write module view

    • view Object

      The View Data

Properties

_mergeCounter

Number private

Defined in lib/builder.js:1073

Counter for stepping into merges

_meta

Object private

Defined in lib/builder.js:427

Holder for project meta data

files

Number

Defined in lib/builder.js:421

File counter