External Data

Main Page > External Data

Jump to Table of Contents

YUIDoc generates a data.json file after it parses your API documentation. Using the external.data config option, you can point it to another data.json file from another project and YUIDoc will import that data and mix it with your API documentation.

This is very handy when you are extending another project and would like to link back to their API documentation.

Configuration

Create an external object under the options object in your yuidoc.json file and give it a property called data (can be an array) pointing to the URL of the external data.json file you wish to import.

{
  "options": {
    "external": {
      "data": "http://yuilibrary.com/yui/docs/api/data.json"
    }
  }
}

Merging Data

Currently, YUIDoc will merge the external data and flag it as external. Then, internally, YUIDoc will use that data when it see's a reference to it (in an @extends or @use documentation block. It will then link over to the external API docs just as if it was part of this documentation system.

Future Plans

In the future, YUIDoc will allow you to specify that you want to mix the data natively instead if making it a special external link. This will allow you to pull in all of the remote data and render their docs along side your docs, instead of just linking to them.

Also, the current external data is fetched on each run. This will eventually be cached as to not take so long to generate the docs.