2013-04-23

Scaladoc Macros

I've seen these used a lot in the Scala language source code, but I haven't gotten around to trying it until now. I have two public methods that have the same constraint on, and initially was maintaining two copies of the documentation describing the constraint:

This generated Scaladoc that looked like so:

Using Scaladoc's @macro syntax, (described in here somewhere), I can remove the repeated code as follows:

The generated Scaladoc is identical.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.