Documenting protected methods

Is there a way to document protected methods with crystal docs? I am trying to document my Interro::QueryBuilder that generates and executes SQL queries. All of the methods named after SQL clauses like where and order_by are protected with the intention that knowledge of column names is isolated to the query objects and model objects (the models don’t query the DB themselves).

I want to document these protected methods so someone writing a query object knows what’s available to them, even if those methods are not usable from outside those objects. Is there a way to do that currently? Like an inverse of :nodoc:. I see some must_include? methods in the code for the doc generator right next to the nodoc? methods, are they related?

I would also like this feature. Some related discussion in Allow protected methods on API docs by Blacksmoke16 · Pull Request #7799 · crystal-lang/crystal · GitHub tho it appears I never did create that issue…

1 Like