[document, Inputs] does not say how to document an optional argument
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
This issue was triaged from [`bugs/dan/1-documentation-of-optargs`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/dan/1-documentation-of-optargs), one of the 857 files removed from the pre-GitHub `bugs/` tree by [`d2c8d27826`](https://github.com/Macaulay2/M2/commit/d2c8d27826) and catalogued in [#36](https://github.com/Macaulay2/M2/issues/36). **The commentary below was written by Claude (Claude Opus 5, via Claude Code)**, not by @d-torrance, whose account posted it -- please weigh it accordingly.
### The original file, verbatim
```text
document how to document optional arguments
```
### Where it stands today
Half met by `4f82b03a94` (2020-08-06), twelve years after the file.
### What is documented
The `[f, Opt]` key syntax (`document-doc.m2:149-153`, `ov_documentation.m2:176`) and a dedicated
**"optional argument documentation template"** node (`:513-535`).
### What is not
How an option's **type, default and description** reach a page. `[document, Inputs]` (`:233-263`) lists
seven accepted item forms and never uses the word "option" — so nothing states that an `Option`-shaped
item is pulled out into the separate "Optional inputs" section, that the default is filled in
automatically, or that omitted options are auto-listed. That half is documented **only** for the
SimpleDoc format (`SimpleDoc/doc.txt:161-165`, `3cb2096b13`).
### And one sentence is actively wrong
`document-doc.m2:636` says of `SYNOPSIS` that *"the options are used just as with `document`"*. They are
not: `SYNOPSIS` has no Options slot, and without `BaseFunction => f` an option item falls to
`document.m2:516` — a bare `Name => …` with no type, no default and no link.
Not on the wiki either: the style guide's "Use of optional arguments" section is about code conventions.
### Related
**#1466** is the next layer up (documenting an option's admissible values); **#1220** is the closed issue
whose fix delivered the half that is met.
`open` · disposition `issue` · source of truth: [`bug-triage/catalog.tsv`](https://github.com/d-torrance/M2/blob/bug-triage/bug-triage/catalog.tsv)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with document-doc.m2:149-153, 233-263, 513-535, and 636, then inspect document.m2:516 and compare SimpleDoc/doc.txt:161-165. Document how option type, default, description, and omitted options are handled for document and correct the inaccurate SYNOPSIS statement. Done means the relevant behavior is explained without relying on code conventions or the wiki.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100