senchalabs / jsduck

Simple JavaScript Duckumentation generator.
http://docs.sencha.com/
GNU General Public License v3.0
1.5k stars 238 forks source link

Error: You should specify some input files, otherwise there's nothing I can do #646

Closed AnnieCyl closed 8 years ago

AnnieCyl commented 8 years ago

Hi there. I want to define a custom tag named "test". Here is my test.rb file:

require "jsduck/tag/member_tag"

class Test < JsDuck::Tag::MemberTag
  def initialize
    @tagname = :test
    @pattern = "test"
    @member_type = {
      :title => "Test",
      :position => MEMBER_POS_CFG - 0.1,
      :icon => File.dirname(__FILE__) + "/test.png",
    }
  end

  def parse_doc(scanner, position)
    return {
      :tagname => :test,
      :name => scanner.ident,
    }
  end

  def process_doc(context, test_tags, position)
    context[:name] = test_tags[0][:name]
  end

  def to_html(test, cls)
    member_link(test) + member_params(test[:params])
  end
end

But I got this error: qq 20160415095647

Where did I do wrong?

nene commented 8 years ago

You also need to pass some JavaScript files in for JSDuck to parse.

AnnieCyl commented 8 years ago

@nene Ok, I got what you mean. I thought that we should add custom tags to jsduck first, then when we need to generate docs, jsduck would apply these custom tags automatically.

Thanks very much!

nene commented 8 years ago

As documented:

$ jsduck --help=tags

   --tags=PATH1,PATH2

            Paths to custom tag implementations.

            Paths can point to specific Ruby files or to a directory,
            in which case all ruby files in that directory are loaded.

            See also: https://github.com/senchalabs/jsduck/wiki/Custom-tags

You can use the --tags option multiple times to reference multiple files, or you could point it to a directory containing all your custom tag files.

AnnieCyl commented 8 years ago

@nene Yes, I already figured out. Thanks!