coherent-oss / system

4 stars 0 forks source link

Framework for building docs #4

Open jaraco opened 4 months ago

jaraco commented 4 months ago

I'd be happy to just continue to use ReadTheDocs for documentation hosting, but I've been frustrated with the amount of boilerplate they require just to configure a basic build.

I recently stumbled onto this doc which describes a way for publishing docs as GitHub pages using Sphinx. I think that approach may be lighter weight than RTD (though it does add another dependency on GitHub).

Other concerns to address in this issue:

jaraco commented 2 months ago

I've been working from an assumption that docs should be in a ./docs folder, but lately I've been thinking that contradicts some of the coherent philosophies. In particular, if it's a sphinx config, it will need lots of boilerplate to generate the conf.py file and the index with table of contents and links to modules.

For many of the projects I maintain, there are no project-specific changes to the docs folder other than listing the modules to be documented. Moreover, it seems that the module docstring of the __init__.py module might be a good place for an overview. If the docs builder could use autodiscovery to find the modules and build the API docs, and if the code base was amenable to rich narrative and guidance, it might be unnecessary to have a separate bit of narrative for many (most?) projects. And maybe even the README should be in the __init__ module's docstring.

Other projects, like setuptools have extensive documentation outside the code. For these projects, I'm wondering if the docs should be in the code base at all. Here are some reasons why maybe the code should be in the same repo and branch as the code:

Some of these advantages can potentially be met by using submodules, having the docs in a separate git repo or branch, but linking them into the repo so a version of the docs is linked to a version of the code.

Advantages to keeping the docs separate include:

I find these tradeoffs to be compelling in both directions. I'm finding the separate docs slightly more compelling because the (automatic) path from separate docs to inline docs is more obvious than the inverse.

My plan is this: