Odd question.. I'm a tech writer for a software product and I'm brainstorming ideas for documenting function syntax without using brackets for optional arguments. I tried to search for examples but everything I found seems to use UNIX-style.
Has anyone seen documentation that had an alternate system for indicating optional args?
For instance, right now if we have a function that operates like this:
y,[z] = x(A,[B|C],[D])
(there is a flag in A that lets the function know if B|C and/or D is going to be present, and whether to return z)
we list the combinations like:
y = x(A)
y = x(A,B)
y = x(A,C)
y,z = x(A)
y,z = x(A,...)
y = x(A,...,D)
y,z = x(A,...,D)
and actually, not everyone uses the "...", so sometimes they're all repeated. if B and C are independent, it's even more combinations. which is silly when i can write it in one line if we have something to symbolize "optional" and which ones go together! but in our world the brackets mean something else and we can't use them here. It's published in HTML so we're thinking maybe shading/color would help, like grey out or highlight. maybe multiple colors to indicate dependencies? I actually think angle brackets might be ok.. but getting push back on that because they're also already used (in a separate context, i think the difference is clear but not everyone agrees).
So, what have you seen?
Has anyone seen documentation that had an alternate system for indicating optional args?
For instance, right now if we have a function that operates like this:
y,[z] = x(A,[B|C],[D])
(there is a flag in A that lets the function know if B|C and/or D is going to be present, and whether to return z)
we list the combinations like:
y = x(A)
y = x(A,B)
y = x(A,C)
y,z = x(A)
y,z = x(A,...)
y = x(A,...,D)
y,z = x(A,...,D)
and actually, not everyone uses the "...", so sometimes they're all repeated. if B and C are independent, it's even more combinations. which is silly when i can write it in one line if we have something to symbolize "optional" and which ones go together! but in our world the brackets mean something else and we can't use them here. It's published in HTML so we're thinking maybe shading/color would help, like grey out or highlight. maybe multiple colors to indicate dependencies? I actually think angle brackets might be ok.. but getting push back on that because they're also already used (in a separate context, i think the difference is clear but not everyone agrees).
So, what have you seen?