This is great! I like the symmetry with the suggested opposite behavior attribute too. To avoid a scenario where someone accidentally adds @_nodoc and @_doc, what if we did something like @_doc(<#visibility#>) e.g. @_doc(hidden) and @_doc(visible)?
Some future (low priority) suggestions for handling more esoteric workflows:
- An equivalent C/Objective-C
__attribute - A markup directive that can be added to a documentation extension file for workflows where the ability to modify visibility post-build/without modifying source is important.
- Configurable/overridable via APINotes.