user404345
user404345

Reputation:

Scaladoc link to another method

I have two methods on my companion object (model.Product):

def apply(p:ProductSyntax)(rs: WrappedResultSet): Product
def apply(p: ResultName[Product])(rs: WrappedResultSet): Product

The first method delegates to the second and I would like to indicate this in the docs. I tried using:

/**
 * delegates to [[apply]]
 * /

But scaladoc complains that this is ambiguous but tells me that

(p: scalikejdbc.ResultName[model.Product])(rs: scalikejdbc.WrappedResultSet): model.Product in object Product

is an option

However I can't work out how to tell scaladoc to use this method. I tried

/**
 * Delegates to [[apply(scalikejdbc.ResultName[model.Product])(scalikejdbc.WrappedResultSet):model.Product]]
 * /

But it tells me that no member is found:

Could not find any member to link for "apply(scalikejdbc.ResultName[model.Product])(scalikejdbc.WrappedResultSet):model.Product".

How would I add a link to the def apply(p: ResultName[Product])(rs: WrappedResultSet): Product method?

Upvotes: 3

Views: 1591

Answers (1)

user404345
user404345

Reputation:

So this is what I discovered:

  1. Everything must be fully qualified, even the class/object itself

  2. Package dots should be escaped with \

  3. You cannot use any spaces in the signature

  4. Paramaters should include the name not just the type i.e. foo(a:String) not foo(String)

  5. The signature should end with a *

Finally this worked:

[[apply(p:scalikejdbc\.ResultName[model\.Product])(rs:scalikejdbc\.WrappedResultSet):model\.Product*]]

HOWEVER ... the backslash escaping and * also appears in the generated html!

Generated html for the scaladoc

Upvotes: 4

Related Questions