Skip to content

Commit

Permalink
Merge pull request #452 from Peefy/docs-0.10-system-module
Browse files Browse the repository at this point in the history
docs: add full v0.10 builtin and system module documents
  • Loading branch information
Peefy authored Aug 28, 2024
2 parents ae8c8fd + 00595af commit 5215b83
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 8 deletions.
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.

0 comments on commit 5215b83

Please sign in to comment.