Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eecavanna opened this issue Jun 4, 2024 · 2 comments
Open

Comments

@eecavanna
Copy link

eecavanna commented Jun 4, 2024

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:

# note: "help" MUST be the first target in the file,
# when the user types "make" they should get help info
help: status
@echo ""
@echo "make setup -- initial setup (run this first)"
@echo "make site -- makes site locally"
@echo "make install -- install dependencies"
@echo "make test -- runs tests"
@echo "make lint -- perform linting"
@echo "make testdoc -- builds docs and runs local test server"
@echo "make deploy -- deploys site"
@echo "make update -- updates linkml version"
@echo "make help -- show this help"
@echo ""

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
Copy link
Member

cmungall commented Jun 6, 2024

love it!

@matentzn
Copy link
Contributor

matentzn commented Jun 6, 2024

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants