Reorganize docs/syntax.md functions into categorized sections#30
Reorganize docs/syntax.md functions into categorized sections#30Sander-Toonen merged 2 commits intomasterfrom
Conversation
Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Reorganizes docs/syntax.md to make built-in functions easier to find by grouping them into clearer categories and standardizing section names.
Changes:
- Split “Pre-defined Functions” into
Numeric Functions,Array Functions, andUtility Functions. - Standardized section titles: “String Manipulation Functions” → “String Functions”, “Object Manipulation Functions” → “Object Functions”.
- Removed duplicate listings by relocating
naturalSortandcoalesceinto single, appropriate sections.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | filter(f, a) | Array filter: Return an array containing only the values from `a` where `f(x, index)` is `true`. | | ||
| | indexOf(x, a) | Return the first index of string or array `a` matching the value `x`, or `-1` if not found. | | ||
| | join(sep, a) | Concatenate the elements of `a`, separated by `sep`. | | ||
| | naturalSort(arr) | Sorts an array of strings using natural sort order (alphanumeric-aware). For example, `["file10", "file2", "file1"]` becomes `["file1", "file2", "file10"]`. | |
There was a problem hiding this comment.
naturalSort is listed under Array Functions but uses a different parameter name (arr) than the rest of this section (a). For consistency with the other signatures (count/map/fold/filter/indexOf/join), consider renaming the signature here to naturalSort(a) (or standardize the whole section on arr).
| | naturalSort(arr) | Sorts an array of strings using natural sort order (alphanumeric-aware). For example, `["file10", "file2", "file1"]` becomes `["file1", "file2", "file10"]`. | | |
| | naturalSort(a) | Sorts an array of strings using natural sort order (alphanumeric-aware). For example, `["file10", "file2", "file1"]` becomes `["file1", "file2", "file10"]`. | |
| | coalesce(a, b, ...) | Returns the first non-null and non-empty string value from the arguments. Numbers and booleans (including 0 and false) are considered valid values. | | ||
|
|
||
| ## String Manipulation Functions | ||
| ## String Functions |
There was a problem hiding this comment.
After moving naturalSort and coalesce out of the String Functions list, the “String Function Examples” section still includes examples for both (naturalSort at ~246 and coalesce at ~272). This makes the section misleading and may also make the subsequent note about “All string functions…” ambiguous. Consider moving those examples to the relevant Pre-defined subsections (Array/Utility) or renaming/restructuring the examples section so it only contains string functions.
Reorganizes functions in
docs/syntax.mdinto logical groupings for easier navigation.Changes
Pre-defined Functions now split into subsections:
random,fac,min,max,clamp,hypot,pyt,pow,atan2,roundTocount,map,fold,filter,indexOf,join,naturalSortif,coalesceSection naming standardized:
Removed duplicates:
naturalSortandcoalescewere listed in multiple sectionsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.