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

generator-ngdoc

v0.1.6

Published

Yeoman generator for AngularJS ngdoc documentation.

Downloads

12

Readme

generator-ngdoc npm Build Status

This is a Yeoman generator for documentation of AngularJS modules.

This generator scaffolds:

/**
 *
 * @ngdoc directive
 * @name awesomeElement
 * @module myModule
 * @restrict E
 * @descrition
 * This is an awesome directive!
 *
**/
angular.module('myModule')
  .directive('awesomeElement', function () {
    return {
      // Derective definision...
    };
  });

Why?

As the originator, I want to write documents of my AngualrJS module in ngdoc notation and to publish them as a web application.

I choose Dgeni and dgeni-packages as the ngdoc processor. These packages generate partial html contents of api, they don't generate an application that integrate these partial pages.

So, this generator scaffolds not only Dgeni configurations but also an application of documents.

Demo site

Here is a demo site generated with this generator.

Usage

To install yeoman and generator-dgeni from npm, run:

npm install -g yo generator-ngdoc

Create a project directory and change the current directory.

mkdir my-anguar-module
cd my-angular-module

Initiate the generator:

yo ngdoc

Change the current to docs directory:

cd docs

Run gulp task:

gulp docs:serve

A web application of documentation starts in your browser.

I already have a module project, can I use this generator?

No problem. This generator is designed for adding onto existing projects.

Almost all of the files are created under only docs directory (see also directory structure).

If you have a project(e.g. your-module) which was generated by other generator(e.g. generator-gulp-angular):

cd your-module
yo ngdoc
cd docs
gulp docs:serve

If necessary, you can modify the settings for the location of source files. By default, the gulp task searchs source files from src/**/*.js

  • docs/gulp/dgeni.js
    var dgeni = new Dgeni([require('../config/')
      .config(function (readFilesProcessor, writeFilesProcessor) {
        //
        
        // Specify collections of source files that should contain the documentation to extract
        readFilesProcessor.sourceFiles = [{include: 'src/**/*.js', basePath: 'src'}, {include: 'docs/content/**/*.ngdoc',basePath: 'docs/content'}];

        //
      })
      :

Gulp Tasks

You should run any gulp tasks generated by generator-ngdoc in 'docs' directory.

cd docs

docs:serve

Generate ngdoc and run document application on Node.js server.

gulp docs:serve

This task watches your JavaScript source files. If you modify these files, re-generate ngdocs and reload browser.

docs:build

Build document application package, and place in directory 'docs/dist'.

gulp docs:build

You can use this task for publishing the document application.

docs:serve:dist

Run document application package created by docs:build task on Node.js web server.

gulp docs:serve:dist

Directory structure

├──  src/                         Put your source files in this dir
│   └──  components/
│        ├──  sample/             Sample components's source files generated by generator-ngdoc
│        └──  index.js            Module definition is written in this
│
├──  docs/                        Sub dir for documentation
│   ├──  .tmp/                    
│   ├──  app/                     Documentation app root directory
│   │   ├──  src/
│   │   ├──  styles/
│   │   └──  index.html
│   ├──  bower_components/
│   ├──  config/                  Dgeni configurations
│   │   ├──  processors/
│   │   ├──  templates/
│   │   └──  index.js
│   ├──  content/                 Additional documentation sources
│   │   ├──  guide/
│   │   ├──  api.ngdoc
│   │   ├──  guide.ngdoc
│   │   └──  index.ngdoc
│   ├──  dist/                    The destination directory of the gulp task 'docs:build'
│   ├──  gulp/                    Definition of gulp tasks
│   ├──  lib/                     Misc node modules
│   ├──  node_modules/
│   ├──  bower.json               Bower configuration for documentation app
│   ├──  gulpfile.js
│   └──  package.json             Node configuration to build documentation app
│
├──  .gitignore
├──  bower_components/
└──  bower.json                   Bower configuration for your modules

License

MIT