Code Monkey home page Code Monkey logo

grunt-contrib-yuidoc's Introduction

grunt-contrib-yuidoc v1.0.0 Build Status: Linux Build Status: Windows

Compile YUIDoc Documentation

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-contrib-yuidoc --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-contrib-yuidoc');

This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade, but in case you can't please use v0.3.2.

Yuidoc task

Run this task with the grunt yuidoc command.

Visit the YUIDoc project home for more information on YUIDocs and commenting syntax.

Options

Settings mirror YUIDoc config.

Usage Examples

grunt.initConfig({
  pkg: grunt.file.readJSON('package.json'),
  yuidoc: {
    compile: {
      name: '<%= pkg.name %>',
      description: '<%= pkg.description %>',
      version: '<%= pkg.version %>',
      url: '<%= pkg.homepage %>',
      options: {
        paths: 'path/to/source/code/',
        themedir: 'path/to/custom/theme/',
        outdir: 'where/to/save/docs/'
      }
    }
  }
});

Release History

  • 2015-08-24   v1.0.0   Bump yuidocjs version to v0.10.0. peerDeps updates. Doc updates.
  • 2015-08-24   v0.10.0   Update to yuidocjs ^0.9.0.
  • 2015-06-29   v0.9.0   Update to yuidocjs 0.8.0.
  • 2015-05-11   v0.8.0   Update to yuidocjs 0.7.0.
  • 2015-01-21   v0.7.0   Update to yuidocjs 0.5.0.
  • 2014-12-28   v0.6.0   Update to yuidocjs 0.4.0.
  • 2014-03-12   v0.5.2   Make sure to write JSON data with parseOnly.
  • 2014-02-24   v0.5.1   Fixes parseOnly callback.
  • 2013-09-01   v0.5.0   Catches and reports errors thrown by YUIDoc with grunt.warn.
  • 2013-02-15   v0.4.0   First official release for Grunt 0.4.0.
  • 2013-01-23   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.
  • 2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5.
  • 2012-10-12   v0.3.2   Rename grunt-contrib-lib dep to grunt-lib-contrib.
  • 2012-10-01   v0.3.1   Project options are parsed as templates.
  • 2012-09-23   v0.3.0   Options no longer accepted from global config key.
  • 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo.

Task submitted by George Pantazis

This file was generated on Fri Mar 18 2016 19:12:25.

grunt-contrib-yuidoc's People

Contributors

bleathem avatar ctalkington avatar cyrilf avatar devert avatar devinrhode2 avatar floydpink avatar limikael avatar marcoow avatar mysterlune avatar okuryu avatar shama avatar sindresorhus avatar vladikoff avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-contrib-yuidoc's Issues

Add support for `src`-like behavior with `paths` (or as a separate `src` option)

I just started using this task today but ran into some confusion for a few minutes until I realized that the paths option doesn't use grunt.file.expand.

My config is similar to the following, wherein I'm trying to generate documentation for a Platform codebase plus multiple derived products:

yuidoc: {
  compile: {
    name: "<%= pkg.name %>",
    version: "<%= pkg.version %>",
    options: {
      paths: ["Platform/js", "Products/*/js"],
      outdir: "docs"
    }
  }
}

The workaround (using grunt.file.expand) was easy enough:

yuidoc: {
  compile: {
    name: "<%= pkg.name %>",
    version: "<%= pkg.version %>",
    options: {
      paths: grunt.file.expand(["Platform/js", "Products/*/js"]),
      outdir: "docs"
    }
  }
}

However, it's the behavior that threw me for a loop since I've become very accustomed to the typical auto-expanding nature of Grunt tasks that use the standard Grunt src/filesSrc config patterns. It would be nice to either follow this behavior for this task's paths option, or else provide this behavior via the normal src option that would take precedence over this YUIDoc one-off paths option.

And yes, I understand that (a) my use case is not the norm, and (b) this task was setup such that the options mapped directly to their YUIDoc equivalents.

Anyway, please consider it. If the group is opposed, though, I'm not going to cry about it. 💪

no method 'parsedir' in 0.6.0-0.10.0

Just updated some packages in project and got same error as I found a year ago.
Firstly I addressed it to yuidocjs, but now I found out, that this problem depends on grunt-contrib-yuidoc version.

Problem description with debugging is HERE: yui/yuidoc#242

For now we use "yuidocjs": "0.9.0" and "grunt-contrib-yuidoc": "0.5.0" without any problems, but when we use 0.6...10 versions of your package, we are getting same error as described in the linked youdocjs issue 242.

Warning: Object src/ has no method 'parsedir' Use --force to continue.

gruntfile config:

{//...
yuidoc: {
            compile: {
                name:        '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version:     '<%= pkg.version %>',
                url:         'http://example.com',
                options:     {
                    paths:       'src/',
                    //themedir: 'path/to/custom/theme/',
                    outdir:      'doc/code',
                    "extension": ".ts"
                }

            }

        }
}

see the full description of error HERE: yui/yuidoc#242

Add TypeScript (.ts) support.

I tried a few things to see if I can this plugin to generate docs for TypeScript files but I am not sure what to do. Can you add support for TypeScript files?

Using yuidoc in an SSL environment

Hi,

I'm using yuidoc and trying to view within my jenkins environment, however rather annoyingly some script/css tags links are hardcoded to:

<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>

Which creates a security alert when behind https.

Is there a way to fix this?

Thanks

JD

Settings names not documented

hello

Thanks for this project; it's very useful. I ran into a small problem when trying to configure it to use the --no-code flag (to suppress the "found at suchandsuch.js, line 456" messages). The readme states that "Settings mirror YUIDoc config.", but in fact that's not exactly the case. The page that is linked to lists command line arguments, such as this for the one I wanted to set:

image

But if I set --no-code in the Grunt config it was ignored. Looking through the source for yuidoc:

https://github.com/yui/yuidoc/blob/e7f26989a0a403389d4b05894c5f04bde399f361/lib/options.js#L79

I noticed that in fact these command line flags are converted:

image

and it is these converted values that you need to set in the Grunt config. So for me it was this:

nocode:true

Perhaps this is abundantly obvious to everyone else and this issue is a waste of time. But perhaps not.

There are two slight complications in the conversion of command line flags to actual flags:

image

..some command line flags cause two options to be set, and:

image

not all command line flags are converted in the same way. --no-code becomes nocode, so you'd be tempted to suggest --project-version would become projectversion. But it does not.

Setting Theme path.

I've been trying to use a different theme but with no luck it always uses the default. I used the "themedir" under "options" is this the correct way?

run server instead of build docs

I tried using this plugin but found it better to just setup a Makefile to run yuidoc --server I had a really hard time getting it to run out of the Gruntfile (even with some plugins)

Paths glob not working

When trying to use a path glob, task is unable to find directory.

Example:

paths: 'tasks/*/.js'

grunt-contrib-yuidoc doesn't find anything

Hello,
I am very new to this documentation thing, so I guess I am missing the obvious but apparently I am not able to compile a documentation:

https://gist.github.com/Soelen/48c89b78adaf02fa42e8

app/Controller has like 5 files, I gisted one of those 5 called UsersController.

I must do something wrong, I just don't see it. Please if anyone would be so kind, point me out what exactly I am doing wrong.

Thanks in advance!

Parse project properties as templates.

It would be quite helpful if project properties (project name, description, version etc.) could be parsed as templates: this would allow e.g. to use version information from the package or other locations.

Example:

grunt.initConfig({
    ...
    pkg: '<json:package.json>',
    ...

    yuidoc: {
        myTask : {
            name: '<%= pkg.name %>',
            description: '<%= pkg.description %>',
            version: '<%= pkg.version %>,
            options: {
                ...
            }
        }
        ...
    }
    ...
});

Option for displaying warnings

Currently, use yuidoc with Grunt doesn't display any yuidoc warning (like detecting unknown tags)

is it possible to add a way to display them ?

It could help a lot to find typos.

data.json empty sometimes

I'm running the yuidoc:compile task with parseOnly: true and sometimes (ca. 3 out of 4 times) the generated data.json file is empty.

Sorry for this being a relatively unspecific bug report but that's really all I can say - sometimes there's JSON in the file, sometimes not. Fortunately the code this problem occurs with is open source so the bug can be easily reproduced. The repo is here: https://github.com/simplabs/ember-simple-auth; just run grunt yuidoc:compile and check tmp/data.json- sometimes it's empty, sometimes not.

Update for compatibility with grunt 0.4.0rc5

I need someone to help update this plugin to work with grunt 0.4.0rc5.

I had to revert the whole file src-dest mappings implicit iteration abstraction per gruntjs/grunt#606, and once again, multi tasks have to iterate over this.files manually. In addition, there's a new this.filesSrc array that contains a reduced, uniqued set of all matched src files in case the task is read-only and only cares about source files.

See:

Notes:

  • A user may specify a new option nonull in addition to src to tell grunt to keep patterns or filepaths that don't actually match files. Because of this, the task shouldn't explode if a nonexistent src filepath is encountered. I handle this in the grunt-contrib-concat by warning if not grunt.file.exists but not failing the task.

Guidelines for updating / publishing this plugin:

  • Change this project's version number to one ending in "rc5" so that it's clearer that it works with grunt 0.4.0rc5. If the existing version number doesn't end in an "a" or "rc" increment the patch version. Eg, jshint went from 0.1.0 -> 0.1.1rc5
  • Ensure grunt 0.4.0rc5-compatible plugins are specified in package.json devDependencies like this (grunt-contrib-internal can be "*")
  • Update the CHANGELOG like this
  • Regenerate the README.md file via grunt.
  • Delete node_modules, run npm cache clean and re-run npm install to test.
  • Publish to npm using --tag=master (not latest)

@example output funky indents

Not sure if I'm doing something wrong here, but all of my code examples using the @example tag get pushed a bunch of indents after the first line: http://d.pr/i/jply

Any way to fix this? Here's my example code:

    /**
     * Creates a new user
     *
     * @method create
     * @for sdk.user
     * @param data {object}
     * @param data.email {string}
     * @param data.first_name {string}
     * @param data.last_name {string}
     * @param data.metadata {object}
     * @param data.tags {array}
     * @param callback
     * @param callback.err {string}
     * @param callback.response {object} [User object](/classes/object.user.html)
     * @example
     *
     *      sdk.user.create({
     *          first_name: 'Ron',
     *          last_name: 'Swanson',
     *          email: '[email protected]'
     *      }, function (err, response) {
     *          if (!err) {
     *              // User created
     *          }
     *      });
     */

I thought at first it might be the theme I'm using, but having the same issue with the default theme. Thanks!

Convert repo to LF?

Does anyone mind if I convert this repo's line endings to LF and add a .gitattributes * text=auto? It currently has CRLF line endings committed.

"No path(s) provided" error when compiling

I'm using the example configuration, but when I try to compile w grunt, I get:
Warning: No path(s) provided for YUIDoc to scan. Use --force to continue

Browsing through the source, it seems that the options object (which contains the paths) is expected to be a sibling of the compile object, but in your example it is a child of compile.

However, when I move the options object up one level, everything compiles without errors, but the docs don't get generated. I attempted to debug the tasks/yuidoc.js file, and noticed that execution stops on line 61:
json = (new Y.YUIDoc(options)).run();

After that, nothing is executed.

My yuidoc generation works fine when using the command line generator

Here are the versions I'm using:

grunt-cli v0.1.6
grunt v0.4.0rc7
yuidoc 0.3.35
[email protected]

Hope that helps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.