Scaladoc not generating package docs

I’m unable to get scaladoc to document a package. It will document the classes within the package, but not the package itself. I’m sure this is a ridiculous newby mistake, but I’ve not been able to find a solution. I’ve looked here in this forum, on stackoverflow, scala-lang.org documentation pages, the man page, scaladoc -help, and the scala library sources to see how packages are documented within their source files (e.g., package.scala for the scala package). What am I missing here?

Package source (in ~/projects/weather/trunk/scala/src/weather.)

package janprojects

/**
 *  ncdc weather stuff.
 */
package weather
{
  /**
   *  this better get documented
   */
  class foo(x: Int)
}

I’ve also tried adding a root package doc file (~/projects/weather/trunk/scala/src/rootdoc.txt).

Scaladoc will acknowledge the existence of package weather, but won’t include the provided documentation. It will, however, include the provided documentation for class foo.

Command lines I’ve tried: (executed from ~/projects/weather/trunk/scala/src):

scaladoc -d ~/projects/docs/weather -doc-root-content rootdoc.txt weather/package.scala (to include the rootdoc)
scaladoc -d ~/projects/docs/weather weather/package.scala (no rootdoc)

Neither command will generate documentation for the weather package.

One way that works is to create a package object - its documentation becomes the package scaladoc.

/**
 * This is work towards ...
 */
package object provingground {}

best,
Siddhartha

1 Like

This worked. Thank you!