rdrr-io / rdrr-issues

rdrr.io issues
34 stars 7 forks source link

Permalink to a package function #40

Closed larmarange closed 5 years ago

larmarange commented 5 years ago

Following this discussion: https://github.com/rdrr-io/rdrr-issues/issues/37 it would be great to have a permalink to a specific function, as we do not know on which man page this function is documented.

Just a quick example with svytable() and svychisq() from survey package. They are both documented on the same page: https://rdrr.io/cran/survey/man/svychisq.html

Following https://github.com/rdrr-io/rdrr-issues/issues/37, it's now possible to use https://rdrr.io/pkg/survey/man/svychisq.html

The problem is how to determine the man page from the function name. Here, how could we anticipate that svytable() is documented on man/svychisq.html?

In addition, it seems that rddr.io is not using the rdname used internally by a package. When you look at the internal documentation (from R), the name of that documentation page is svytable {survey}.

It would be great to have permalinks like https://rdrr.io/pkg/survey/doc/svytable or something similar ("function" or "index" instead of "doc").

larmarange commented 5 years ago

Just a small additional comment. On a documentation page, like https://rdrr.io/cran/survey/man/svychisq.html, I'm not sure it is relevant to add svychisq: to the title of the page, in particular when several functions/methods are documented on that specfic page.

Best regards

ihowson commented 5 years ago

I've added symbol lookup, so you can use a URL like:

https://rdrr.io/pkg/<package name>/sym/<symbol>

It'll look up the symbol and redirect to the correct man page. For example, if you give:

https://rdrr.io/pkg/survey/sym/svytable

this will redirect to https://rdrr.io/cran/survey/man/svychisq.html

Mapping symbol/function/class names back to documentation isn't exact, so please let me know if you get any unexpected results.

(I'll address your other queries shortly!)

larmarange commented 5 years ago

Thanks a lot !!!!

However, it seems that it does not work with internal libraries, i.e. https://rdrr.io/pkg/base/sym/table does not redirect to https://rdrr.io/r/base/table.html

Best regards

ihowson commented 5 years ago

This should work now. You can use:

https://rdrr.io/r/sym/<symbol>

or

https://rdrr.io/r/<package>/sym/<symbol>

Your example also works: https://rdrr.io/pkg/base/sym/table

Let me know if you have any more suggestions!

larmarange commented 5 years ago

thanks