Skip to content

Commit

Permalink
wip: don't document Syzygies
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Dec 17, 2023
1 parent 6076aa6 commit 5668404
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions M2/Macaulay2/packages/Macaulay2Doc/options.m2
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ opts := nonnull \\ options \ select(value \ values Core.Dictionary, f -> instanc
opts = nonnull \\ options \ methods() | opts; -- e.g. catch DegreeLimit from [(minimalBetti, Ideal), DegreeLimit]
opts = unique opts;

optionalNames := select(select(unique \\ flatten \\ keys \ opts, n -> instance(n, Symbol)), s ->
optionalNames := select(unique \\ flatten \\ keys \ opts, s -> instance(s, Symbol) and isGlobalSymbol toString s and
not isUndocumented(d := makeDocumentTag s) and (isMissingDoc d or headline d === "an optional argument"))

optionalValues := toList unique({ Prune, Binomial, Test, Center, Right, Left } -- for manually added Symbols
| last \ last \ hooks methods() -- e.g. catch Iterate from [(saturate, Ideal, Ideal), Strategy -> Iterate]
| flatten \\ values \ opts)
optionalValues := unique(flatten \\ values \ opts
| { Prune, Binomial, Test, Center, Right, Left } -- for manually added Symbols
| last \ last \ hooks methods()) -- e.g. catch Iterate from [(saturate, Ideal, Ideal), Strategy -> Iterate]

optionalValues = select(optionalValues, s -> instance(s, Symbol) and isGlobalSymbol toString s and
not isUndocumented(d := makeDocumentTag s) and (isMissingDoc d or headline d === "value of an optional argument"))

-- TODO: document these
both := set optionalNames * set optionalValues
optionalNames = optionalNames - both
optionalValues = optionalValues - both

-- Create generic documentation nodes for undocumented optional arguments and values
scan(optionalNames,
o -> document { Key => o, Headline => "an optional argument", -- if the headline is changed, change it above as well
Expand Down

0 comments on commit 5668404

Please sign in to comment.