Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: categorize Language Definition functions #452

Merged
merged 4 commits into from
Oct 4, 2023

Conversation

agilgur5
Copy link
Contributor

@agilgur5 agilgur5 commented Oct 4, 2023

Motivation

Since 1.14 and 1.15 added a bunch of new operators / functions, I thought that categorizing them would help discoverability

  • in particular, some of the older functions were roughly categorized (all array functions in a row for instance), but newer ones seemed to have just been added to the end of the whole list

Modifications

  • new categories / section headings

    • String functions
    • Date functions
    • Number functions
    • Array functions
    • Map functions
    • Type Conversion functions
    • Miscellaneous functions (uncategorized multi-type functions)
  • also consistently use str, array, map, n, v for the variable name when referring to a specific type

    • array was used consistently for older functions, but not some newer ones
    • str added to match array
    • n was sometimes used for numbers or ints, but not always
    • v is for multi-type "values"

Validation

Read through in markdown previewer to double check

Notes for Reviewers

Feel free to reject this if you'd rather keep it uncategorized! Categories are subjective, after all, so preferences can differ.
Also feel free to recommend other categorizations or re-categorizations!

- multi-type / misc functions
- Type Conversion functions
- String functions
- Date functions
- Number functions
- Array functions
- Map functions

- also consistently use `str`, `array`, `n`, `v` for the variable name when referring to a specific type
  - `array` was used consistently for older functions, but not some newer ones
  - `str` added to match `array`
  - `n` was sometimes used for numbers or ints, but not always
  - `v` is for multi-type "values"

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
docs/Language-Definition.md Outdated Show resolved Hide resolved

Returns **true** if _all elements does not_ satisfy the [predicate](#predicate).
If the array is empty, returns **true**.
#### Type Conversion Functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep categories on the second level. ##.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Categories will be at the second level, should we remove the ## Built-in Functions heading that these are all currently under?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it to "Miscellaneous Functions" as if everything else is an h2, this only has the misc functions in it. And I moved misc to the bottom of the functions list since they are miscellaneous

@antonmedv
Copy link
Member

I like the idea.

- categories to h2, individual functions to h3 per review feedback

- rename "Built-in Functions" -> "Miscellaneous Functions" as this is now only around the uncategorized functions
  - move this to the bottom of the function list as well so that "miscellaneous" is not first

- combine "Date Manipulation" with "Date Functions"

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
@agilgur5 agilgur5 requested a review from antonmedv October 4, 2023 20:27
@agilgur5
Copy link
Contributor Author

agilgur5 commented Oct 4, 2023

made some adjustments per feedback

@antonmedv
Copy link
Member

Lets also rearrange order: string function, number funcs, array, date, type, misc.

@agilgur5
Copy link
Contributor Author

agilgur5 commented Oct 4, 2023

Lets also rearrange order: string function, number funcs, array, date, type, misc.

where would you like to place map functions?

also I put date functions right after string because technically they are all strings as well

… review

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
@agilgur5
Copy link
Contributor Author

agilgur5 commented Oct 4, 2023

I modified it to string > date > number > array > map > type > misc. Let me know if that's alright or you want more changes

@antonmedv antonmedv merged commit e3c2d0e into expr-lang:master Oct 4, 2023
@antonmedv
Copy link
Member

Done! https://expr.medv.io/docs/Language-Definition

Thanks for the awesome contribution.

@agilgur5 agilgur5 deleted the docs-categorize-lang-def branch October 4, 2023 21:38
@agilgur5
Copy link
Contributor Author

agilgur5 commented Oct 4, 2023

new heading index looks great 😄 :
Screenshot 2023-10-04 at 5 37 51 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants