2

I found docs for the @define scaladoc macro but they don't go into any depth.

What I'm trying to do is write documentation in a base class/trait in a generic way, with @defined variables so that the wording in the generated docs for the subclasses makes sense.

I've distilled this down to an example of something I would have expected to work, but doesn't:

/**
  * @define Word base-word
  */
class DocTestBase {

    /** Does a $Word
      *
      * @return
      */
    def foo = 1
}

/**
  * @define Word subclass word!
  */
class DocTestSubclass extends DocTestBase

With the above, I'd expect the generated documentation for DocTestSubclass#foo to say "Does a subclass word!", but as you can see below, it doesn't.

enter image description here

FWIW I also tried this on Scala 2.12 but the result is the same.

How do I get this to work as I expect? Is this a bug in scaladoc?

Dylan
  • 13,645
  • 3
  • 40
  • 67

0 Answers0