Using YUIDoc

Main Page > Basic Usage

Jump to Table of Contents

Using YUIDoc

YUIDoc Configuration

YUIDoc supports 2 ways to configure it's output. Command line arguments and the yuidoc.json file. You can see all of the available command line arguments here.

JSON Configuration

Here is a sample yuidoc.json file that used in the YUI 3 project.

{
    "name": "YUI 3",
    "description": "YUI 3 JavaScript Framework",
    "version": "3.5.0",
    "url": "http://yuilibrary.com/",
    "options": {
        "linkNatives": "true",        
        "attributesEmit": "true",
        "selleck": "true",
        "ignorePaths": [ "simpleyui" ],
        "paths": "*/js",
        "outdir": "../api-js"
    }
}

And the current YUIDoc yuidoc.json file:

{
  "name": "YUIDoc",
  "description": "YUIDoc documentation tool written in Javascript",
  "version": "0.2.38",
  "url": "http://yuilibrary.com/projects/yuidoc",
  "logo": "http://yuilibrary.com/img/yui-logo.png",
  "options": {
    "external": {
      "data": "http://yuilibrary.com/yui/docs/api/data.json"
    },
    "linkNatives": "true",
    "attributesEmit": "true",
    "paths": [
      "./lib"
    ],
    "outdir": "./output/api"
  }
}

The yuidoc.json file needs to live in a directory somewhere under where you will be executing yuidoc. YUIDoc will scan the tree for this file before doing anything else.

JSON Options

Project Information

name The name of the project
description Projects description
version Current version of the documentation.
url The URL of the project
logo The logo to add to the header (defaults to the YUI logo).

Below are a few of the options available.

linkNatives This will autolink native types (String, Object, Boolean, etc..) over to the Mozilla Developer Network.
attributesEmit This will have YUIDoc autogenerate event docs for an attribute. YUI's Attribute system auto fires change events, this setting turns on the documentation for this.
selleck If true, YUIDoc will search for a component.json file above the source tree and attach that data to the module data as extra information.
ignorePaths A list of paths to ignore when scanning the source tree.
paths A glob to use when searching the source tree for docs to parse.
outdir The directory to place the rendered files
external.data A link to an external yuidoc.json file to merge into the local api docs. See the external data example for more info.