Commit 860ba975 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Showing @docauthor info in generated docs.

parent 4445d615
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ module JsDuck
        :alternateClassName => code[:alternateClassName] || [],
        :xtype => detect_xtype(doc_map),
        :author => detect_author(doc_map),
        :docauthor => detect_docauthor(doc_map),
        :singleton => !!doc_map[:singleton],
        :private => !!doc_map[:private],
      }
@@ -277,6 +278,10 @@ module JsDuck
      doc_map[:author] ? doc_map[:author].first[:name] : nil
    end

    def detect_docauthor(doc_map)
      doc_map[:docauthor] ? doc_map[:docauthor].first[:name] : nil
    end

    def detect_params(docs, code)
      implicit = detect_implicit_params(code)
      explicit = detect_explicit_params(docs)
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ module JsDuck
        classes_row("Mixed into:", @relations.mixed_into(@cls)),
        boolean_row("xtype:", @cls[:xtype]),
        boolean_row("Author:", @cls[:author]),
        boolean_row("Author of docs:", @cls[:docauthor]),
       "</table>",
      ].join("\n")
    end
+17 −0
Original line number Diff line number Diff line
@@ -230,6 +230,23 @@ describe JsDuck::Aggregator do
    end
  end

  describe "class with @docauthor" do
    before do
      @doc = parse(<<-EOS)[0]
        /**
         * @class MyClass
         * @docauthor John Doe
         * Comment here.
         */
      EOS
    end

    it_should_behave_like "class"
    it "detects documentation author name" do
      @doc[:docauthor].should == "John Doe"
    end
  end

  describe "class with @markdown" do
    before do
      @doc = parse(<<-EOS)[0]