Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documentation for top level namespace #776

Closed
ntijoh-daniel-berg opened this issue May 22, 2014 · 4 comments
Closed

No documentation for top level namespace #776

ntijoh-daniel-berg opened this issue May 22, 2014 · 4 comments

Comments

@ntijoh-daniel-berg
Copy link

Trying to document a simple script w/o classes (like the quadruple function below). The method shows up in the method list, but there's no documentation.

Wrapping the function in a class (like the double function below) works (but is not an option)

According to http://stackoverflow.com/questions/19465192/how-to-document-simple-scripts-with-yard it should work w/o classes

rake (10.3.2)
rdoc (4.1.1)
yard (0.8.7.4)

# quadruples the value of a Numeric
#
# @param number [Numeric] the Intger to quadruple
# @return [Numeric] the quadrupled value of the number
def quadruple(number)
    number * 4
end


class NonsenseWrapper

    # doubles the value of a Numeric
    #
    # @param number [Numeric] the Intger to double
    # @return [Numeric] the doubled value of the number
    def double(number)
        number * 2
    end

end
@lsegal
Copy link
Owner

lsegal commented May 22, 2014

It seems to generate in doc/top-level-namespace.html for me. Do you not see it there?

One thing I noticed is that we no longer seem to list Top Level Namespace in the index, which could be why you're not seeing it?

@ntijoh-daniel-berg
Copy link
Author

Oh, you're right. I see now that the file is generated.

Apparently, it's the link to the method in the web interface that doesn't work.
See this video: http://goo.gl/utCwOs (no amount of clicking on the method name will show the documentation for the method in the top level namespace)

@lsegal
Copy link
Owner

lsegal commented May 23, 2014

Why does clicking the method replace your entire page with the method list? That's likely what is going wrong, as I think the links there are powered by JS to replace the parent frame or something like that. The method list should only ever appear inside of an iframe, never the full page.

@ntijoh-daniel-berg
Copy link
Author

Good question. It only does that when clicking the top level namespace method.
It works as intended when clicking the wrapped method (i.e the page refreshes in the background and shows the documentation, not the method list).

I wonder if I can figure out what's going wrong in the javascript.

btw, clicking the top level namespace method in the method list generates this warning in chrome:

event.returnValue is deprecated. Please use the standard event.preventDefault() instead. 

Changing to the latest jquery removed the warning, but not the incorrect behaviour.

lsegal added a commit that referenced this issue Oct 26, 2014
Fixes regression where "Top Level Namespace" was missing from
namespace listing page.

References #776
@lsegal lsegal closed this as completed in 95ef7c7 Oct 26, 2014
lsegal added a commit that referenced this issue Oct 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants