Open francislavoie opened 2 years ago
@francislavoie Good feedback, we definitely need to overhaul the builtin function docs.
This issue is two years old, and yet I still find the documentation less useful than just looking through your test files to see what functions are available and how to use them. Which I don't find convenient, so that's saying something.
@ardunster you're right. We're working on overhauling docs now actually.
Every time I find myself referencing the spec, language definition doc, I have a hard time figuring out how each of the standard definitions can actually be used, because they just talk about an operator/function, but without context.
https://github.com/google/cel-spec/blob/master/doc/langdef.md#list-of-standard-definitions
I'd like to see examples for as many of the entries in that table as possible, in the description column. For example, it took me a while to figure out that a
string -> int
cast is done by doingint("string")
, when I might've guessed it might be(int) "string"
like in some C-like languages.For the
symbols
column I think code styling should be used (backticks in markdown) to use a monospaced font, because some of the entries like _[_] are hard to read on their own, it would look better as_[_]
.A note that
_
means "where the operands go" would help clarify as well, I didn't find that immediately obvious.