1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 23:22:28 +08:00

doc: update doc styles

This commit is contained in:
dudaodong
2023-08-30 11:59:04 +08:00
parent 03d331dfb6
commit 21a952d2be
40 changed files with 839 additions and 901 deletions

View File

@@ -51,8 +51,6 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## 文档
### <span id="Of">Of</span>
@@ -65,7 +63,7 @@ import (
func Of[T any](elems ...T) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
```go
import (
@@ -95,7 +93,7 @@ func main() {
func FromSlice[T any](source []T) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/wywTO0XZtI4)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/wywTO0XZtI4)</span></b>
```go
import (
@@ -125,7 +123,7 @@ func main() {
func FromChannel[T any](source <-chan T) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9TZYugGMhXZ)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9TZYugGMhXZ)</span></b>
```go
import (
@@ -163,7 +161,7 @@ func main() {
func FromRange[T constraints.Integer | constraints.Float](start, end, step T) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9Ex1-zcg-B-)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9Ex1-zcg-B-)</span></b>
```go
import (
@@ -192,7 +190,7 @@ func main() {
func Generate[T any](generator func() func() (item T, ok bool)) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/rkOWL1yA3j9)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/rkOWL1yA3j9)</span></b>
```go
import (
@@ -232,7 +230,7 @@ func main() {
func Concat[T any](a, b stream[T]) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/HM4OlYk_OUC)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/HM4OlYk_OUC)</span></b>
```go
import (
@@ -265,7 +263,7 @@ func main() {
func (s stream[T]) Distinct() stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/eGkOSrm64cB)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/eGkOSrm64cB)</span></b>
```go
import (
@@ -299,7 +297,7 @@ func main() {
func (s stream[T]) Filter(predicate func(item T) bool) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/MFlSANo-buc)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/MFlSANo-buc)</span></b>
```go
import (
@@ -333,7 +331,7 @@ func main() {
func (s stream[T]) Map(mapper func(item T) T) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OtNQUImdYko)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/OtNQUImdYko)</span></b>
```go
import (
@@ -367,7 +365,7 @@ func main() {
func (s stream[T]) Peek(consumer func(item T)) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/u1VNzHs6cb2)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/u1VNzHs6cb2)</span></b>
```go
import (
@@ -404,7 +402,7 @@ func main() {
func (s stream[T]) Skip(n int) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fNdHbqjahum)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fNdHbqjahum)</span></b>
```go
import (
@@ -443,7 +441,7 @@ func main() {
func (s stream[T]) Limit(maxSize int) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qsO4aniDcGf)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/qsO4aniDcGf)</span></b>
```go
import (
@@ -482,7 +480,7 @@ func main() {
func (s stream[T]) Reverse() stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/A8_zkJnLHm4)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/A8_zkJnLHm4)</span></b>
```go
import (
@@ -512,7 +510,7 @@ func main() {
func (s stream[T]) Range(start, end int) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/indZY5V2f4j)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/indZY5V2f4j)</span></b>
```go
import (
@@ -551,7 +549,7 @@ func main() {
func (s stream[T]) Sorted(less func(a, b T) bool) stream[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/XXtng5uonFj)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/XXtng5uonFj)</span></b>
```go
import (
@@ -583,7 +581,7 @@ func main() {
func (s stream[T]) ForEach(action func(item T))
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Dsm0fPqcidk)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/Dsm0fPqcidk)</span></b>
```go
import (
@@ -616,7 +614,7 @@ func main() {
func (s stream[T]) Reduce(initial T, accumulator func(a, b T) T) T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/6uzZjq_DJLU)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/6uzZjq_DJLU)</span></b>
```go
import (
@@ -648,7 +646,7 @@ func main() {
func (s stream[T]) FindFirst() (T, bool)
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9xEf0-6C1e3)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/9xEf0-6C1e3)</span></b>
```go
import (
@@ -680,7 +678,7 @@ func main() {
func (s stream[T]) FindLast() (T, bool)
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/WZD2rDAW-2h)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/WZD2rDAW-2h)</span></b>
```go
import (
@@ -712,7 +710,7 @@ func main() {
func (s stream[T]) Max(less func(a, b T) bool) (T, bool)
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/fm-1KOPtGzn)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/fm-1KOPtGzn)</span></b>
```go
import (
@@ -744,7 +742,7 @@ func main() {
func (s stream[T]) Min(less func(a, b T) bool) (T, bool)
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/vZfIDgGNRe_0)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/vZfIDgGNRe_0)</span></b>
```go
import (
@@ -776,7 +774,7 @@ func main() {
func (s stream[T]) AllMatch(predicate func(item T) bool) bool
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/V5TBpVRs-Cx)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/V5TBpVRs-Cx)</span></b>
```go
import (
@@ -814,7 +812,7 @@ func main() {
func (s stream[T]) AnyMatch(predicate func(item T) bool) bool
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/PTCnWn4OxSn)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/PTCnWn4OxSn)</span></b>
```go
import (
@@ -852,7 +850,7 @@ func main() {
func (s stream[T]) NoneMatch(predicate func(item T) bool) bool
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/iWS64pL1oo3)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/iWS64pL1oo3)</span></b>
```go
import (
@@ -890,7 +888,7 @@ func main() {
func (s stream[T]) Count() int
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/r3koY6y_Xo-)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/r3koY6y_Xo-)</span></b>
```go
import (
@@ -921,7 +919,7 @@ func main() {
func (s stream[T]) ToSlice() []T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/jI6_iZZuVFE)</span></b>
```go
import (