linkml / linkml-project-cookiecutter

A cookiecutter for linkml projects. An equivalent of `linkml-ws new project-name`.
Creative Commons Zero v1.0 Universal
14 stars 16 forks source link

Add DRY user-facing documentation to `Makefile` and `project.Makefile` #110

Open eecavanna opened 1 month ago

eecavanna commented 1 month ago

Today, the only user-facing documentation I see among the Makefiles — Makefile and project.Makefile — is the set of lines echo-ed by the help target in Makefile:

https://github.com/linkml/linkml-project-cookiecutter/blob/d9b85bbbdcc49163416a3e3e18e23fe2ecce501b/%7B%7Bcookiecutter.project_name%7D%7D/Makefile#L60-L73

Note: When I say "user" in this context, I'm referring to the person that would be running $ make commands.

Those lines are not necessarily written near where the associated target is defined.

That can result in the lines becoming stale (i.e. falling out of sync with the target). It can also result in that set of lines not accounting for newly-implemented targets (because those lines would be "out of sight, out of mind" when implementing a target).

I propose that the Makefiles be updated to use a documentation technique like the one shown here: https://stackoverflow.com/a/47107132

Using that technique, a target's user-facing documentation would "live with" the target's definition. I think that will decrease the likelihood that the documentation falls out of sync with the target, and will increase the likelihood that new targets have user-facing documentation.

That technique can be extended to incorporate ANSI color codes, so that the output is in color. For example (this is a "quick and dirty" sed script):

image

cmungall commented 4 weeks ago

love it!

matentzn commented 4 weeks ago

Nice!