Search code examples
javadocgithub-pages

How to have different URL for each class in generated API documentation?


I've hosted my project's generated API documentation on Github pages, which is super nice and easy. However, I'd also like to link to the documentation for specific classes from my site. I noticed that the default implementation is to have the same URL for the entire documentation, which makes it impossible to link to anything specific.

As an example, look at Google Guava's API docs. No matter how much you click around, the URL stays the same. This makes it impossible to link to, say the Lists class specifically. Is this possible to do, either through an option in javadocs, or in Github pages?


Solution

  • Click on the No Frames button just below the top bar. In this mode your url will change based on the page you visit. You can then copy that link and include it in your own docs. (https://google.github.io/guava/releases/snapshot-jre/api/docs/com/google/common/collect/Lists.html).

    Once on a page you can also go back into frames mode and everthing after docs/ in the url will turn into the query string. For linking I think it is preferred to use the link without frames.