jazzy icon indicating copy to clipboard operation
jazzy copied to clipboard

Parameter to exclude overridden functions & properties.

Open MrAlek opened this issue 8 years ago • 6 comments

Currently, you can use the :nodoc: token to exclude specific declarations but in cases where you have to do many overrides (such as a framework of UIViews), completely ignoring all overrides in the generated documentation would make life much easier for a framework maintainer.

Generally speaking, this makes sense for a lot of object oriented frameworks where overrides is usually common. Apple's own documentation for instance, doesn't state overridden functions because they are part of the parent interface. An --exclude-overrides parameter would be great for these cases.

MrAlek avatar Oct 17 '16 08:10 MrAlek

I can imagine being frustrated with having to write that a bunch of times. By the way, thanks for mentioning /// :nodoc: , it works great!

garricn avatar Oct 20 '16 03:10 garricn

Thanks for submitting this. I'm going to consider this a feature request. We don't currently have the bandwidth to implement this ourselves but we'd happily review a PR if you can submit one with the change. Cheers! :)

pigeon-archive avatar Nov 23 '16 23:11 pigeon-archive

A word of warning about /// :nodoc:: It is Jazzy‐only. Quick Help does not understand it.

I used to use /// :nodoc: for overrides, but then I realized Quick Help displays “:nodoc:” to anyone who ⌥‐clicks the symbol or looks at the Quick Help tab. Duplicating the documentation is admittedly annoying, but that’s still the only thing that satisfies Quick Help.

(/// :nodoc: is, however, perfect for symbols that take the form _pleaseDoNotUseThis() and are only begrudgingly declared public.)

That being said, if someone decides to implement this anyway, it would be wise to treat overrides of all the following forms the same for consistency’s sake:

  • class method → subclass override
  • protocol method → default implementation → more specific, optimized default implementation
  • generic function → more specific, optimized generic function

SDGGiesbrecht avatar Dec 16 '16 05:12 SDGGiesbrecht

Duplicating the documentation is admittedly annoying, but that’s still the only thing that satisfies Quick Help.

what do you mean by this? how can I hide :nodoc: from quick help?

paulofaria avatar May 11 '17 12:05 paulofaria

@paulofaria

how can I hide :nodoc: from quick help?

You can’t.

If you want to satisfy Quick Help, you have to manually copy and paste the entire documentation comment from the superclass method to the subclass method.

Since my previous post I have built some automation for this into another tool called Workspace. The documentation for this specific functionality is here.

For now, you still have to opt into it manually for each method, but once you do, the documentation comments are locked in sync with each other. It is on my to‐do list to make Workspace capable of finding the superclass method without manual guidance, but I might not get to it for a while.

SDGGiesbrecht avatar May 11 '17 20:05 SDGGiesbrecht

oh that's too bad! :( thanks for the info

paulofaria avatar May 12 '17 13:05 paulofaria