Documentation
¶
Overview ¶
Package helpdocs renders `phpscript --help`.
The long help is a document rather than a flag dump: what the tool is, the commands, the flags every command shares, and per command its own flags and a table of worked examples. An agent reading it should not have to run nine commands to find out what the tenth accepts.
The examples are markdown, one file per command, embedded from this directory. A terminal gets them through the same box-drawing table the rest of the tool prints; anything else gets the markdown back byte for byte, so `phpscript --help > help.md` is a document and not a screenshot of one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Examples ¶
Examples returns the rendered example document for one command, or the empty string when it has none. It is what a command's cli.Usage hook returns, so `phpscript test --help` carries the same table the long help does.
func Render ¶
Render writes src to w, turning each markdown table into the table view the rest of the tool prints and passing everything else through unchanged.
In markdown the source is written back as it was written. A round trip through the table renderer would re-pad every cell and rewrite alignment markers, which is a diff in a document nobody edited.