Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.83k stars 2.3k forks source link

[Docs] Restructuring Documentation and Re-classifying public APIs #2802

Open Tobotimus opened 5 years ago

Tobotimus commented 5 years ago

Some stuff on our public developer documentation, which is aimed at cog creators, should really only be documented for internal use and subsequent to changes at any time. This is following on from a bit of a rant of mine over in #2774.

What should be moved?

As I mentioned there, with respect to APIs which are already documented, candidates for moving to these internal docs would be:

Obviously there are lots of things we could add to these docs, which don't already exist in the public docs but would be useful in these internal docs. But I'm not setting any milestones for adding that stuff right now, because it can be quite a lot of work.

Where should these internal docs be located?

On the same RTD site is fine, just under a new section. The sections are currently a bit muddled up - I think we need to redefine them as four clear sections:

mikeshardmind commented 5 years ago

I don't mind if we have a section of the docs which is strictly for internal Red use, but I think there's a larger issue doing this somewhat masks.

We have a lot of things which are exposed publicly. If we don't want developers using them and relying on them, we should be following the conventions for this and marking them private.

We can't do this in a micro release based on our versioning.

Right now, I'm a little more lax on breaking this for things which aren't documented, but for anything which is documented and exposed publicly which we don't want to be locked into a design on, we should properly mark them private in the next minor release.

Tobotimus commented 5 years ago

I agree this shouldn't be done in micro releases, only minor.

The problem is that Python doesn't have a package-protected scope, only module/class/subclass protected. So I'd prefer leaving them as "public" to other internal Red modules, but not as part of our APIs for 3rd party cogs.

Tobotimus commented 5 years ago

Like I know that encapsulation in Python is only really by convention with leading underscores, but I would argue that a single leading underscore on a module-level function implies module-level protection...

mikeshardmind commented 5 years ago

I can put a draft PR up later today for modification and use with 3.2 which may make it a bit more clear the level of changes I'd be arguing for here.

I'm fine with a separate section of the docs for any fully internal use classes/modules so long as those classes/modules are properly documented as not for consumer use in the main section, but anything where we would have mixed parts, the convention method and not splitting up the docs makes more sense to me.

mikeshardmind commented 5 years ago

I think the parts of this we were most concerned about for 3.2 are handled at this point, but I don't think this is fully resolved yet.

palmtree5 commented 1 year ago

I'm going to try to take a look at this soon.