Documentation Guidelines for Submitted Modules #134
Description
A Proposal and Case for Documentation Guidelines
[What follows is a feature request that would take much work and should not be viewed as a request from me to you to do something. I'm more looking to see if these thoughts can be made to conform with the spirit of the project and in an automatically maintainable way.]
Use Cases
Use Case: As a developer, sometimes I'm not sure about what I need from a module. I'm just kind of... hunting. I might need some little table filter-thingy and if I try enough search terms, sometimes I'm lead to a paragraph that shows me something interesting and I'm on to even better ideas. It'd be awesome if I had the ability to find phrases that are tucked in documentation within modules.
Use Case: As a developer, documentation saves me time and gives me confidence. When I'm using a system and everything has stuff in the same spot and it looks coherent, it's easy for me to find. It feels like it works better, is better tested and I'm generally happy.
Proposed Method
What I'm imagining is a set of guidelines for the docs directory. The guidelines would stipulate something like:
- There must be a markdown file called
dist.md
or,readme.md
if the readme file follows the prescribed format. This file has the following headings and text:- Project Name: (ex. Penlight)
- Version: (X.Y.Z.BUILD) (2.1.0.123),
- Name used for
require
: (ex. pl) - Summary: 140 char or less description
- Description: Optional long description.
- If this module includes independent submodules which should have their own summary, then each sub module must be named Sumodule.Dist.md: (ex. tablex.dist.md or tablex.readme.md).
Desired Outcome
The standard batteries and LuaDist repository will have a command that will provide the ability to search for keywords within these files and report the summary information form the command line. If luadist was updated (fetch), then a marker could be placed for out-of-date modules.
Uninstalled Modules
If git subtree
were available, then merging these readme/dist files into an available
directory in the core download could be automated. Failing that, there might be some other kind of auto-readme-gathering method that I'm not thinking of... perhaps a script on the CI server?
Required or Recommended?
Probably recommended and then required. We (I) could go through each module and make the missing files. If the repository ever reached a clean state, we could start with a notification to the submitter that it failed the CI server's dist/readme.md
test, but that it was still being included accepted. A maintainer could fill in the info or ask the developer to do it.
[I think that this method could also apply to Lua, such that the core Lua Library ("table, string") could be documented in this way.]
And then?
This same type of process might be applied to API and narrative documentation. Any documentation is better than none, but conformed documentation can be compiled and turned into a coherent catalog. The goal is to develop guidelines and tools such that a developer might say:
If I conform to this, then LuaDist will make it easy for the user to view my documentation from the command line, in a PDF and in a web page. I'm going to do that, because it's easier than not doing it.