Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including hexo-yuidoc with all npm packages installed. Try it out:

var hexoYuidoc = require("hexo-yuidoc")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

hexo-yuidoc v0.2.2

YUIDoc generator for Hexo

YUIDoc

Generate YUIDoc with Hexo.

Install

$ npm install hexo-yuidoc --save

Usage

Requirements

You have to install YUIDoc first.

$ npm install yuidocjs -g

Generating

Generate raw data with YUIDoc first. Then, move data.json to source/_yuidoc folder. You can rename data.json to whatever you like. For example:

index.json => /api/classes/Class.html
foo.json => /api/foo/classes/Foo.html

Templates

You have to at least add two templates to the layout folder of the theme:

  • api/class
  • api/module

You can get the model from site.yuidoc and get the name of current yuidoc from page.yuidoc_name in templates.

Helpers

yuidoc_type

Gets the link of specified data types. You can use a string or an array. Multiple types will be separated by |. Besides classes in the database, you can also use native types.

<%- yuidoc_type('String') %>
<%- yuidoc_type(['String', 'Array']) %>

yuidoc_params

Generates a parameter list.

<%- yuidoc_params(params) %>

get_current_yuidoc

<% get_current_yuidoc() %>

Tags

You can use all tags and filters in your documentation.

crosslink

You can use crosslink to cross-reference other classes.

{% crosslink class/item:[type] [link text] %}

Options

You can configure this plugin in _config.yml.

yuidoc_dir: api
  • yuidoc_dir - Where generated files will be saved (Default: api)
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free