API Docs for: 0.2.40
Show:

DocBuilder Class

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

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

Methods

_inlineCode

(
  • html
)
HTML private

Defined in lib/builder.js:602

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

_parseCode

(
  • html
)
HTML private

Defined in lib/builder.js:590

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

Parameters:

  • html HTML

    The HTML to parse

Returns:

HTML: The parsed HTML

augmentData

(
  • o
)
Object

Defined in lib/builder.js:486

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:1288

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:1275

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

fixType

(
  • t
)
String private

Defined in lib/builder.js:12

Takes a type string and converts it to a "First letter upper cased" type. e.g. (string -> String, object -> Object)

Parameters:

  • t String

    The type string to convert

Returns:

String: The fixed string

getProjectMeta

() Object

Defined in lib/builder.js:337

Prep the meta data to be fed to Selleck

Returns:

Object: The project metadata

makeDirs

(
  • cb
)

Defined in lib/builder.js:549

Makes the default directories needed

Parameters:

  • cb Callback

    The callback to execute after it's completed

markdown

(
  • md
  • def
  • tags
)
HTML private

Defined in lib/builder.js:29

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

Parameters:

  • md String

    The Markdown string to parse

  • def Boolean

    Only allow default set of HTML tags

  • tags Array

    An array of tags to allow

Returns:

HTML: The rendered HTML

nameSort

(
  • a
  • b
)
Number

Defined in lib/builder.js:1148

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:375

Populate the meta data for classes

Parameters:

  • opts Object

    The original options

Returns:

Object: The modified options

populateFiles

(
  • opts
)
Object

Defined in lib/builder.js:427

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:390

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:621

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

renderIndex

(
  • cb
  • cv.view
)

Defined in lib/builder.js:671

Render the index file

Parameters:

  • cb Function

    The callback fired when complete

    • html String

      The HTML to render this view

  • cv.view Object

    The View Data

writeClasses

(
  • cb
)

Defined in lib/builder.js:1119

Generates the class files under "out"/classes/

Parameters:

  • cb Callback

    The callback to execute after it's completed

writeFiles

(
  • cb
)

Defined in lib/builder.js:1171

Generates the syntax files under "out"/files/

Parameters:

  • cb Callback

    The callback to execute after it's completed

writeIndex

(
  • cb
)

Defined in lib/builder.js:696

Generates the index.html file

Parameters:

  • cb Callback

    The callback to execute after it's completed

writeModules

(
  • cb
)

Defined in lib/builder.js:779

Generates the module files under "out"/modules/

Parameters:

  • cb Callback

    The callback to execute after it's completed

Properties

defaultTags

String

Defined in lib/builder.js:324

The default tags to use in params descriptions (for Markdown).

files

Number

Defined in lib/builder.js:331

File counter