Doc gen handles arrays as required property values#6448
Conversation
|
@davidtheclark, thanks for your PR! By analyzing this pull request, we identified @1ec5, @boundsj and @incanus to be potential reviewers. |
de75c68 to
3a19da6
Compare
|
Modified the text based on chat feedback from @1ec5. Added semicolons between required properties and removed "either" if there are more than 2 possibilities. Now the doc for ... with 2 possible values:
... with 3 possible values (the real thing):
|
|
Had another idea for reducing verbosity, by cutting the repetition of "an NSValue object containing". After latest commit, here's the example output ... ... with 2 possible values:
... with 3 possible values:
|
819b340 to
45b97e8
Compare
1ec5
left a comment
There was a problem hiding this comment.
This is tricky stuff, but it looks pretty good! You'll need to run make style-code-darwin again to regenerate the headers.
There was a problem hiding this comment.
This semicolon might be excessive if none of the requirements includes a comma.
There was a problem hiding this comment.
I can remove that.
There was a problem hiding this comment.
Oh, a semicolon is definitely helpful if a requirement does include a comma, though. It isn’t wrong either way, since you’ve simplified the verbiage a bit, just a stylistic choice.
45b97e8 to
8ddbae2
Compare
|
@1ec5 I reverted the semicolon to a comma and rebased & squashed into a single commit. There is and should be no changes to the generated documentation yet — not until the a new spec version is released with the change discussed in mapbox/mapbox-gl-style-spec#504. |
|
Oh, one more thing: if you don’t mind rebasing again, can you prepend |
|
(Or you could add that to the commit message when you squash merge.) |
8ddbae2 to
f60e2eb
Compare
We update the gl-native project frequently between official specification releases, so the corresponding changes are being handled in #6508. |
Ref mapbox/mapbox-gl-style-spec#504.
Modifies the style documentation generation code to allow for an array as the required property value. An array means that the property must have one of multiple possible values.
I tried to match the sentence-style syntax and punctuation I saw elsewhere. Here's what we end up with in a few scenarios:
(Looks like I also stripped some superfluous end-of-line whitespace.)
cc @1ec5