npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-codo

v0.3.0

Published

Grunt task for generating Codo documentation

Downloads

92

Readme

grunt-codo

Build Status NPM version Dependency Status Downloads counter

Grunt task for generating Codo documentation

Codo is a documentation generator for CoffeeScript, see https://github.com/netzpirat/codo for more information.


Getting Started

This plugin requires Grunt ~1.0

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-codo --save-dev

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

grunt.loadNpmTasks('grunt-codo');

The "codo" task

Overview

In your project's Gruntfile, add a section named codo to the data object passed into grunt.initConfig().

grunt.initConfig({
  codo: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Target

Codo expect to lookup for coffee files into given folder, and a destination path to generate the documentation.

So, in your target, don't forget to add src and dest properties. The dest property is optional, and is defaulting to "./doc".

Options

options.stats

Type: Boolean
Default value: true

Show stats about the documentation generation.

options.extension

Type: String
Default value: "coffee"

Coffee files extension.

options.output

Type: String (path)
Default value: target.dest, or "./doc"

The documentation destination directory. If this option is given, it will overwrite the target's dest parameter.

options.theme

Type: String
Default value: theme

The theme to be used.

options.name

Type: String
Default value: "Codo"

The project name.

options.title

Type: String
Default value: "Documentation"

Documentation HTML Title.

options.readme

Type: String (path)
Default value: "README.md"

The README file used in documentation.

options.quiet

Type: Boolean
Default value: false

Supress warnings

options.verbose

Type: Boolean
Default value: false

Show parsing errors.

options.undocumented

Type: Boolean
Default value: false

List undocumented objects.

options.closure

Type: Boolean
Default value: false

Try to parse closure-like block comments.

options.private

Type: Boolean
Default value: false

Show privates.

options.analytics

Type: String
Default value: false

The Google Analytics ID.

options.extras

Type: Array of String (path)
Default value: []

Extra files to add to the documentation. Markdown files will be parsed.

Usage Examples

Default Options

In this example, the default options are used to generate the documentation for the coffee files from the src directory into the default ./doc folder.

grunt.initConfig({
  codo: {
    src: [
      'src'
    ]
  },
});

Custom Options

In this example, custom options are used to generate the documentation from api controllers and models into the website/doc/api folder. We also set names and title, include a license file, and ask the task to show us the undocumented objects, but not the stats of the generation.

grunt.initConfig({
  codo: {
    options:
      name: "AwesomeProject"
      title: "AwesomeProject API Documentation"
      extra: [ "LICENSE-MIT" ]
      undocumented: yes
      stats: no
    src: [
      "src/controllers/api"
      "src/models"
    ]
    dest: "website/doc/api"
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2014/01/16 : v0.1.0

Contributors

License

Copyright (c) 2014 Johannes Stein
Licensed under the MIT license.