Giter Club home page Giter Club logo

sails-doc's Introduction

sails-doc

Automatically generate beautiful documentation for your sails's Routes, Controllers & Models via JSDOC + docdash theme.

Usage

npm install sails-doc -g

Then on your sails root project directory, run sails-doc

This module generally using usejsdoc.org tags.

Important!

To classify your files as controllers, models, services, etc. Use custom doc tag @category. And also it is recommended to use @module instead of @name for each of your file name documentation.

For example in your services/amazing-service.js

/**
 * @module AmazingService 
 * @category services
 * @description This service will do amazing thing for your sails app
 */

With that doc tags will put this file into services categories in the navigation bar.

Available categories

  • models
  • controllers
  • services
  • policies

Preview

Preview

Headsup!

This package is in very early stage. Things might not working, please add issues if you found one.

Contact

Email: [email protected]

sails-doc's People

Contributors

azamuddin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

savemyexams

sails-doc's Issues

Sails v1.0.0-45

Hi, I'm using sails v1 and don't know if it is the problem but I can't make it work, in the root path of the project I execute sails-doc and the result is:

Making docs...
Err: Error: Command failed: /usr/lib/node_modules/sails-doc/node_modules/jsdoc/jsdoc.js /home/project/test/api/** /home/project/test/config/routes.js -c /usr/lib/node_modules/sails-doc/lib/jsdoc.json -t /usr/lib/node_modules/sails-doc/lib/docdash-category --destination /home/project/test/assets/docs
undefined:124
 var method = doc.actionName.split('.')[1] 
                             ^

TypeError: Cannot read property 'split' of undefined
    at eval (eval at _.template (/usr/lib/node_modules/sails-doc/node_modules/underscore/underscore.js:1454:20), <anonymous>:124:30)
    at Array.forEach (<anonymous>)
    at exports.Template.eval (eval at _.template (/usr/lib/node_modules/sails-doc/node_modules/underscore/underscore.js:1454:20), <anonymous>:10:10)
    at exports.Template.template (/usr/lib/node_modules/sails-doc/node_modules/underscore/underscore.js:1461:21)
    at exports.Template.partial (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/lib/jsdoc/template.js:55:29)
    at exports.Template.render (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/lib/jsdoc/template.js:69:24)
    at generate (/usr/lib/node_modules/sails-doc/lib/docdash-category/publish.js:228:21)
    at /usr/lib/node_modules/sails-doc/lib/docdash-category/publish.js:695:13
    at Array.forEach (<anonymous>)
    at Object.exports.publish (/usr/lib/node_modules/sails-doc/lib/docdash-category/publish.js:692:39)
    at Object.module.exports.cli.generateDocs (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/cli.js:448:35)
    at Object.module.exports.cli.processParseResults (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/cli.js:399:20)
    at module.exports.cli.main (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/cli.js:240:14)
    at Object.module.exports.cli.runCommand (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/cli.js:189:5)
    at /usr/lib/node_modules/sails-doc/node_modules/jsdoc/jsdoc.js:105:9
    at Object.<anonymous> (/usr/lib/node_modules/sails-doc/node_modules/jsdoc/jsdoc.js:106:3)

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.