angularjs создает документацию через grunt и ngdocs

Здравствуйте, я пытаюсь создать документацию для моего приложения ionicframework/angularjs через grunt и ngdoc.

Я установил все как предпочитал в http://gruntjs.com/getting-started

Ну если я сейчас бегу крякну

Я получил:

Running "jshint:gruntfile" (jshint) task
>> 1 file lint free.

Running "jshint:lib_test" (jshint) task
>> 0 files linted. Please check your ignored files.

Running "qunit:files" (qunit) task
Warning: 0/0 assertions ran (0ms) Use --force to continue.

Aborted due to warnings.

И с этим я не могу показать документы.

Мой gruntfile выглядит так:

/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Task configuration.
    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        browser: true,
        globals: {
          jQuery: true
        }
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      lib_test: {
        src: ['lib/**/*.js', 'test/**/*.js']
      }
    },
    qunit: {
      files: ['test/**/*.html']
    },

    ngdocs: {
      all: ['src/resources/js/*.js']
    },

    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      lib_test: {
        files: '<%= jshint.lib_test.src %>',
        tasks: ['jshint:lib_test', 'qunit']
      }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-ngdocs');

  // Default task.
  grunt.registerTask('default', ['jshint', 'qunit']);

  grunt.registerTask('build','Build the application',['ngdocs']);

};

Я новичок в создании документов для angularjs, так что лучше для этой цели?

1 ответ

Решение

Когда вы просто используете 'grunt' из командной строки, он попытается выполнить все задачи в Gruntfile.js.

Вы хотите просто запустить ngdocs, поэтому вы должны использовать grunt ngdocs в качестве команды командной строки.

Вы также добавили задачу под названием build, которая просто запускает ngdocs, поэтому вы также можете использовать: grunt build

Другие вопросы по тегам