Skip to content

docs: add full v0.10 builtin and system module documents #452

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

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/reference/model/builtin.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ print(isunique(['abc', "a${'bc'}"])) # False

It should be noted that integers and floating-point numbers ignore the type difference and judge whether the values are equal.

## isnullish

Return `True` if the input value is `None` or `Undefined`, and `False` otherwise.

```python
isnullish(None) # True
isnullish(Undefined) # True
isnullish(0) # False
isnullish([]) # False
isnullish({}) # False
isnullish([None]) # False
isnullish([Undefined]) # False
```

## len

`len(x: str | [any] | {:}) -> int`
Expand Down
10 changes: 8 additions & 2 deletions docs/reference/model/datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ Return the `%Y-%m-%d %H:%M:%S` format date.

## now

`now() -> str`
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`

Return the local time. e.g. `'Sat Jun 06 16:26:11 1998'`
Return the local time format. e.g. 'Sat Jun 06 16:26:11 1998' or format the combined date and time per the specified format string, and the default date format is `%a %b %d %H:%M:%S %Y`.

## today

`today() -> str`

Return the `%Y-%m-%d %H:%M:%S.%{ticks}` format date.

## validate

`validate(date: str, format: str) -> bool`

Validate whether the provided date string matches the specified format.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ print(isunique(['abc', "abc"])) # False
print(isunique(['abc', "a${'bc'}"])) # False
```

## isnullish

如果输入值是 `None` 或 `Undefined`,则返回 `True`;否则返回 `False`。

```python
isnullish(None) # True
isnullish(Undefined) # True
isnullish(0) # False
isnullish([]) # False
isnullish({}) # False
isnullish([None]) # False
isnullish([Undefined]) # False
```

需要注意的是整数和浮点数会忽略类型差异,根据值是否相等判断。

## len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ weight: 100

## now

`now() -> str`
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`

返回当地时间,例如 `'Sat Jun 06 16:26:11 1998'`。
返回本地时间格式。例如:`Sat Jun 06 16:26:11 1998`,或者根据指定的格式字符串格式化组合的日期和时间,默认日期格式为 `%a %b %d %H:%M:%S %Y`。

## today

`today() -> str`

返回以 `%Y-%m-%d %H:%M:%S.%{ticks}` 格式表示的时间。

## validate

`validate(date: str, format: str) -> bool`

验证提供的日期字符串是否与指定格式匹配。
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ print(isunique(['abc', "abc"])) # False
print(isunique(['abc', "a${'bc'}"])) # False
```

## isnullish

如果输入值是 `None` 或 `Undefined`,则返回 `True`;否则返回 `False`。

```python
isnullish(None) # True
isnullish(Undefined) # True
isnullish(0) # False
isnullish([]) # False
isnullish({}) # False
isnullish([None]) # False
isnullish([Undefined]) # False
```

需要注意的是整数和浮点数会忽略类型差异,根据值是否相等判断。

## len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ weight: 100

## now

`now() -> str`
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`

返回当地时间,例如 `'Sat Jun 06 16:26:11 1998'`。
返回本地时间格式。例如:`Sat Jun 06 16:26:11 1998`,或者根据指定的格式字符串格式化组合的日期和时间,默认日期格式为 `%a %b %d %H:%M:%S %Y`。

## today

`today() -> str`

返回以 `%Y-%m-%d %H:%M:%S.%{ticks}` 格式表示的时间。

## validate

`validate(date: str, format: str) -> bool`

验证提供的日期字符串是否与指定格式匹配。
14 changes: 14 additions & 0 deletions versioned_docs/version-0.10/reference/model/builtin.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ print(isunique(['abc', "a${'bc'}"])) # False

It should be noted that integers and floating-point numbers ignore the type difference and judge whether the values are equal.

## isnullish

Return `True` if the input value is `None` or `Undefined`, and `False` otherwise.

```python
isnullish(None) # True
isnullish(Undefined) # True
isnullish(0) # False
isnullish([]) # False
isnullish({}) # False
isnullish([None]) # False
isnullish([Undefined]) # False
```

## len

`len(x: str | [any] | {:}) -> int`
Expand Down
10 changes: 8 additions & 2 deletions versioned_docs/version-0.10/reference/model/datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ Return the `%Y-%m-%d %H:%M:%S` format date.

## now

`now() -> str`
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`

Return the local time. e.g. `'Sat Jun 06 16:26:11 1998'`
Return the local time format. e.g. 'Sat Jun 06 16:26:11 1998' or format the combined date and time per the specified format string, and the default date format is `%a %b %d %H:%M:%S %Y`.

## today

`today() -> str`

Return the `%Y-%m-%d %H:%M:%S.%{ticks}` format date.

## validate

`validate(date: str, format: str) -> bool`

Validate whether the provided date string matches the specified format.
Loading